jartege
Class ThresholdProbability

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

public class ThresholdProbability
extends java.lang.Object
implements CreationProbability

The class ThresholdProbability allows to create creation probability functions defined by a threshold value. A creation probablity function defines the probability of creation of an object in function of the number of already created objects. Threshold probability functions are defined by a threshold value which indicates when the probability goes from 1 to 0.


Constructor Summary
ThresholdProbability(int threshold)
          Constructs a new creation probability function defined by the specified threshold.
 
Method Summary
 int getThreshold()
          Returns the threshold of this 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

ThresholdProbability

public ThresholdProbability(int threshold)
Constructs a new creation probability function defined by the specified threshold.

Parameters:
threshold - the threshold of the creation probability function.
Method Detail

theFunction

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

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

getThreshold

public int getThreshold()
Returns the threshold of this creation probability function.