Class NegativeExponentialRandom
Represents a pseudo-random number generator whose outputs, when aggregated, approximate a negative exponential distribution.
Inherited Members
Namespace: System
Assembly: Rebus.Server.dll
Syntax
public class NegativeExponentialRandom : Random
Remarks
The implementation of this class was inspired by and based on this Stack Overflow question asked by @maxammann and answered by @pjs.
Constructors
NegativeExponentialRandom(Double)
Initializes a new instance of the NegativeExponentialRandom class.
Declaration
public NegativeExponentialRandom(double lambda)
Parameters
Type | Name | Description |
---|---|---|
Double | lambda | The rate parameter λ. |
NegativeExponentialRandom(Int32, Double)
Declaration
public NegativeExponentialRandom(int seed, double lambda)
Parameters
Type | Name | Description |
---|---|---|
Int32 | seed | A number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used. |
Double | lambda | The rate parameter λ. |
Methods
Next(Int32, Int32)
Declaration
public override int Next(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minValue | |
Int32 | maxValue |
Returns
Type | Description |
---|---|
Int32 |
Overrides
NextDouble()
Declaration
public override double NextDouble()
Returns
Type | Description |
---|---|
Double |
Overrides
Sample()
Declaration
protected override double Sample()
Returns
Type | Description |
---|---|
Double |