while True:
if spread == 'gauss':
ga = abs(random.gauss(0, 1))
- rv = int(ga*float(maxn)/3)
+ rv = int(ga * float(maxn) / 3)
if rv < maxn:
return rv
elif spread == 'linear':
It also returns a dictionary with statsistics."""
swflows = [_randomize(swspread, switches) for f in range(int(flows))]
# we have to increse the switch index because mininet start indexing switches from 1 (not 0)
- fltables = [(s+1, _randomize(tabspread, tables), idx) for idx, s in enumerate(swflows)]
+ fltables = [(s + 1, _randomize(tabspread, tables), idx) for idx, s in enumerate(swflows)]
notes = _get_notes(fltables)
return fltables, notes
Returns:
:returns (switches, flows_reported, flows-found): tupple with counts of switches, reported and found flows
"""
- # print type(flow_details), flow_details
active_flows = 0
found_flows = 0
switches = _get_operational_inventory_of_switches(controller)
active_flows += t['opendaylight-flow-table-statistics:flow-table-statistics']['active-flows']
if 'flow' in t:
found_flows += len(t['flow'])
- print "Switches,ActiveFlows(reported)/FlowsFound", len(switches), active_flows, found_flows
+ print("Switches,ActiveFlows(reported)/FlowsFound", len(switches), active_flows, found_flows)
return len(switches), active_flows, found_flows