jartege
Class ConstantProbability

java.lang.Object
  extended byjartege.ConstantProbability
All Implemented Interfaces:
CreationProbability

public class ConstantProbability
extends java.lang.Object
implements CreationProbability

The class ConstantProbability allows to create creation probability functions which are constant. A creation probablity function defines the probability of creation of an object in function of the number of already created objects. This probability is constant.


Constructor Summary
ConstantProbability(double constant)
          Constructs a new creation probability function defined by the specified constant.
 
Method Summary
 double getConstant()
          Returns the constant probability of this constant creation probability function.
 double theFunction(int nbCreatedObjects)
          The creation probability function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantProbability

public ConstantProbability(double constant)
Constructs a new creation probability function defined by the specified constant.

Parameters:
constant - the constant value of the constant probability function.
Method Detail

theFunction

public double theFunction(int nbCreatedObjects)
The creation probability function.
    theFunction(nbCreatedObjects) = constant value.

Specified by:
theFunction in interface CreationProbability
Parameters:
nbCreatedObjects - the number of already created objects.

getConstant

public double getConstant()
Returns the constant probability of this constant creation probability function.