def do((paras, G,i)): rlts={} sim=Simulation(paras, G=G.copy(), verbose=False) sim.make_simu(storymode=False) sim.queue=post_process_queue(sim.queue) rlts = compare_networks(sim, stat_distance = stat_distance) del sim return rlts
def do_shocks((paras, G)): """ Make the simulation and extract aggregate values, keeping separate the results for flights which have not been cancelled. Parameters ---------- paras : dictionary containing the parameters for the simulations. G : hybrid network Returns ------- results : dictionary gathers results from extract_aggregate_values_on_queue and extract_aggregate_values_on_network. Notes ----- Changed in 2.9.1: changed signature, removed integer i. """ results ={} sim = Simulation(paras, G=G.copy(), verbose=False) sim.make_simu(storymode=False) sim.queue = post_process_queue(sim.queue) G = sim.G results_queue = extract_aggregate_values_on_queue(sim.queue, paras['par']) queue_res = [f for f in sim.queue if G.G_nav.has_node(f.source) and G.G_nav.has_node(f.destination) and G.G_nav.node[f.source]['sec']!=paras['STS'] and G.G_nav.node[f.destination]['sec']!=paras['STS']] results_queue_res = extract_aggregate_values_on_queue(queue_res, paras['par']) results_G = extract_aggregate_values_on_network(sim.G) for met in results_G: results[met]=results_G[met] for met in results_queue_res: results_queue[met + '_res'] = results_queue_res[met] for met in results_queue: results[met]={tuple(p):[] for p in paras['par']} for p in paras['par']: results[met][tuple(p)]=results_queue[met][tuple(p)] del sim return results