FastRandom Members

GeneticSharp

FastRandom Members GeneticSharp

The FastRandom type exposes the following members.

Constructors

  NameDescription
Public methodFastRandom 
Initialises a new instance using time dependent seed.
Public methodFastRandom(Int32)
Initialises a new instance using an int value as seed. This constructor signature is provided to maintain compatibility with System.Random
Back to Top
Methods

  NameDescription
Public methodOnlineEquals
Determines whether the specified OnlineObject is equal to the current OnlineObject.
(Inherited from OnlineObject.)
Protected methodOnlineFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from OnlineObject.)
Public methodOnlineGetHashCode
Serves as a hash function for a particular type.
(Inherited from OnlineObject.)
Public methodOnlineGetType
Gets the type of the current instance.
(Inherited from OnlineObject.)
Protected methodOnlineMemberwiseClone
Creates a shallow copy of the current OnlineObject.
(Inherited from OnlineObject.)
Public methodNext 
Generates a random int over the range 0 to int.MaxValue-1. MaxValue is not generated in order to remain functionally equivalent to System.Random.Next(). This does slightly eat into some of the performance gain over System.Random, but not much. For better performance see: Call NextInt() for an int over the range 0 to int.MaxValue. Call NextUInt() and cast the result to an int to generate an int over the full Int32 value range including negative values.
Public methodNext(Int32)
Generates a random int over the range 0 to upperBound-1, and not including upperBound.
Public methodNext(Int32, Int32)
Generates a random int over the range lowerBound to upperBound-1, and not including upperBound. upperBound must be >= lowerBound. lowerBound may be negative.
Public methodNextBool
Generates a single random bit. This method's performance is improved by generating 32 bits in one operation and storing them ready for future calls.
Public methodNextBytes
Fills the provided byte array with random bytes. This method is functionally equivalent to System.Random.NextBytes().
Public methodNextDouble
Generates a random double. Values returned are from 0.0 up to but not including 1.0.
Public methodNextInt
Generates a random int over the range 0 to int.MaxValue, inclusive. This method differs from Next() only in that the range is 0 to int.MaxValue and not 0 to int.MaxValue-1. The slight difference in range means this method is slightly faster than Next() but is not functionally equivalent to System.Random.Next().
Public methodNextUInt
Generates a uint. Values returned are over the full range of a uint, uint.MinValue to uint.MaxValue, inclusive. This is the fastest method for generating a single random number because the underlying random number generator algorithm generates 32 random bits that can be cast directly to a uint.
Public methodReinitialise
Reinitialises using an int value as a seed.
Public methodOnlineToString
Returns a string that represents the current object.
(Inherited from OnlineObject.)
Back to Top
See Also