Table of Contents

Class MultiThreadRandom

Namespace
Balsam.Utility
Assembly
Balsam.Backtester.dll

A thread safe random number generator.

public class MultiThreadRandom : Random
Inheritance
MultiThreadRandom
Inherited Members
Extension Methods

Constructors

MultiThreadRandom()

Instantiates new thread safe random number generator.

public MultiThreadRandom()

MultiThreadRandom(int)

Instantiates a new tread safe random number generator using the specified seed.

public MultiThreadRandom(int seed)

Parameters

seed int

Methods

Next()

Returns the next random integer.

public override int Next()

Returns

int

Next(int)

Returns a nonnegative random number less than the specified maximum.

public override int Next(int maxValue)

Parameters

maxValue int

Returns

int

Next(int, int)

Returns a random number within the specified range.

public override int Next(int minValue, int maxValue)

Parameters

minValue int
maxValue int

Returns

int

NextBytes(byte[])

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

public override void NextBytes(byte[] buffer)

Parameters

buffer byte[]

NextDouble()

Returns a random number between 0.0 and 1.0.

public override double NextDouble()

Returns

double

NextDouble(double, double)

Returns a random number withint the specified range.

public double NextDouble(double minValue, double maxValue)

Parameters

minValue double
maxValue double

Returns

double