# abstract new SingleAgentEnvironment()
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 |
- Inherited From:
an numbers array
Array.<number>
# abstract init(optionsnullable, initialStatenullable) → {void}
initialize the environment
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
EnvOptions
|
<nullable> |
the environment options |
initialState |
object
|
<nullable> |
the optional initial state of the environment |
void
# initAgent() → {void}
This method can be used to initialize the environment and for example initialize the agents
test
void
# abstract isTerminal() → {boolean}
Whether the enviroment state is terminal
- Inherited From:
boolean
# 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 resetStats() → {boolean}
reset the stats accumulated over the life time of the environment
- Inherited From:
True if the reset was sucessfull
boolean
# abstract setOptions(optionsnullable) → {void}
Set the environment options
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
EnvOptions
|
<nullable> |
void
# async singleTrainStep(maxIterationPerGame) → {Promise.<void>}
A single trainign step
Parameters:
Name | Type | Description |
---|---|---|
maxIterationPerGame |
number
|
The max iterations per game |
Promise.<void>
# abstract step(action) → {StepResult}
take an action in the environment
Parameters:
Name | Type | Description |
---|---|---|
action |
string
|
the action to take |
- Inherited From:
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>