Пример #1
0
def plot_NB_ROUTES_BETWEEN_PAIRS(experiments_results, x_param=None, restrict_to_other_params={}, save_to=None, overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'routes_btw_pairs/')
    y_stat = (_NB_ROUTES_BETWEEN_PAIRS, '# routes btw pairs of node', 'routes_btw_pairs')
     

    plot_simple_metric(experiments_results, MEASURE_PARAMS, y_stat=y_stat, x_param=x_param, several_curves=['mean', 'min', 'max'], restrict_to_other_params=restrict_to_other_params, save_to=save_to, overwrite_existing=overwrite_existing)
Пример #2
0
def plot_MEAN_WAITING_TIME_REAL_MSGS(experiments_results,
                                     x_param=None,
                                     restrict_to_other_params={},
                                     save_to=None,
                                     overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'real_msgs_waiting_time_mean/')
    y_stat = (_MEAN_WAITING_TIME_REAL_MSGS, '# rounds',
              'real_msgs_waiting_time_mean')

    # The man waiting time of real messages is not computed during simulation.
    # But it can be deduced from the histogram of real message waiting time.
    # This data is processed here, thus computing the mean waiting time of real
    # messages
    for r in experiments_results:
        if _MEAN_WAITING_TIME_REAL_MSGS in r['results']['overall']:
            break
        r['results']['overall'][_MEAN_WAITING_TIME_REAL_MSGS] = RunningStat()
        for n_rounds, n_occurences in r['results']['overall'][
                _HIST_WAITING_TIME_REAL_MSGS].items():
            for _ in range(round(n_occurences.total)):
                r['results']['overall'][
                    _MEAN_WAITING_TIME_REAL_MSGS].push_value(n_rounds)


#         r['results']['overall'][_MEAN_WAITING_TIME_REAL_MSGS] /= sum(n.total for n in r['results']['overall'][_HIST_WAITING_TIME_REAL_MSGS].values())

    plot_simple_metric(experiments_results,
                       MEASURE_PARAMS,
                       y_stat=y_stat,
                       x_param=x_param,
                       restrict_to_other_params=restrict_to_other_params,
                       save_to=save_to,
                       overwrite_existing=overwrite_existing)
Пример #3
0
def plot_OCOM_PHASE_TIME(experiments_results,
                         x_param=None,
                         restrict_to_other_params={},
                         save_to=None,
                         overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'ocom_phase_latency/')
    y_stat = (_OCOM_PHASE_TIME, 'ocom. phase latency', 'ocom_phase_latency')

    plot_simple_metric(experiments_results,
                       MEASURE_PARAMS,
                       y_stat=y_stat,
                       x_param=x_param,
                       restrict_to_other_params=restrict_to_other_params,
                       save_to=save_to,
                       overwrite_existing=overwrite_existing)
Пример #4
0
def plot_TOPO_DISS_TIME(experiments_results,
                        x_param=None,
                        restrict_to_other_params={},
                        save_to=None,
                        overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'topo_diss_latency/')
    y_stat = (_TOPO_DISS_TIME, 'topo.diss. latency', 'topo_diss_latency')

    plot_simple_metric(experiments_results,
                       MEASURE_PARAMS,
                       y_stat=y_stat,
                       x_param=x_param,
                       restrict_to_other_params=restrict_to_other_params,
                       save_to=save_to,
                       overwrite_existing=overwrite_existing)
Пример #5
0
def plot_RATIO_DUMMY_BCAST(experiments_results,
                           x_param=None,
                           restrict_to_other_params={},
                           save_to=None,
                           overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'ratio_round_with_dumbcast/')
    y_stat = (_RATIO_DUMMY_BCAST, '# rounds w/ dum. bcast. / # rounds',
              'ratio_round_with_dumbcast')

    plot_simple_metric(experiments_results,
                       MEASURE_PARAMS,
                       y_stat=y_stat,
                       x_param=x_param,
                       restrict_to_other_params=restrict_to_other_params,
                       save_to=save_to,
                       overwrite_existing=overwrite_existing)
