fnss.netconfig.weights.get_weights — FNSS 0.1.2 documentation

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- FNSS 0.1.2 documentation »
- API Reference »
- Functions »

# fnss.netconfig.weights.get_weights

`get_weights`(topology)

  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

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- FNSS 0.1.2 documentation »
- API Reference »
- Functions »