Random
Random number class.
Static Method Summary
| Static Public Methods | ||
| public static |
create(init_data: number | KRandomSettings): * Create Random. |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(init_data: number | KRandomSettings) Create Random. |
|
Member Summary
| Private Members | ||
| private |
have |
|
| private |
Normally distributed random numbers. |
|
| private |
rand: RandomBase Random Number Generator. |
|
Method Summary
| Public Methods | ||
| public |
Random number of specified bit length. |
|
| public |
Random boolean. |
|
| public |
8-bit random number array of specified length. |
|
| public |
nextDouble(): number Double type random number in the range of [0, 1). |
|
| public |
Random numbers from a Gaussian distribution. |
|
| public |
32-bit random number. |
|
| public |
Initialize random seed. |
|
Static Public Methods
public static create(init_data: number | KRandomSettings): * source
Create Random.
- algorithm : "XORSHIFT" / "MLS" / "FAST"
Params:
| Name | Type | Attribute | Description |
| init_data | number | KRandomSettings |
|
Seed number for random number generation. If not specified, create from time. |
Return:
| * |
Public Constructors
public constructor(init_data: number | KRandomSettings) source
Create Random.
- algorithm : "XORSHIFT" / "MLS" / "FAST"
Params:
| Name | Type | Attribute | Description |
| init_data | number | KRandomSettings |
|
Seed number for random number generation. If not specified, create from time. |
Private Members
Public Methods
public next(bits: number): number source
Random number of specified bit length.
Params:
| Name | Type | Attribute | Description |
| bits | number | Required number of bits (up to 64 possible). |
public nextBytes(size: number): Array<number> source
8-bit random number array of specified length.
Params:
| Name | Type | Attribute | Description |
| size | number | 必要な長さ |
public nextGaussian(): number source
Random numbers from a Gaussian distribution. This random number is a distribution with an average value of 0 and a standard deviation of 1.
