C# Класс RandomOps.Multi

Abstract class for using multiple RNGs that can be switched between. Example implementation is the Switcher-class which does the RNG-switching randomly. Thread-safe if supplied RNGs are thread-safe, and if SelectRand() is made thread-safe.
If you are using RNGs that have custom methods for generating random numbers then you need to extend this class in a fashion similar to that of the Uniform()-method.
Наследование: Random
Показать файл Открыть проект

Открытые методы

Метод Описание
Bool ( ) : bool

Draw a random boolean with equal probability of drawing true or false.

Byte ( ) : byte

Draw a random and uniform byte.

Bytes ( int length ) : byte[]

Draw an array of random and uniform bytes.

Multi ( Random rands )

Constructs the RNG-object from different RNG's.

Uniform ( ) : double

Draw a uniform random number in the exclusive range (0,1)

Защищенные методы

Метод Описание
SelectRand ( ) : int

Select the RNG to use.

Приватные методы

Метод Описание
Switch ( ) : void

Switch the RNG currently being used. This is to be called before every RNG-method call.

Описание методов

Bool() публичный закрытый Метод

Draw a random boolean with equal probability of drawing true or false.
public final Bool ( ) : bool
Результат bool

Byte() публичный закрытый Метод

Draw a random and uniform byte.
public final Byte ( ) : byte
Результат byte

Bytes() публичный закрытый Метод

Draw an array of random and uniform bytes.
public final Bytes ( int length ) : byte[]
length int The array length requested.
Результат byte[]

Multi() публичный Метод

Constructs the RNG-object from different RNG's.
public Multi ( Random rands )
rands Random The RNGs that will be switched between.

SelectRand() защищенный абстрактный Метод

Select the RNG to use.
protected abstract SelectRand ( ) : int
Результат int

Uniform() публичный закрытый Метод

Draw a uniform random number in the exclusive range (0,1)
public final Uniform ( ) : double
Результат double