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
파일 보기 프로젝트 열기: DanWBR/dwsim3

공개 메소드들

메소드 설명
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