fnss.netconfig.weights.get_weights

get_weights(topology)[source]

Returns all the weights.

Parameters:
topology : Topology
Returns:
weights : dict

Dictionary of weights keyed by link.

Examples

>>> import fnss
>>> topology = fnss.Topology()
>>> topology.add_path([1, 2, 3])
>>> fnss.set_weights_constant(topology, weight=2.0)
>>> weight = fnss.get_weights(topology)
>>> weight[(1,2)]
2.0