Class FastGaussianDistributionD
Inherited Members
Namespace: Mars.Numerics.Statistics
Assembly: Mars.Numerics.dll
Syntax
public class FastGaussianDistributionD : Distribution<double>
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 SourceFastGaussianDistributionD()
Declaration
public FastGaussianDistributionD()
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.
FastGaussianDistributionD(Double, Double)
Declaration
public FastGaussianDistributionD(double expectedValue, double standardDeviation)
Parameters
Type | Name | Description |
---|---|---|
System.Double | expectedValue | The expected value. |
System.Double | 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 double ExpectedValue { get; set; }
Property Value
Type | Description |
---|---|
System.Double | 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 double StandardDeviation { get; set; }
Property Value
Type | Description |
---|---|
System.Double | 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, Double, Double)
Declaration
public double Next(FastRandom random, double expectedValue, double standardDeviation)
Parameters
Type | Name | Description |
---|---|---|
Mars.Common.Core.Random.FastRandom | random | |
System.Double | expectedValue | |
System.Double | standardDeviation |
Returns
Type | Description |
---|---|
System.Double |
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.
Next(FastRandom)
Declaration
public override double Next(FastRandom random)
Parameters
Type | Name | Description |
---|---|---|
Mars.Common.Core.Random.FastRandom | random |
Returns
Type | Description |
---|---|
System.Double |
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.