Calculate fan-in and fan-out capacities for all nodes of the topology. The fan-in capacity of a node is the sum of capacities of all incoming links, while the fan-out capacity is the sum of capacities of all outgoing links.
Parameters : | topology : Topology
|
---|---|
Returns : | fan_in_out_capacities : tuple (fan_in, fan_out)
|
Examples
>>> import fnss
>>> topology = fnss.star_topology(3)
>>> fnss.set_capacities_constant(topology, 10, 'Mbps')
>>> in_cap, out_cap = fnss.fan_in_out_capacities(topology)
>>> in_cap
{0: 30, 1: 10, 2: 10, 3: 10}
>>> out_cap
{0: 30, 1: 10, 2: 10, 3: 10}