Class ZipfDistr
java.lang.Object
org.cloudbus.cloudsim.distributions.ZipfDistr
- All Implemented Interfaces:
ContinuousDistribution
public class ZipfDistr extends java.lang.Object implements ContinuousDistribution
A Pseudo-Random Number Generator following the
Zipf distribution.
- Since:
- CloudSim Toolkit 1.0
- Author:
- Marcos Dias de Assuncao, Manoel Campos da Silva Filho
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ZipfDistr(double shape, int population)
Creates a Zipf Pseudo-Random Number Generator (RNG).ZipfDistr(double shape, int population, long seed)
Creates a Zipf Pseudo-Random Number Generator (RNG).ZipfDistr(double shape, int population, long seed, org.apache.commons.math3.random.RandomGenerator rng)
Creates a Zipf Pseudo-Random Number Generator (RNG). -
Method Summary
-
Constructor Details
-
ZipfDistr
public ZipfDistr(double shape, int population)Creates a Zipf Pseudo-Random Number Generator (RNG).Internally, it relies on the
JDKRandomGenerator
, a wrapper for theRandom
class that doesn't have high-quality randomness properties but is very fast.- Parameters:
shape
- the shape distribution parameterpopulation
- the population distribution parameter- See Also:
ZipfDistr(double, int, long, RandomGenerator)
-
ZipfDistr
public ZipfDistr(double shape, int population, long seed)Creates a Zipf Pseudo-Random Number Generator (RNG).Internally, it relies on the
JDKRandomGenerator
, a wrapper for theRandom
class that doesn't have high-quality randomness properties but is very fast.- Parameters:
shape
- the shape distribution parameterpopulation
- the population distribution parameterseed
- the seed- See Also:
ZipfDistr(double, int, long, RandomGenerator)
-
ZipfDistr
public ZipfDistr(double shape, int population, long seed, org.apache.commons.math3.random.RandomGenerator rng)Creates a Zipf Pseudo-Random Number Generator (RNG).- Parameters:
shape
- the shape distribution parameterpopulation
- the population distribution parameterseed
- the seed already used to initialize the Pseudo-Random Number Generatorrng
- the actual Pseudo-Random Number Generator that will be the base to generate random numbers following a continuous distribution.
-
-
Method Details
-
sample
public double sample()Description copied from interface:ContinuousDistribution
Generate a new pseudo random number.- Specified by:
sample
in interfaceContinuousDistribution
- Returns:
- the next pseudo random number in the sequence, following the implemented distribution.
-
getSeed
public long getSeed()Description copied from interface:ContinuousDistribution
Gets the seed used to initialize the generator- Specified by:
getSeed
in interfaceContinuousDistribution
- Returns:
-