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
|
||||
|
||||
# Delay/jitter/loss/max_queue_size using netem
|
||||
delaycmds, parent = self.delayCmds( delay=delay, jitter=jitter, loss=loss,
|
||||
max_queue_size=max_queue_size,
|
||||
delaycmds, parent = self.delayCmds( delay=delay, jitter=jitter,
|
||||
loss=loss, max_queue_size=max_queue_size,
|
||||
parent=parent )
|
||||
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
|
||||
|
||||
class Graph(object):
|
||||
"Utility class to track nodes and edges "
|
||||
class Graph( object ):
|
||||
"Utility class to track nodes and edges - replaces networkx.Graph"
|
||||
|
||||
def __init__(self):
|
||||
def __init__( self ):
|
||||
self.data = {}
|
||||
|
||||
def add_node(self,node):
|
||||
def add_node( self, node ):
|
||||
"Add node to graph"
|
||||
if node not in self.data.keys():
|
||||
self.data[node] = []
|
||||
self.data[ node ] = []
|
||||
|
||||
def add_edge(self,src,dest):
|
||||
self.add_node(src)
|
||||
self.add_node(dest)
|
||||
self.data[src].append(dest)
|
||||
def add_edge( self, src, dest ):
|
||||
"Add edge to graph"
|
||||
self.add_node( src )
|
||||
self.add_node( dest )
|
||||
self.data[ src ].append( dest )
|
||||
|
||||
def nodes(self):
|
||||
def nodes( self ):
|
||||
"Return list of graph nodes"
|
||||
return self.data.keys()
|
||||
|
||||
def edges(self):
|
||||
def edges( self ):
|
||||
"Iterator: return graph edges"
|
||||
for src in self.data.keys():
|
||||
for dest in self.data[src]:
|
||||
yield (src,dest)
|
||||
for dest in self.data[ src ]:
|
||||
yield ( src, dest )
|
||||
|
||||
|
||||
class Topo(object):
|
||||
"Data center network representation for structured multi-trees."
|
||||
|
||||
Reference in New Issue
Block a user