Wiki
Clone wikiRogueSharp / RogueSharp.Random / GaussianRandom / README
GaussianRandom Class
A class implementing IRandom which uses the Box-Muller transformation to help generate Gaussian pseudo-random numbers
Inheritance Hierarchy
SystemObject
RogueSharp.RandomGaussianRandom
Namespace: RogueSharp.Random
Assembly:
Syntax
public class GaussianRandom : IRandom
The GaussianRandom type exposes the following members.
Constructors
Name | Description |
---|---|
GaussianRandom | Constructs a new Gaussian pseudo-random number generator with a seed based on the number of milliseconds elapsed since the system started |
GaussianRandom(Int32) | Constructs a new Gaussian pseudo-random number generator with the specified seed |
Methods
Name | Description |
---|---|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
Next(Int32) | Will approximately give the next Gaussian pseudo-random integer between 0 and that specified max value inclusively so that min and max are at 3.5 deviations from the mean (half-way of min and max). |
Next(Int32, Int32) | Will approximately give the next random Gaussian integer between the specified min and max values inclusively so that min and max are at 3.5 deviations from the mean (half-way of min and max). |
Restore | Restores the state of the pseudo-random number generator based on the specified state parameter |
Save | Saves the current state of the pseudo-random number generator |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Remarks
Gaussian pseudo-random generation can be useful if you want a bell shaped curve distribution of numbers. What this means is numbers half way between the min and max values are much more likely than numbers on the extreme edge. If you were to generate numbers between 1 and 10, it would be more likely a 5 would be generated than a 1 or a 10.
See Also
Reference
[8]: 2014-2016 Faron Bracy
Updated