Class

TaxiEnv

TaxiEnv()

The Taxi Problem Environment

Constructor

# new TaxiEnv()

View Source core/src/Envs/TaxiEnv.ts, line 9

Extends

Members

# game

Return the taxi problem game

View Source core/src/Envs/TaxiEnv.ts, line 55

Taction | undefined

# lastAction

get the last action

Overrides:

View Source core/src/RLInterface/SingleAgentEnvironment.ts, line 36

TaxiStats

# stats

Return the environment stats

Overrides:

View Source core/src/Envs/TaxiEnv.ts, line 38

Methods

# abstract actionSpace() → {Array}

The action space

Overrides:

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

Array

# additionalInfo(EnvStateContext) → {EnvStateContext}

Get additional info about the environment state

Parameters:
Name Type Description
EnvStateContext number

EnvStateContext maxIterPerGame

Overrides:

View Source core/src/RLInterface/SingleAgentEnvironment.ts, line 110

# abstract encodeStateToIndices(state) → {Array.<number>}

encode the state into an number array

Parameters:
Name Type Description
state object

the state to encode

Overrides:

View Source core/src/RLInterface/Environment.ts, line 123

an numbers array

Array.<number>

# game() → {TaxiGame}

Return the taxi problem game

View Source core/src/Envs/TaxiEnv.ts, line 148

The game object

TaxiGame

# abstract getReturn() → {number}

The total Return of the agent.

Overrides:

View Source core/src/RLInterface/SingleAgentEnvironment.ts, line 240

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

Overrides:

View Source core/src/Envs/TaxiEnv.ts, line 133

void

# initAgent() → {void}

This method can be used to initialize the environment and for example initialize the agents

Overrides:

View Source core/src/RLInterface/SingleAgentEnvironment.ts, line 43

test

void

# abstract isTerminal() → {boolean}

Whether the enviroment state is terminal

Overrides:

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

boolean

# abstract iteration() → {number}

The current iteration

Overrides:

View Source core/src/RLInterface/Environment.ts, line 67

number

# 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

Overrides:

View Source core/src/RLInterface/SingleAgentEnvironment.ts, line 102

void

# abstract name() → {string}

The enviromnet name

Overrides:

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

string

# onIterationEnd() → {void}

Function called after the training Iteration and before the logging. This function can be used for example for logging specifig cleanups/ calculations

Overrides:

View Source core/src/RLInterface/SingleAgentEnvironment.ts, line 123

void

# abstract options() → {EnvOptions|undefined}

The current options

Inherited From:

View Source core/src/RLInterface/Environment.ts, line 59

EnvOptions | undefined

# abstract reset() → {boolean}

The reset the environment

Overrides:

View Source core/src/RLInterface/Environment.ts, line 107

boolean

# abstract resetStats() → {boolean}

reset the stats accumulated over the life time of the environment

Overrides:

View Source core/src/RLInterface/Environment.ts, line 130

True if the reset was sucessfull

boolean

# abstract setOptions(optionsnullable) → {void}

Set the environment options

Parameters:
Name Type Attributes Description
options EnvOptions <nullable>
Overrides:

View Source core/src/RLInterface/Environment.ts, line 115

void

# async singleTrainStep(maxIterationPerGame) → {Promise.<void>}

A single trainign step

Parameters:
Name Type Description
maxIterationPerGame number

The max iterations per game

Overrides:

View Source core/src/RLInterface/SingleAgentEnvironment.ts, line 131

Promise.<void>

# state() → {TaxiGameState}

Get the game state

Overrides:

View Source core/src/Envs/TaxiEnv.ts, line 156

# abstract stateDim() → {Array}

The state dimension

Overrides:

View Source core/src/RLInterface/Environment.ts, line 27

Array

# stats() → {TaxiStats}

Return the environment stats

Overrides:

View Source core/src/Envs/TaxiEnv.ts, line 141

TaxiStats

# abstract step(action) → {StepResult}

take an action in the environment

Parameters:
Name Type Description
action string

the action to take

Overrides:

View Source core/src/RLInterface/Environment.ts, line 100

the result of the taken action

StepResult

# 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

Overrides:

View Source core/src/RLInterface/SingleAgentEnvironment.ts, line 67

Promise.<number>