rename Topo() methods for consistency: add_node() -> addNode()

This commit is contained in:
Bob Lantz
2012-08-16 18:48:41 -07:00
parent 01e0758e5d
commit ce15c4f67d
5 changed files with 39 additions and 39 deletions
+3 -3
View File
@@ -15,13 +15,13 @@ class SingleSwitchTopo(Topo):
"Single switch connected to n hosts."
def __init__(self, n=2, **opts):
Topo.__init__(self, **opts)
switch = self.add_switch('s1')
switch = self.addSwitch('s1')
for h in range(n):
# Each host gets 50%/n of system CPU
host = self.add_host('h%s' % (h + 1),
host = self.addHost('h%s' % (h + 1),
cpu=.5 / n)
# 10 Mbps, 5ms delay, 10% loss
self.add_link(host, switch,
self.addLink(host, switch,
bw=10, delay='5ms', loss=10, use_htb=True)
def perfTest():