Edits to pass code check and make style consistent.
This commit is contained in:
+2
-2
@@ -290,8 +290,8 @@ class TCIntf( Intf ):
|
|||||||
cmds += bwcmds
|
cmds += bwcmds
|
||||||
|
|
||||||
# Delay/jitter/loss/max_queue_size using netem
|
# Delay/jitter/loss/max_queue_size using netem
|
||||||
delaycmds, parent = self.delayCmds( delay=delay, jitter=jitter, loss=loss,
|
delaycmds, parent = self.delayCmds( delay=delay, jitter=jitter,
|
||||||
max_queue_size=max_queue_size,
|
loss=loss, max_queue_size=max_queue_size,
|
||||||
parent=parent )
|
parent=parent )
|
||||||
cmds += delaycmds
|
cmds += delaycmds
|
||||||
|
|
||||||
|
|||||||
+18
-13
@@ -13,28 +13,33 @@ setup for testing, and can even be emulated with the Mininet package.
|
|||||||
|
|
||||||
from mininet.util import irange, natural, naturalSeq
|
from mininet.util import irange, natural, naturalSeq
|
||||||
|
|
||||||
class Graph(object):
|
class Graph( object ):
|
||||||
"Utility class to track nodes and edges "
|
"Utility class to track nodes and edges - replaces networkx.Graph"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__( self ):
|
||||||
self.data = {}
|
self.data = {}
|
||||||
|
|
||||||
def add_node(self,node):
|
def add_node( self, node ):
|
||||||
|
"Add node to graph"
|
||||||
if node not in self.data.keys():
|
if node not in self.data.keys():
|
||||||
self.data[node] = []
|
self.data[ node ] = []
|
||||||
|
|
||||||
def add_edge(self,src,dest):
|
def add_edge( self, src, dest ):
|
||||||
self.add_node(src)
|
"Add edge to graph"
|
||||||
self.add_node(dest)
|
self.add_node( src )
|
||||||
self.data[src].append(dest)
|
self.add_node( dest )
|
||||||
|
self.data[ src ].append( dest )
|
||||||
|
|
||||||
def nodes(self):
|
def nodes( self ):
|
||||||
|
"Return list of graph nodes"
|
||||||
return self.data.keys()
|
return self.data.keys()
|
||||||
|
|
||||||
def edges(self):
|
def edges( self ):
|
||||||
|
"Iterator: return graph edges"
|
||||||
for src in self.data.keys():
|
for src in self.data.keys():
|
||||||
for dest in self.data[src]:
|
for dest in self.data[ src ]:
|
||||||
yield (src,dest)
|
yield ( src, dest )
|
||||||
|
|
||||||
|
|
||||||
class Topo(object):
|
class Topo(object):
|
||||||
"Data center network representation for structured multi-trees."
|
"Data center network representation for structured multi-trees."
|
||||||
|
|||||||
Reference in New Issue
Block a user