fnss.netconfig.capacities.set_capacities_random_zipf

set_capacities_random_zipf(topology, capacities, capacity_unit='Mbps', alpha=1.1, reverse=False)[source]

Set random link capacities according to a Zipf probability density function.

The same objective can be achieved by invoking the function set_capacities_random_zipf_mandlebrot with parameter q set to 0.

This capacity allocation consists in the following steps:

  1. All capacities are sorted in descending or order (or ascending if reverse is True)
  2. The i-th value of the sorted capacities list is then assigned to a link with probability

p(i) = \frac{1/i^\alpha}{\sum_{i = 1}^{N}{1/i^\alpha}}.

Parameters:
topology : Topology

The topology to which link capacities will be set

capacities : list

A list of all possible capacity values

capacity_unit : str, optional

The unit in which capacity value is expressed (e.g. Mbps, Gbps etc..)

alpha : float, default 1.1

The :math`lpha` parameter of the Zipf density function

reverse : bool, optional

If False, lower capacity links are the most frequent, if True, higher capacity links are more frequent