C# 클래스 RandomOps.Ran2

Pseudo-Random Number Generator (PRNG) based on the Ran2 algorithm from the book: 'Numerical Recipes in C' chapter 7.1 and which is originally due to L'Ecuyer with Bays-Durham shuffle and added safeguards. Period is greater than 2 * 10^18. Not thread-safe.
We MUST use division when generating random integers in a certain range. Do NOT use bit-manipulation because the low-order bits of are not that random! This works by default because Uniform() is used for creating integers through the implementation of the Index() methods in the Random base-class.
상속: RanInt32
파일 보기 프로젝트 열기: DanWBR/dwsim3

공개 메소드들

메소드 설명
Ran2 ( ) : System

Constructs the PRNG-object and seeds the PRNG with the current time of day. This is what you will mostly want to use.

Ran2 ( Int32 seed ) : System

Constructs the PRNG-object using the designated seed. This is useful if you want to repeat experiments with the same sequence of pseudo-random numbers.

Rand ( ) : Int32

Draw a random number in inclusive range {0, .., RandMax}

보호된 메소드들

메소드 설명
Seed ( Int32 seed ) : void

Seed with an integer.

메소드 상세

Ran2() 공개 메소드

Constructs the PRNG-object and seeds the PRNG with the current time of day. This is what you will mostly want to use.
public Ran2 ( ) : System
리턴 System

Ran2() 공개 메소드

Constructs the PRNG-object using the designated seed. This is useful if you want to repeat experiments with the same sequence of pseudo-random numbers.
public Ran2 ( Int32 seed ) : System
seed System.Int32
리턴 System

Rand() 공개 최종 메소드

Draw a random number in inclusive range {0, .., RandMax}
public final Rand ( ) : Int32
리턴 System.Int32

Seed() 보호된 최종 메소드

Seed with an integer.
protected final Seed ( Int32 seed ) : void
seed System.Int32
리턴 void