mininet-sample/src/mpLinkCharacteristics.py
Benjamin Hesmans b08d952454 wip
correct var names for mininet

Signed-off-by: Benjamin Hesmans <benjamin.hesmans@uclouvain.be>
2015-01-07 14:52:43 +01:00

25 lines
563 B
Python

class MpLinkCharacteristics:
def __init__(self, id, delay, queueSize, bandwidth):
self.id = id
self.delay = delay
self.queueSize = queueSize
self.bandwidth = bandwidth
def asDict(self):
d = {}
d['bw'] = int(self.bandwidth)
d['delay'] = self.delay + "ms"
d['max_queue_size'] = int(self.queueSize)
return d
def __str__(self):
s = "Link id : " + str(self.id) + "\n"
s = s + "\tDelay : " + str(self.delay) + "\n"
s = s + "\tQueue Size : " + str(self.queueSize) + "\n"
s = s + "\tBandwidth : " + str(self.bandwidth)
return s