org.jscience.architecture.lift
Class PoissonPassengerGenerator

java.lang.Object
  extended by org.jscience.architecture.lift.Tickable
      extended by org.jscience.architecture.lift.PassengerGenerator
          extended by org.jscience.architecture.lift.PoissonPassengerGenerator
All Implemented Interfaces:
TickableInterface

public class PoissonPassengerGenerator
extends PassengerGenerator

This file is licensed under the GNU Public Licens (GPL).
This is a fairly simple PassengerGenerator that beheaves like a handful of Poisson-distributions. It actually uses pseudorandom numbers to generate a new Passenger. In every Tick for each floor X, a new Passenger from floor X to a random non-X floor is generated if and only if Gammas[X]>=PR where PR is the latest pseudorandom number. The pseudorandom number generator can be initialized to a specific value through RandomSeed.


Field Summary
 
Fields inherited from class org.jscience.architecture.lift.PassengerGenerator
Passengers
 
Constructor Summary
PoissonPassengerGenerator()
          Calls PoissonPassengerGenerator(newdouble[World.getNoF()]).
PoissonPassengerGenerator(double[] GammaValues)
          Constructs a new PoissonPassengerGenerator using the GammaValues to initialize the Gammas mentioned in the class descripiton.
PoissonPassengerGenerator(double[] GammaValues, long RandomSeed)
          Constructs a new PoissonPassengerGenerator using the GammaValues to initialize the Gammas and RandomSeed to initialize the pseudorandom number generator mentioned in the class descripiton.
PoissonPassengerGenerator(long RandomSeed)
          Calls PoissonPassengerGenerator(newdouble[World.getNoF()], RandomSeed).
 
Method Summary
 java.lang.String getName()
          Returns the Name of the object.
 java.lang.String getVersion()
          Returns the Version of the object
 void setGamma(int AbsFloor, double NewGamma)
          Sets the Gamma of the AbsFloorth floor to NewGamma.
 void Tick()
          This function is called in each step of the simulator.
 
Methods inherited from class org.jscience.architecture.lift.PassengerGenerator
getGeneratedPassengers
 
Methods inherited from class org.jscience.architecture.lift.Tickable
getFullName, getID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoissonPassengerGenerator

public PoissonPassengerGenerator()
Calls PoissonPassengerGenerator(newdouble[World.getNoF()]).


PoissonPassengerGenerator

public PoissonPassengerGenerator(long RandomSeed)
Calls PoissonPassengerGenerator(newdouble[World.getNoF()], RandomSeed).


PoissonPassengerGenerator

public PoissonPassengerGenerator(double[] GammaValues)
Constructs a new PoissonPassengerGenerator using the GammaValues to initialize the Gammas mentioned in the class descripiton.


PoissonPassengerGenerator

public PoissonPassengerGenerator(double[] GammaValues,
                                 long RandomSeed)
Constructs a new PoissonPassengerGenerator using the GammaValues to initialize the Gammas and RandomSeed to initialize the pseudorandom number generator mentioned in the class descripiton.

Method Detail

Tick

public void Tick()
Description copied from interface: TickableInterface
This function is called in each step of the simulator. In other words, this method is called whenever a discrete simulation step (0.1 second) happens. All objects that are time-variant is notified by this method that some time has elapsed since.

Specified by:
Tick in interface TickableInterface
Specified by:
Tick in class Tickable

getName

public java.lang.String getName()
Description copied from interface: TickableInterface
Returns the Name of the object.

Specified by:
getName in interface TickableInterface
Overrides:
getName in class PassengerGenerator
Returns:
DOCUMENT ME!

getVersion

public java.lang.String getVersion()
Description copied from interface: TickableInterface
Returns the Version of the object

Specified by:
getVersion in interface TickableInterface
Specified by:
getVersion in class Tickable
Returns:
DOCUMENT ME!

setGamma

public void setGamma(int AbsFloor,
                     double NewGamma)
Sets the Gamma of the AbsFloorth floor to NewGamma.

Parameters:
AbsFloor - DOCUMENT ME!
NewGamma - DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!