ALFGenerator Type

Represents a Additive Lagged Fibonacci pseudo-random number generator.

The ALFGenerator type bases upon the implementation in the Boost Random Number Library. It uses the modulus 232 and by default the "lags" 418 and 1279, which can be adjusted through the associated ALFGenerator.ShortLag and ALFGenerator.LongLag properties. Some popular pairs are presented on Wikipedia - Lagged Fibonacci generator.

Constructors

Constructor Description

ALFGenerator()

Full Usage: ALFGenerator()

Initializes a new instance of the ALFGenerator class, using a time-dependent default seed value.

ALFGenerator(seed)

Full Usage: ALFGenerator(seed)

Parameters:
    seed : int - 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.

Initializes a new instance of the ALFGenerator class, using the specified seed value.

seed : int

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.

ALFGenerator(seed)

Full Usage: ALFGenerator(seed)

Parameters:
    seed : uint32 - An unsigned number used to calculate a starting value for the pseudo-random number sequence.

Initializes a new instance of the StandardGenerator class, using the specified seed value.

seed : uint32

An unsigned number used to calculate a starting value for the pseudo-random number sequence.

Instance members

Instance member Description

this.CanReset

Full Usage: this.CanReset

Returns: bool
Modifiers: abstract

Gets a value indicating whether the ALFGenerator can be reset, so that it produces the same pseudo-random number sequence again.

Returns: bool

this.IsValidLongLag

Full Usage: this.IsValidLongLag

Parameters:
    value : int - The value to check.

Returns: bool if value is greater than ALFGenerator.ShortLag; otherwise, .

Determines whether the specified value is valid for parameter ALFGenerator.LongLag.

value : int

The value to check.

Returns: bool

if value is greater than ALFGenerator.ShortLag; otherwise, .

this.IsValidShortLag

Full Usage: this.IsValidShortLag

Parameters:
    value : int - The value to check.

Returns: bool if value is greater than 0; otherwise, .

Determines whether the specified value is valid for parameter ALFGenerator.ShortLag.

value : int

The value to check.

Returns: bool

if value is greater than 0; otherwise, .

this.LongLag

Full Usage: this.LongLag

Gets or sets the long lag of the Lagged Fibonacci pseudo-random number generator.

Call ALFGenerator.IsValidLongLag to determine whether a value is valid and therefor assignable.

this.Next

Full Usage: this.Next

Returns: int A 32-bit signed integer greater than or equal to 0, and less than Int32.MaxValue; that is, the range of return values includes 0 but not Int32.MaxValue.
Modifiers: abstract

Returns a nonnegative random number less than Int32.MaxValue.

Returns: int

A 32-bit signed integer greater than or equal to 0, and less than Int32.MaxValue; that is, the range of return values includes 0 but not Int32.MaxValue.

this.Next

Full Usage: this.Next

Parameters:
    maxValue : int - The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to 0.

Returns: int A 32-bit signed integer greater than or equal to 0, and less than maxValue; that is, the range of return values includes 0 but not maxValue.
Modifiers: abstract

Returns a nonnegative random number less than the specified maximum.

maxValue : int

The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to 0.

Returns: int

A 32-bit signed integer greater than or equal to 0, and less than maxValue; that is, the range of return values includes 0 but not maxValue.

ArgumentOutOfRangeException maxValue is less than 0.

this.Next

Full Usage: this.Next

Parameters:
    minValue : int - The inclusive lower bound of the random number to be generated.
    maxValue : int - The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to minValue.

Returns: int A 32-bit signed integer greater than or equal to minValue, and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValue equals maxValue, minValue is returned.
Modifiers: abstract

Returns a random number within the specified range.

minValue : int

The inclusive lower bound of the random number to be generated.

maxValue : int

The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to minValue.

Returns: int

A 32-bit signed integer greater than or equal to minValue, and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValue equals maxValue, minValue is returned.

ArgumentOutOfRangeException minValue is greater than maxValue.

this.NextBoolean

Full Usage: this.NextBoolean

