Revision c0eac366 py_logs_correlated_visualizer.py

View differences:

py_logs_correlated_visualizer.py
245 245
	simple_bar_graph(groups,accuracy,ylabel='receiving ratio')#,title='Chunks received ratio')
246 246
	save_figure(folder,'overall_loss')
247 247

  
248
def corr_neigh_impact_evolution(folder,groups):
249
  fig = plt.figure()
250
  for g in groups:
251
    filename = folder+'/'+g+'/network_impact.exp'
252
    if os.path.exists(filename):
253
      data = read_csv(filename).drop(['info_type','session_id'],1)
254
      data = data.groupby('time').median() # WARNING : with multiple sessions this value does no longer make sense
255
      plt.plot(data.index,data['netimpact'],label=g)
256
  
257
  plt.legend(loc='best')
258
  set_plot_labels(fig,'neighbourhood_evolution','time (s)','network impact')
259
  save_figure(folder,'neighbourhood_evolution')
260

  
261
def corr_neigh_impact_over_tag(folder,groups):
262
  fig = plt.figure()
263
  plot_data = {}
264
  for g in groups:
265
    if len(g.split('-')) > 1: 
266
      groupkey = g.split('-')[0]
267
      tag = g.split('-')[1]
268
      if groupkey not in plot_data.keys():
269
        plot_data[groupkey] = {}
270

  
271
      filename = folder+'/'+g+'/network_impact.exp'
272
      if os.path.exists(filename):
273
        data = read_csv(filename).drop(['info_type','session_id'],1)
274
        tag = int(''.join([c for c in list(tag) if c.isdigit()]))
275
        plot_data[groupkey][tag] = data['netimpact'].mean()
276
  
277
  if len(plot_data) > 0:
278
    for g in plot_data.keys():
279
      s = Series(plot_data[g])
280
      plt.plot(s.index,s,label=g)
281
    
282
    plt.legend(loc='best')
283
    set_plot_labels(fig,'','tag','network impact')
284
    save_figure(folder,'corr_netimpact')
285

  
248 286
def corr_visual_loss_active_peers(folder,groups):
249 287
	files = []
250 288
	accuracy = []
......
271 309
	mpl.rcParams.update({'font.size': 16})
272 310
	corr_visual_loss(folder,groups)
273 311
	corr_visual_loss_active_peers(folder,groups)
274
	corr_visual_hops(folder,groups)
275
	corr_visual_delay(folder,groups)
276
	delayVisualize2(folder,groups)
312
	corr_neigh_impact_evolution(folder,groups)
313
	corr_neigh_impact_over_tag(folder,groups)
314
	#corr_visual_hops(folder,groups)
315
	#corr_visual_delay(folder,groups)
316
	#delayVisualize2(folder,groups)
277 317

  
278 318
	if not save:
279 319
		plt.show()

Also available in: Unified diff