示例#1
0
    cost1 = []
    cost2 = []
    for group in utils.listGroups():
        for fn in utils.listGroupInstances(group):
            print(fn)
            topology = fn.split('.')[0]
            data = utils.read_data(group, 'identificationCost', topology)
            assert data != None, topology
            c = int(max(data['runtime']))
            cost1.append(c)
            data = utils.read_data(group, 'identificationCost', topology)
            assert data != None, topology
            c = int(max(data['newIGP']))
            cost2.append(c)
    groups = [str(i) for i in range(max(len(cost1), len(cost2)))]
    cost1 = utils.data_to_bar(cost1)
    cost2 = utils.data_to_bar(cost2)
    utils.make_g_barplot([cost1, cost2], groups,
                         ['original IGP', 'ECMP-free and complete IGP'],
                         ['#3CAEA3', '#ED553B'],
                         'maximum identification sr-cylce segment cost',
                         'percentage of topologies', '',
                         '../data/plot/minSegCover_identification.eps', 50)
"""
  ax = plt.subplot()
  plot(x, y)
  plt.xlabel("Topology size |G|")
  plt.ylabel("Runtime in seconds")
  plt.savefig('../data/plot/minSegCover_runtime_by_size_complete.eps', format='eps', dpi=600, bbox_inches='tight')  
"""
示例#2
0
if __name__ == '__main__':
    cost = []
    for group in utils.listGroups():
        for fn in utils.listGroupInstances(group):
            print(fn)
            topology = fn.split('.')[0]
            data = utils.read_data(group, 'edgeDisjointPaths', topology)
            assert data != None, topology
            res = data['results']
            for r in res:
                cost.append(r['maxSeg'])
    cost = utils.count(cost)
    cost = utils.dict_to_bar(cost)
    cost = utils.array_to_percent(cost)
    s = 0
    for i in range(6, len(cost)):
        s += cost[i]
    print(s)
    groups = [str(i) for i in range(len(cost))]
    utils.make_g_barplot([cost], groups, ['seg cost'], ['#3CAEA3'],
                         'segment cost', 'percentage of topologies', '',
                         '../data/plot/minCostEDP_segcost.eps', 5)
"""
  ax = plt.subplot()
  plot(x, y)
  plt.xlabel("Topology size |G|")
  plt.ylabel("Runtime in seconds")
  plt.savefig('../data/plot/minSegCover_runtime_by_size.eps', format='eps', dpi=600, bbox_inches='tight')  
"""
示例#3
0
文件: MCFseg.py 项目: yunoac/thesis
import utils

if __name__ == '__main__':
  labels = [ ]
  max_seg = { }
  for group in utils.listGroups():
    for fn in utils.listGroupInstances(group):
      name = fn.split('.')[0]
      data = utils.read_data(group, 'MCFsegcost', name)
      if data == None: continue
      nb_seg = data['nbSeg']
      m = max(nb_seg)
      if m not in max_seg:
        max_seg[m] = 0
      max_seg[m] += 1
  mseg = utils.array_to_percent(utils.dict_to_bar(max_seg))
  groups = [ str(i) for i in range(len(mseg)) ]
  utils.make_g_barplot([mseg], groups, ['seg cost'], ['#3CAEA3'], 'maximum segment cost', 'percentage of topologies', 'maximum segment cost over all topologies <= 50', '../data/plot/mcf_seg.eps', 10)
示例#4
0
    cost1 = []
    cost2 = []
    for group in utils.listGroups():
        for fn in utils.listGroupInstances(group):
            print(fn)
            topology = fn.split('.')[0]
            data = utils.read_data(group, 'minCover', topology)
            assert data != None, topology
            c = int(data['initialCoverSeg'])
            cost1.append(c)
            data = utils.read_data(group, 'minCover_complete', topology)
            assert data != None, topology
            c = int(data['initialCoverSeg'])
            cost2.append(c)
    print(utils)
    groups = [str(i) for i in range(max(len(cost1), len(cost2)))]
    cost1 = utils.data_to_bar(cost1)
    cost2 = utils.data_to_bar(cost2)
    utils.make_g_barplot([cost1, cost2], groups,
                         ['original IGP', 'ECMP-free and complete IGP'],
                         ['#3CAEA3', '#ED553B'], 'segment cost',
                         'percentage of topologies', '',
                         '../data/plot/minSegCover_segcost_complete.eps', 5)
"""
  ax = plt.subplot()
  plot(x, y)
  plt.xlabel("Topology size |G|")
  plt.ylabel("Runtime in seconds")
  plt.savefig('../data/plot/minSegCover_runtime_by_size_complete.eps', format='eps', dpi=600, bbox_inches='tight')  
"""
import numpy as np
from pylab import *
import argparse
import os
import json
import utils

if __name__ == '__main__':
  cost1 = [ ]
  for group in utils.listGroups():
    for fn in utils.listGroupInstances(group):
      print(fn)
      topology = fn.split('.')[0]
      data = utils.read_data(group, 'identificationCost', topology)
      assert data != None, topology
      c = int(max(data['originalIGP']))
      cost1.append(c)
  groups = [ str(i) for i in range(len(cost1)) ]
  cost1 = utils.data_to_bar(cost1)
  utils.make_g_barplot([cost1], groups, ['original IGP'], ['#3CAEA3'], 'maximum identification sr-cylce segment cost', 'percentage of topologies', '', '../data/plot/minSegCover_identification_orig.eps', 50)
"""
  ax = plt.subplot()
  plot(x, y)
  plt.xlabel("Topology size |G|")
  plt.ylabel("Runtime in seconds")
  plt.savefig('../data/plot/minSegCover_runtime_by_size_complete.eps', format='eps', dpi=600, bbox_inches='tight')  
"""
示例#6
0
import numpy as np
from pylab import *
import argparse
import os
import json

import utils

if __name__ == '__main__':
    s = []
    for group in utils.listGroups():
        for fn in utils.listGroupInstances(group):
            print(fn)
            topology = fn.split('.')[0]
            data = utils.read_data(group, 'primeIGP', topology)
            assert data != None, topology
            s.append(int(data['s']))
    print(s)
    s = utils.data_to_bar(s)
    groups = [str(i) for i in range(len(s))]
    utils.make_g_barplot([s], groups, ['s'], ['#3CAEA3'], 'value of s',
                         'percentage of topologies', '',
                         '../data/plot/primeIGP_s.eps', 5)