C# Class CasualGodComplex.RandomExtensions

Afficher le fichier Open project: martindevans/CasualGodComplex

Méthodes publiques

Méthode 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 méthode

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
Résultat float

NormallyDistributedSingle() public static méthode

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)
Résultat float

NormallyDistributedSingles() public static méthode

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
Résultat IEnumerable

NormallyDistributedSingles() public static méthode

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)
Résultat IEnumerable