GridSim 5.0 beta

gridsim.util
Class Poisson

Object
  extended by Poisson
All Implemented Interfaces:
DiscreteGenerator, Generator

public class Poisson
extends Object
implements DiscreteGenerator

A random number generator based on the Poisson distribution.
NOTE: This is an updated version that fixes a bug in Sim_poisson_obj.sample() method. In the previous version, it always return a zero value.

Version:
1.0, 14 May 2002
Author:
Costas Simatos

Constructor Summary
Poisson(String name, double mean)
          Constructor with which Sim_system is allowed to set the random number generator's seed
Poisson(String name, double mean, long seed)
          The constructor with which a specific seed is set for the random number generator
 
Method Summary
 String get_name()
          Get the random number generator's name.
 long get_seed()
          Get the random number generator's seed.
 long sample()
          Generate a new random number.
(package private) static long sample(Sim_random_obj source, double mean)
          Generate a new random number.
 void set_seed(long seed)
          Set the random number generator's seed.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Poisson

public Poisson(String name,
               double mean)
Constructor with which Sim_system is allowed to set the random number generator's seed

Parameters:
name - The name to be associated with this instance
mean - The mean of the distribution

Poisson

public Poisson(String name,
               double mean,
               long seed)
The constructor with which a specific seed is set for the random number generator

Parameters:
name - The name to be associated with this instance
mean - The mean of the distribution
seed - The initial seed for the generator, two instances with the same seed will generate the same sequence of numbers
Method Detail

sample

public long sample()
Generate a new random number.

Specified by:
sample in interface DiscreteGenerator
Returns:
The next random number in the sequence

sample

static long sample(Sim_random_obj source,
                   double mean)
Generate a new random number. It is used by other distributions that rely on the Poisson distribution

Returns:
The next random number in the sequence

set_seed

public void set_seed(long seed)
Set the random number generator's seed.

Specified by:
set_seed in interface Generator
Parameters:
seed - The new seed for the generator

get_seed

public long get_seed()
Get the random number generator's seed.

Specified by:
get_seed in interface Generator
Returns:
The generator's seed

get_name

public String get_name()
Get the random number generator's name.

Specified by:
get_name in interface Generator
Returns:
The generator's name

GridSim 5.0 beta

The University of Melbourne, Australia, 2009