Extends
Members
Methods
# additionalInfo(EnvStateContext) → {EnvStateContext}
Get additional info about the environment state
Parameters:
Name | Type | Description |
---|---|---|
EnvStateContext |
number
|
EnvStateContext maxIterPerGame |
# abstract encodeStateToIndices(state) → {Array.<number>}
encode the state into an number array
Parameters:
Name | Type | Description |
---|---|---|
state |
object
|
the state to encode |
- Overrides:
an numbers array
Array.<number>
# abstract getReturn() → {number}
The total Return of the agent.
number
# init(optionsnullable, initialStatenullable) → {void}
Initialize the environment
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
EnvOptions
|
<nullable> |
The enviroment options |
initialState |
TaxiGameState
|
<nullable> |
The initial taxi game state |
void
# initAgent() → {void}
This method can be used to initialize the environment and for example initialize the agents
test
void
# log(trainIteration) → {void}
Is called each iteration defined by the logEvery parameter in the training method
Parameters:
Name | Type | Description |
---|---|---|
trainIteration |
The current training iteration |
void
# onIterationEnd() → {void}
Function called after the training Iteration and before the logging. This function can be used for example for logging specifig cleanups/ calculations
void
# abstract options() → {EnvOptions|undefined}
The current options
- Inherited From:
EnvOptions
|
undefined
# abstract resetStats() → {boolean}
reset the stats accumulated over the life time of the environment
- Overrides:
True if the reset was sucessfull
boolean
# abstract setOptions(optionsnullable) → {void}
Set the environment options
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
EnvOptions
|
<nullable> |
- Overrides:
void
# async singleTrainStep(maxIterationPerGame) → {Promise.<void>}
A single trainign step
Parameters:
Name | Type | Description |
---|---|---|
maxIterationPerGame |
number
|
The max iterations per game |
Promise.<void>
# state() → {TaxiGameState}
Get the game state
# abstract step(action) → {StepResult}
take an action in the environment
Parameters:
Name | Type | Description |
---|---|---|
action |
string
|
the action to take |
the result of the taken action
# async train(iterationsopt, logEveryopt, maxIterationPerGameopt, resetStatsOnLogopt) → {Promise.<number>}
The trains the agent, defined for the environment.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
iterations |
number
|
<optional> |
100 | numbers of iterations to iterate. |
logEvery |
number
|
<optional> |
-1 | loging interval relative to training iterations. |
maxIterationPerGame |
number
|
<optional> |
-1 | how many iterations for a game until it automatically terminates. |
resetStatsOnLog |
boolean
|
<optional> |
true | bool to indicate the reseting of stats after logging |
Promise.<number>