C# 클래스 RandomOps.RanSystem

Wrapper for the .NET built-in PRNG. Not thread-safe by default.
Since the .NET implementation may change we cannot override and make a more efficient implementation of Byte() that would use bit-manipulation, because it would assume things about the implementation that might change.
상속: 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.

Index ( int n ) : int

Draw a random index from the range {0, .., n-1}

RanSystem ( )

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

RanSystem ( int seed )

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.

Uniform ( ) : double

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

메소드 상세

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[]

Index() 공개 최종 메소드

Draw a random index from the range {0, .., n-1}
public final Index ( int n ) : int
n int The exclusive upper bound.
리턴 int

RanSystem() 공개 메소드

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

RanSystem() 공개 메소드

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 RanSystem ( int seed )
seed int

Uniform() 공개 최종 메소드

Draw a uniform random number in the exclusive range (0,1)
public final Uniform ( ) : double
리턴 double