Returns: bool A Boolean value.
Modifiers: abstract

Returns a random Boolean value.

Buffers 32 random bits (1 uint) for future calls, so a new random number is only generated every 32 calls.

Returns: bool

A Boolean value.

this.NextBytes

Full Usage: this.NextBytes

Parameters:
    buffer : byte[] - An array of bytes to contain random numbers.

Modifiers: abstract

Fills the elements of a specified array of bytes with random numbers.

Each element of the array of bytes is set to a random number greater than or equal to 0, and less than or equal to Byte.MaxValue.

buffer : byte[]

An array of bytes to contain random numbers.

ArgumentNullException buffer is a null reference ( in Visual Basic).

this.NextDouble

Full Usage: this.NextDouble

Returns: float A double-precision floating point number greater than or equal to 0.0, and less than 1.0; that is, the range of return values includes 0.0 but not 1.0.
Modifiers: abstract

Returns a nonnegative floating point random number less than 1.0.

Returns: float

A double-precision floating point number greater than or equal to 0.0, and less than 1.0; that is, the range of return values includes 0.0 but not 1.0.

this.NextDouble

Full Usage: this.NextDouble

Parameters:
    maxValue : float - The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to 0.0.

Returns: float A double-precision floating point number greater than or equal to 0.0, and less than maxValue; that is, the range of return values includes 0 but not maxValue.
Modifiers: abstract

Returns a nonnegative floating point random number less than the specified maximum.

maxValue : float

The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to 0.0.

Returns: float

A double-precision floating point number greater than or equal to 0.0, and less than maxValue; that is, the range of return values includes 0 but not maxValue.

ArgumentOutOfRangeException maxValue is less than 0.

this.NextDouble

Full Usage: this.NextDouble

Parameters:
    minValue : float - The inclusive lower bound of the random number to be generated. The range between minValue and maxValue must be less than or equal to Double.MaxValue
    maxValue : float - The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to minValue. The range between minValue and maxValue must be less than or equal to Double.MaxValue.

Returns: float A double-precision floating point number greater than or equal to minValue, and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValue equals maxValue, minValue is returned.
Modifiers: abstract

Returns a floating point random number within the specified range.

minValue : float

The inclusive lower bound of the random number to be generated. The range between minValue and maxValue must be less than or equal to Double.MaxValue

maxValue : float

The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to minValue. The range between minValue and maxValue must be less than or equal to Double.MaxValue.

Returns: float

A double-precision floating point number greater than or equal to minValue, and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValue equals maxValue, minValue is returned.

ArgumentOutOfRangeException minValue is greater than maxValue.
ArgumentException The range between minValue and maxValue must be less than or equal to Double.MaxValue.

this.NextInclusiveMaxValue

Full Usage: this.NextInclusiveMaxValue

Returns: int A 32-bit signed integer greater than or equal to 0, and less than or equal to Int32.MaxValue; that is, the range of return values includes 0 and Int32.MaxValue.

Returns a nonnegative random number less than or equal to Int32.MaxValue.

Returns: int

A 32-bit signed integer greater than or equal to 0, and less than or equal to Int32.MaxValue; that is, the range of return values includes 0 and Int32.MaxValue.

this.NextUInt

Full Usage: this.NextUInt

Returns: uint32 A 32-bit unsigned integer greater than or equal to UInt32.MinValue and less than or equal to UInt32.MaxValue.

Returns an unsigned random number.

Returns: uint32

A 32-bit unsigned integer greater than or equal to UInt32.MinValue and less than or equal to UInt32.MaxValue.

this.Reset

Full Usage: this.Reset

Returns: bool .
Modifiers: abstract

Resets the ALFGenerator, so that it produces the same pseudo-random number sequence again.

Returns: bool

.

this.ShortLag

Full Usage: this.ShortLag

Gets or sets the short lag of the Lagged Fibonacci pseudo-random number generator.

Call ALFGenerator.IsValidShortLag to determine whether a value is valid and therefor assignable.