Class FastGaussianDistributionF
Inherited Members
Namespace: Mars.Numerics.Statistics
Assembly: Mars.Numerics.dll
Syntax
public class FastGaussianDistributionF : Distribution<float>
Remarks
Gaussian distribution is also known as Normal distribution.
The random values generated by this class follow only an approximate Gaussian distribution. The distribution curve can be imagined as a typical Gaussian bell curve within +/- 3 standard deviations. All random values lie in the interval [ExpectedValue - 3 * StandardDeviation, ExpectedValue + 3 * StandardDeviation]. No random values outside the +/- 3 standard deviation interval are returned.
This approximation is faster and makes the random values more controllable for game applications. For example, if in a game tree heights are determined using a real Gaussian distribution with an expected value of 10m and a standard deviation of 1m, then most trees will have a height near 10m. But it would also be possible - unlikely but possible - that a tree with height 30m is generated. This would look very odd. Therefore, it is desirable that the created random values do not exceed 3 standard deviations.
Constructors
| Improve this Doc View SourceFastGaussianDistributionF()
Declaration
public FastGaussianDistributionF()
Remarks
Gaussian distribution is also known as Normal distribution.
The random values generated by this class follow only an approximate Gaussian distribution. The distribution curve can be imagined as a typical Gaussian bell curve within +/- 3 standard deviations. All random values lie in the interval [ExpectedValue - 3 * StandardDeviation, ExpectedValue + 3 * StandardDeviation]. No random values outside the +/- 3 standard deviation interval are returned.
This approximation is faster and makes the random values more controllable for game applications. For example, if in a game tree heights are determined using a real Gaussian distribution with an expected value of 10m and a standard deviation of 1m, then most trees will have a height near 10m. But it would also be possible - unlikely but possible - that a tree with height 30m is generated. This would look very odd. Therefore, it is desirable that the created random values do not exceed 3 standard deviations.
FastGaussianDistributionF(Single, Single)
Declaration
public FastGaussianDistributionF(float expectedValue, float standardDeviation)
Parameters
Type | Name | Description |
---|---|---|
System.Single | expectedValue | The expected value. |
System.Single | standardDeviation | The standard deviation. |
Remarks
Gaussian distribution is also known as Normal distribution.
The random values generated by this class follow only an approximate Gaussian distribution. The distribution curve can be imagined as a typical Gaussian bell curve within +/- 3 standard deviations. All random values lie in the interval [ExpectedValue - 3 * StandardDeviation, ExpectedValue + 3 * StandardDeviation]. No random values outside the +/- 3 standard deviation interval are returned.
This approximation is faster and makes the random values more controllable for game applications. For example, if in a game tree heights are determined using a real Gaussian distribution with an expected value of 10m and a standard deviation of 1m, then most trees will have a height near 10m. But it would also be possible - unlikely but possible - that a tree with height 30m is generated. This would look very odd. Therefore, it is desirable that the created random values do not exceed 3 standard deviations.
Properties
| Improve this Doc View SourceExpectedValue
Declaration
public float ExpectedValue { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The expected value. The default is 0. |
Remarks
Gaussian distribution is also known as Normal distribution.
The random values generated by this class follow only an approximate Gaussian distribution. The distribution curve can be imagined as a typical Gaussian bell curve within +/- 3 standard deviations. All random values lie in the interval [ExpectedValue - 3 * StandardDeviation, ExpectedValue + 3 * StandardDeviation]. No random values outside the +/- 3 standard deviation interval are returned.
This approximation is faster and makes the random values more controllable for game applications. For example, if in a game tree heights are determined using a real Gaussian distribution with an expected value of 10m and a standard deviation of 1m, then most trees will have a height near 10m. But it would also be possible - unlikely but possible - that a tree with height 30m is generated. This would look very odd. Therefore, it is desirable that the created random values do not exceed 3 standard deviations.
StandardDeviation
Declaration
public float StandardDeviation { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The standard deviation. The default is 1. |
Remarks
Gaussian distribution is also known as Normal distribution.
The random values generated by this class follow only an approximate Gaussian distribution. The distribution curve can be imagined as a typical Gaussian bell curve within +/- 3 standard deviations. All random values lie in the interval [ExpectedValue - 3 * StandardDeviation, ExpectedValue + 3 * StandardDeviation]. No random values outside the +/- 3 standard deviation interval are returned.
This approximation is faster and makes the random values more controllable for game applications. For example, if in a game tree heights are determined using a real Gaussian distribution with an expected value of 10m and a standard deviation of 1m, then most trees will have a height near 10m. But it would also be possible - unlikely but possible - that a tree with height 30m is generated. This would look very odd. Therefore, it is desirable that the created random values do not exceed 3 standard deviations.
Methods
| Improve this Doc View SourceNext(FastRandom)
Declaration
public override float Next(FastRandom random)
Parameters
Type | Name | Description |
---|---|---|
Mars.Common.Core.Random.FastRandom | random |
Returns
Type | Description |
---|---|
System.Single |
Overrides
Remarks
Gaussian distribution is also known as Normal distribution.
The random values generated by this class follow only an approximate Gaussian distribution. The distribution curve can be imagined as a typical Gaussian bell curve within +/- 3 standard deviations. All random values lie in the interval [ExpectedValue - 3 * StandardDeviation, ExpectedValue + 3 * StandardDeviation]. No random values outside the +/- 3 standard deviation interval are returned.
This approximation is faster and makes the random values more controllable for game applications. For example, if in a game tree heights are determined using a real Gaussian distribution with an expected value of 10m and a standard deviation of 1m, then most trees will have a height near 10m. But it would also be possible - unlikely but possible - that a tree with height 30m is generated. This would look very odd. Therefore, it is desirable that the created random values do not exceed 3 standard deviations.