static class for general utility
Methods
# static linearDecayEpsilon(stepCount, decaySteps, epsilonStart, epsilonEnd) → {number}
linearly decay the epsilon value
Parameters:
Name | Type | Description |
---|---|---|
stepCount |
number
|
the current step |
decaySteps |
number
|
number of total decay steps |
epsilonStart |
number
|
epsilon start value |
epsilonEnd |
number
|
epsilon end value |
the epsilon value and the new step count
number
# static sampleN(array, n, rng)
samples n values from the provided array
Parameters:
Name | Type | Description |
---|---|---|
array |
Array.<any>
|
the array to sample from |
n |
number
|
the number of values to sample |
rng |
seedrandom.PRNG
|
the random number generator |
the samples
# static shuffleArray(array, rng) → {Array.<any>}
Shuffle the array
Parameters:
Name | Type | Description |
---|---|---|
array |
Array.<any>
|
the array to shuffle |
rng |
seedrandom.PRNG
|
the random number generator |
the shuffled array
Array.<any>