Class

MCAgent

MCAgent(env, confignullable, randomSeednullable)

Implementation of First visit Monte Carlo

Constructor

# new MCAgent(env, confignullable, randomSeednullable)

Parameters:
Name Type Attributes Description
env Environment

The environment

config MCAgentSettings <nullable>

The configuration

randomSeed number <nullable>

the random seed

View Source core/src/Agents/MCAgent/MCAgent.ts, line 13

Extends

Members

Array.<Experience>

# experience

Get a shallow copy of experiences

View Source core/src/Agents/MCAgent/MCAgent.ts, line 48

Tensor

# stateReturnCountTable

Get the state retunn count table

View Source core/src/Agents/MCAgent/MCAgent.ts, line 41

Tensor

# valueTable

Get the value table

View Source core/src/Agents/MCAgent/MCAgent.ts, line 34

Methods

# abstract config() → {object|undefined}

get the configuration of the agent

Overrides:

View Source core/src/RLInterface/Agent.ts, line 68

object | undefined

# decayEpsilon() → {void}

Decay the epsilon value

View Source core/src/Agents/MCAgent/MCAgent.ts, line 270

void

# abstract evalStep(state) → {string}

Method to select an action for prediction

Parameters:
Name Type Description
state object

The current game state

Overrides:

View Source core/src/RLInterface/Agent.ts, line 76

  • The action to select next
string

# experience() → {Array}

Get a shallow copy of experiences

View Source core/src/Agents/MCAgent/MCAgent.ts, line 254

Array

# 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.

Overrides:

View Source core/src/RLInterface/Agent.ts, line 51

Promise.<void>

# abstract init() → {void}

initialize the agent

Overrides:

View Source core/src/RLInterface/Agent.ts, line 31

void

# abstract load(fileManager, optionsnullable) → {Promise.<void>}

load the Model

Parameters:
Name Type Attributes Description
fileManager FileStrategy

FileManager Strategy

options object <nullable>

the options zo use for loading

Overrides:

View Source core/src/RLInterface/PersistableAgent.ts, line 26

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

Overrides:

View Source core/src/RLInterface/PersistableAgent.ts, line 35

Promise.<void>

# abstract log() → {void}

Interface method for loggin while training

Overrides:

View Source core/src/RLInterface/Agent.ts, line 83

void

# abstract reset() → {void}

Reset the agent

Overrides:

View Source core/src/RLInterface/Agent.ts, line 90

void

# abstract save(fileManager, optionsnullable) → {Promise.<void>}

Save the model

Parameters:
Name Type Attributes Description
fileManager FileStrategy

FileManager Strategy

options object <nullable>

the options to use for saving the agent

Overrides:

View Source core/src/RLInterface/PersistableAgent.ts, line 44

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

Overrides:

View Source core/src/RLInterface/PersistableAgent.ts, line 53

Promise.<void>

# setConfig(confignullable, randomSeednullable) → {void}

Set The configuration of the agent after initailizing.

Parameters:
Name Type Attributes Description
config MCAgentSettings <nullable>

The configuration

randomSeed randomSeed <nullable>

The random seed

Overrides:

View Source core/src/Agents/MCAgent/MCAgent.ts, line 263

void

# setRandomSeed(randomSeednullable)

Set the random Seed for the agent

Parameters:
Name Type Attributes Description
randomSeed number <nullable>

the random seed

View Source core/src/Agents/MCAgent/MCAgent.ts, line 128

# stateReturnCountTable() → {Tensor}

Get the state retunn count table

View Source core/src/Agents/MCAgent/MCAgent.ts, line 246

Tensor

# abstract step(state) → {string}

Method for selecting a new action for training

Parameters:
Name Type Description
state object

The current game state

Overrides:

View Source core/src/RLInterface/Agent.ts, line 39

  • The action to select next
string

# abstract trainingInitialized() → {boolean}

Get whether the agent was correctly initialized for training.

Overrides:

View Source core/src/RLInterface/Agent.ts, line 24

boolean

# valueTable() → {Tensor}

Get the value table

View Source core/src/Agents/MCAgent/MCAgent.ts, line 238

Tensor