Class RandomSystem
Seed 기반 재현 가능한 전역 랜덤 관리. DI Singleton.
public class RandomSystem
- Inheritance
-
objectRandomSystem
Remarks
로컬 독립 랜덤 시퀀스가 필요하면 SeededRandom(struct, Common) 사용. SetSeed 호출 후 동일 Seed → 동일 결과 시퀀스가 재현된다.
Constructors
RandomSystem()
public RandomSystem()
Methods
Next(int, int)
public int Next(int min, int max)
Parameters
minintmaxint
Returns
- int
NextFloat(float, float)
public float NextFloat(float min = 0, float max = 1)
Parameters
minfloatmaxfloat
Returns
- float
Pick<T>(IList<T>)
public T Pick<T>(IList<T> list)
Parameters
listIList<T>
Returns
- T
Type Parameters
T
SetSeed(int)
Seed 설정. 동일 Seed → 동일 시퀀스 재현.
public void SetSeed(int seed)
Parameters
seedint