# new QLAgent(env, confignullable, randomSeednullable)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
env |
Environment
|
the environment |
|
config |
QLAgentSettings
|
<nullable> |
the configuration |
randomSeed |
number
|
<nullable> |
The randomSeed |
Extends
Members
Methods
# abstract evalStep(state) → {string}
Method to select an action for prediction
Parameters:
Name | Type | Description |
---|---|---|
state |
object
|
The current game state |
- The action to select next
string
# abstract feed(prevState, takenAction, newState, payoff, contextInfo) → {Promise.<void>}
this method feed the new game state and reward back for the agent to update their algorithm
Parameters:
Name | Type | Description |
---|---|---|
prevState |
object
|
The previous game state |
takenAction |
string
|
The action that was taken. |
newState |
object
|
The new game state |
payoff |
number
|
The gained payoff for the agent |
contextInfo |
object
|
Through this object, additional information can be provided. |
Promise.<void>
# async load(fileStrategy, options) → {Promise.<void>}
load q-table from file
Parameters:
Name | Type | Description |
---|---|---|
fileStrategy |
the file strategy for loading |
|
options |
the options for the file strategy |
Promise.<void>
# abstract loadConfig(fileManager, optionsnullable) → {Promise.<void>}
load the config
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
fileManager |
FileStrategy
|
FileManager Strategy |
|
options |
object
|
<nullable> |
the options zo use for loading |
Promise.<void>
# async save(fileStrategy, options) → {Promise.<void>}
Save the q-table to file
Parameters:
Name | Type | Description |
---|---|---|
fileStrategy |
the file strategy for saving |
|
options |
the options for the file strategy |
Promise.<void>
# abstract saveConfig(fileManager, optionsnullable) → {Promise.<void>}
Save the Config
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
fileManager |
FileStrategy
|
FileManager Strategy |
|
options |
object
|
<nullable> |
the options to use for saving the agent |
Promise.<void>
# setConfig(confignullable, randomSeednullable) → {void}
Set the configuration
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
QLAgentSettings
|
<nullable> |
set the configuration |
randomSeed |
number
|
<nullable> |
Set the random seed |
void
# setRandomSeed(randomSeed)
Set the random Seed for the agent
Parameters:
Name | Type | Description |
---|---|---|
randomSeed |
the random seed |
# abstract step(state) → {string}
Method for selecting a new action for training
Parameters:
Name | Type | Description |
---|---|---|
state |
object
|
The current game state |
- The action to select next
string
# abstract trainingInitialized() → {boolean}
Get whether the agent was correctly initialized for training.
boolean