Class DistributionHelpers
Defines functions that assist in dealing with RNG distributions.
Inheritance
Inherited Members
Namespace: GoRogue.Random
Assembly: GoRogue.dll
Syntax
public static class DistributionHelpers
Methods
| Improve this Doc View SourceCreateNormalDistribution(Double, Double, Double)
Creates a normal distribution based on a lower and upper value, and a distance to place
those points from the mean. The mean is placed precisely in between the upper and lower
values given, and the upper and lower values will both be exactly deviationsFromMean
deviations away from the mean.
Declaration
public static NormalDistribution CreateNormalDistribution(double lower = -1, double upper = 1, double deviationsFromMean = 3.5)
Parameters
Type | Name | Description |
---|---|---|
System.Double | lower | Lower value by which to define the distribution. |
System.Double | upper | Upper value by which to define the distribution. |
System.Double | deviationsFromMean | Number of deviations from the mean at which to place the lower and upper values given. |
Returns
Type | Description |
---|---|
Troschuetz.Random.Distributions.Continuous.NormalDistribution | A Troschuetz.Random.Distributions.Continuous.NormalDistribution constructed such that the mean is precisely in between the lower and upper values given, and the lower and upper values are exatly the specified number of deviations away from the mean. |
CreateNormalDistribution(UInt32, Double, Double, Double)
Creates a normal distribution based on a lower and upper value, and a distance to place
those points from the mean. The mean is placed precisely in between the upper and lower
values given, and the upper and lower values will both be exactly deviationsFromMean
deviations away from the mean.
Declaration
public static NormalDistribution CreateNormalDistribution(uint seed, double lower = -1, double upper = 1, double deviationsFromMean = 3.5)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | seed | The seed to pass the default Troschuetz.Random.Generators.XorShift128Generator that is created. |
System.Double | lower | Lower value by which to define the distribution. |
System.Double | upper | Upper value by which to define the distribution. |
System.Double | deviationsFromMean | Number of deviations from the mean at which to place the lower and upper values given. |
Returns
Type | Description |
---|---|
Troschuetz.Random.Distributions.Continuous.NormalDistribution | A Troschuetz.Random.Distributions.Continuous.NormalDistribution constructed such that the mean is precisely in between the lower and upper values given, and the lower and upper values are exatly the specified number of deviations away from the mean. |
CreateNormalDistribution(IGenerator, Double, Double, Double)
Creates a normal distribution based on a lower and upper value, and a distance to place
those points from the mean. The mean is placed precisely in between the upper and lower
values given, and the upper and lower values will both be exactly deviationsFromMean
deviations away from the mean.
Declaration
public static NormalDistribution CreateNormalDistribution(IGenerator generator = null, double lower = -1, double upper = 1, double deviationsFromMean = 3.5)
Parameters
Type | Name | Description |
---|---|---|
Troschuetz.Random.IGenerator | generator | Generator to use. If null is specified, the DefaultRNG will be used. |
System.Double | lower | Lower value by which to define the distribution. |
System.Double | upper | Upper value by which to define the distribution. |
System.Double | deviationsFromMean | Number of deviations from the mean at which to place the lower and upper values given. |
Returns
Type | Description |
---|---|
Troschuetz.Random.Distributions.Continuous.NormalDistribution | A Troschuetz.Random.Distributions.Continuous.NormalDistribution constructed such that the mean is precisely in between the lower and upper values given, and the lower and upper values are exatly the specified number of deviations away from the mean. |