public class CustomDistributionOfOptions<E extends java.lang.Enum<E>>
extends java.lang.Object
implements java.io.Serializable
Constructor and Description 

CustomDistributionOfOptions(E[] values,
double[] rates)
Constructs a custom empirical distribution from the given arrays of enum constants and corresponding
rates.
Note that some arrays are used by reference and can be modified. The random number generator is not set after this constructor and must then be provided in each call of get( Random ) method. 
CustomDistributionOfOptions(E[] values,
double[] rates,
java.util.Random rng)
Constructs a custom empirical distribution from the given arrays of enum constants and corresponding
rates.
Note that some arrays are used by reference and can be modified. The random number generator is set after this constructor, so you can use both get() and get( Random ) methods. 
CustomDistributionOfOptions(E[] values,
double[] rates,
Utilities owner)
Constructs a custom empirical distribution from the given arrays of enum constants and corresponding
rates.
Note that some arrays are used by reference and can be modified. The random number generator will be obtained from the given owner (agent/experiment). 
Modifier and Type  Method and Description 

E 
get()
Returns a random value distributed according to the given table of (value,rate) pairs.

E 
get(java.util.Random rng)
Returns a random value distributed according to the given table of (value,rate) pairs.

java.lang.String 
toString()
Returns the textual representation of the distribution.

public CustomDistributionOfOptions(E[] values, double[] rates, java.util.Random rng)
Agent
or Experiment
.values
 the array of values (2 or more, no duplicates, can be sorted or not)rates
 the array of probability rates (same size as values, no negative rates)rng
 the random number generator that will be usedpublic CustomDistributionOfOptions(E[] values, double[] rates, Utilities owner)
owner
(agent/experiment).values
 the array of values (2 or more, no duplicates, can be sorted or not)rates
 the array of probability rates (same size as values, no negative rates)owner
 owner of distribution, will be used as a source of random number generationpublic CustomDistributionOfOptions(E[] values, double[] rates)
values
 the array of values (2 or more, no duplicates, can be sorted or not)rates
 the array of probability rates (same size as values, no negative rates)public E get(java.util.Random rng)
Agent
or an Experiment
and wish to use the default RNG of the
simulation engine you may write get( getDefaultRandomGenerator() ).rng
 the random number generator to be used.public E get()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © AnyLogic North America, LLC. All Rights Reserved.