Пример #6
0
def plot_RATIO_REAL_OVER_DUMMY_MSGS(experiments_results,
                                    x_param=None,
                                    restrict_to_other_params={},
                                    save_to=None,
                                    overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'ratio_reals_over_dummies/')
    y_stat = (_RATIO_REAL_OVER_DUMMY_MSGS, '# reals / # dummies',
              'ratio_reals_over_dummies')

    plot_simple_metric(experiments_results,
                       MEASURE_PARAMS,
                       y_stat=y_stat,
                       x_param=x_param,
                       restrict_to_other_params=restrict_to_other_params,
                       save_to=save_to,
                       overwrite_existing=overwrite_existing)
Пример #7
0
def plot_OCOM_MSG_TIME_WITHOUT_INIT(experiments_results,
                                    x_param=None,
                                    restrict_to_other_params={},
                                    save_to=None,
                                    overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'ocom_one_msg_latency_no_init/')
    y_stat = (_OCOM_MSG_TIME_WITHOUT_INIT, 'ocom. one msg latency w/o init',
              'ocom_one_msg_latency_no_init')

    plot_simple_metric(experiments_results,
                       MEASURE_PARAMS,
                       y_stat=y_stat,
                       x_param=x_param,
                       restrict_to_other_params=restrict_to_other_params,
                       save_to=save_to,
                       overwrite_existing=overwrite_existing)
Пример #8
0
def plot_EQUILIBRIUM_PER_ROUND(experiments_results,
                               x_param=None,
                               restrict_to_other_params={},
                               save_to=None,
                               overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'equilibirum_per_round/')
    y_stat = (_EQUILIBRIUM_PER_ROUND,
              'avg. equilibrium of each node at each round',
              'equilibirum_per_round')

    plot_simple_metric(experiments_results,
                       MEASURE_PARAMS,
                       y_stat=y_stat,
                       x_param=x_param,
                       several_curves=['lbound', 'equilibrium', 'ubound'],
                       restrict_to_other_params=restrict_to_other_params,
                       save_to=save_to,
                       overwrite_existing=overwrite_existing)
Пример #9
0
def plot_LATENCY_RT_PROPS(experiments_results, x_param=None, restrict_to_other_params={}, save_to=None, overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'latency_rt_prop/')
    y_stat = (_LATENCY_RT_PROPS, 'avg. latency of a rt prop', 'rt_prop_latency')
  
    plot_simple_metric(experiments_results, MEASURE_PARAMS, y_stat=y_stat, x_param=x_param, several_curves=['mean', 'min', 'max'], restrict_to_other_params=restrict_to_other_params, save_to=save_to, overwrite_existing=overwrite_existing)
Пример #10
0
def plot_RATIO_ROUTES_LENGTH_SHORTEST_PATH(experiments_results, x_param=None, restrict_to_other_params={}, save_to=None, overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'ratio_routes_to_short_path/')
    y_stat = (_RATIO_ROUTES_LENGTH_SHORTEST_PATH, '|routes|/|shortest routes|', 'ratio_routes_to_short_path')
     
    plot_simple_metric(experiments_results, MEASURE_PARAMS, y_stat=y_stat, x_param=x_param, restrict_to_other_params=restrict_to_other_params, save_to=save_to, overwrite_existing=overwrite_existing)
Пример #11
0
def plot_RATIO_ACCEPTED_PROPOSED_ROUTES(experiments_results, x_param=None, restrict_to_other_params={}, save_to=None, overwrite_existing=False):
    if save_to is not None:
        save_to = os.path.join(save_to, 'ratio_accepted_proposed_routes/')
    y_stat = (_RATIO_ACCEPTED_PROPOSED_ROUTES, '#accepted/#proposed', 'ratio_accepted_proposed_routes')
     
    plot_simple_metric(experiments_results, MEASURE_PARAMS, y_stat=y_stat, x_param=x_param, restrict_to_other_params=restrict_to_other_params, save_to=save_to, overwrite_existing=overwrite_existing)