Class

RandomAgent

RandomAgent(env, randomSeednullable)

Agent For selecting Random Actions

Constructor

# new RandomAgent(env, randomSeednullable)

Parameters:
Name Type Attributes Description
env Environment

The environment

randomSeed number <nullable>

The random seed

View Source core/src/Agents/randomAgent/RandomAgent.ts, line 11

Extends

Methods

# abstract config() → {object|undefined}

get the configuration of the agent

Overrides:

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

object | undefined

# 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

# 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 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 setConfig(confignullable, randomSeednullable) → {void}

Set The configuration of the agent after initailizing.

Parameters:
Name Type Attributes Description
config object <nullable>

The config object

randomSeed number <nullable>

The random Seed

Overrides:

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

void

# 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