Distribution

class NetworkSim.simulation.tools.distribution.Distribution(seed, model=None)[source]

Distribution class to generate interarrival time based on the chosen distribution.

Parameters
  • model (Model, optional) – The network model used for simulation, containing network constants.

  • seed (int, optional) – The randomisation seed. Default is 0.

get_pareto_parameters()[source]

Calculation of Pareto distribution parameters.

Pareto distribution could be described by the pdf 1:

\[f(x) = \frac{ba^b}{x^{b+1}}\]

where \(a\) is the position parameter and \(b\) is the shape parameter.

The Hurst parameter is given by 2:

\[H = \frac{3 - b}{2}\]
Parameters

hurst_parameter (float, optional) – The Hurst parameter for the Pareto distribution. Default is 0.8 2. However, this parameter is not in use currently as the average bit rate is used to calculate the shape parameter.

Returns

  • position_parameter (float) – The position parameter.

  • shape_parameter (float) – The shape parameter.

References

1

Gebali, F., 2008. Analysis of computer and communication networks. Springer Science & Business Media.

2(1,2)

So, W.H. and Kim, Y.C., 2007. Fair MAC protocol for optical ring network of wavelength-shared access nodes. Photonic Network Communications, 13(3), pp.289-295.

get_poisson_parameters()[source]

Calculation of Poisson distribution parameters,

The interarrival time distribution follows a biased exponential distribution 3:

\[ \begin{align}\begin{aligned}f_T(t) = 0 \quad t<a\\f_T(t) = b \exp(-b(t-a)) \quad t \geq a\end{aligned}\end{align} \]

where \(a\geq 0\) is the position parameter and \(b>0\) is the shape parameter.

For a source with average rate \(\lambda_a\) and burst rate \(\sigma\):

\[ \begin{align}\begin{aligned}\frac{1}{\lambda_a} = a + \frac{1}{b}\\b = \frac{\sigma \lambda_a}{\sigma - \lambda_a}\end{aligned}\end{align} \]
Returns

interarrival – A list of interarrival time in ns.

Return type

list

References

3

Gebali, F., 2008. Analysis of computer and communication networks. Springer Science & Business Media.

pareto()[source]

Pareto distribution variate generation.

Returns

Return type

A new interarrival time calculated from the Pareto distribution.

poisson()[source]

Poisson distribution variate generation.

Returns

Return type

A new interarrival time calculated from the Poisson distribution.

uniform()[source]

A uniform distribution to generate a new destination node ID.

Returns

index – The index of the destination ID to be chosen.

Return type

int