### Navigation

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

# fnss.netconfig.weights.set_weights_constant

`set_weights_constant`(topology, weight=1.0, links=None)

  Assign a constant weight to all selected links

  Parameters: | topology : Topology The topology on which weights are applied. weight : float, optional The constant weight to be applied to all links links : iterable, optional Iterable container of selected links on which weights are applied. If it is None, all links are selected

  Examples

      >>> import fnss
      >>> topology = fnss.Topology()
      >>> topology.add_edges_from([(1, 2), (5, 8), (4, 5), (1, 7)])
      >>> fnss.set_weights_constant(topology, weight=1.0, links=[(1, 2), (5, 8), (4, 5)])

### Navigation

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