C# Class Redzen.Numerics.DiscreteDistribution

Represents a distribution over a discrete set of possible states. Total probability over all states must add up to 1.0 This class was previously called RouletteWheelLayout.
显示文件 Open project: colgreen/Redzen Class Usage Examples

Public Methods

Method Description
DiscreteDistribution ( DiscreteDistribution copyFrom ) : System

Copy constructor.

DiscreteDistribution ( double probArr ) : System

Construct the layout with provided probabilities. The provided probabilites do not have to add up to 1.0 as we implicitly normalise them when using the layout.

DiscreteDistribution ( double probArr, int labelArr ) : System

Construct the layout with provided probabilities. The provided probabilites do not have to add up to 1.0 as we implicitly normalise them when using the layout.

RemoveOutcome ( int labelId ) : DiscreteDistribution

Remove the specified outcome from the set of probabilities and return as a new DiscreteDistribution object.

Private Methods

Method Description
NormaliseProbabilities ( double probs ) : void

Method Details

DiscreteDistribution() public method

Copy constructor.
public DiscreteDistribution ( DiscreteDistribution copyFrom ) : System
copyFrom DiscreteDistribution
return System

DiscreteDistribution() public method

Construct the layout with provided probabilities. The provided probabilites do not have to add up to 1.0 as we implicitly normalise them when using the layout.
public DiscreteDistribution ( double probArr ) : System
probArr double
return System

DiscreteDistribution() public method

Construct the layout with provided probabilities. The provided probabilites do not have to add up to 1.0 as we implicitly normalise them when using the layout.
public DiscreteDistribution ( double probArr, int labelArr ) : System
probArr double
labelArr int
return System

RemoveOutcome() public method

Remove the specified outcome from the set of probabilities and return as a new DiscreteDistribution object.
public RemoveOutcome ( int labelId ) : DiscreteDistribution
labelId int
return DiscreteDistribution