C# Class CasualGodComplex.RandomExtensions

显示文件 Open project: martindevans/CasualGodComplex

Public Methods

Method Description
NormallyDistributedSingle ( this random, float standardDeviation, float mean ) : float

Generates a single value from a normal distribution, using Box-Muller https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform

NormallyDistributedSingle ( this random, float standardDeviation, float mean, float min, float max ) : float

Generates a single normal value clamped within min and max

Originally used inverse phi method, but this method, found here: http://arxiv.org/pdf/0907.4010.pdf is significantly faster

NormallyDistributedSingles ( this random, float standardDeviation, float mean ) : IEnumerable

Generates a sequence of values from a normal distribution, using Box-Muller https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform

NormallyDistributedSingles ( this random, float standardDeviation, float mean, float min, float max ) : IEnumerable

Generates a sequence of normal values clamped within min and max

Originally used inverse phi method, but this method, found here: http://arxiv.org/pdf/0907.4010.pdf is significantly faster

Method Details

NormallyDistributedSingle() public static method

Generates a single value from a normal distribution, using Box-Muller https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform
public static NormallyDistributedSingle ( this random, float standardDeviation, float mean ) : float
random this A (uniform) random number generator
standardDeviation float The standard deviation of the distribution
mean float The mean of the distribution
return float

NormallyDistributedSingle() public static method

Generates a single normal value clamped within min and max
Originally used inverse phi method, but this method, found here: http://arxiv.org/pdf/0907.4010.pdf is significantly faster
public static NormallyDistributedSingle ( this random, float standardDeviation, float mean, float min, float max ) : float
random this A (uniform) random number generator
standardDeviation float The standard deviation of the distribution
mean float The mean of the distribution
min float The minimum allowed value (does not bias)
max float The max allowed value (does not bias)
return float

NormallyDistributedSingles() public static method

Generates a sequence of values from a normal distribution, using Box-Muller https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform
public static NormallyDistributedSingles ( this random, float standardDeviation, float mean ) : IEnumerable
random this A (uniform) random number generator
standardDeviation float The standard deviation of the distribution
mean float The mean of the distribution
return IEnumerable

NormallyDistributedSingles() public static method

Generates a sequence of normal values clamped within min and max
Originally used inverse phi method, but this method, found here: http://arxiv.org/pdf/0907.4010.pdf is significantly faster
public static NormallyDistributedSingles ( this random, float standardDeviation, float mean, float min, float max ) : IEnumerable
random this A (uniform) random number generator
standardDeviation float The standard deviation of the distribution
mean float The mean of the distribution
min float The minimum allowed value (does not bias)
max float The max allowed value (does not bias)
return IEnumerable