Class

TaxiGame

TaxiGame(randomSeednullable)

The Taxi Game class

Constructor

# new TaxiGame(randomSeednullable)

Parameters:
Name Type Attributes Description
randomSeed number <nullable>

the random seed

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 14

Members

Map.<TaxiActionKey, TaxiAction>

# readonly actionMapping

Mapping of actions

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 21

TaxiGameState

# gameState

Get the games current state

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 83

boolean

# isTerminal

Get whether the game has reached a terminal state

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 101

number

# iteration

Get the iteration

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 266

number

# return

Get the games current return

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 94

seedrandom.PRNG

# rng

Get the random number generator

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 273

number

# setRng

Set the games random seed

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 54

Map.<TaxiActionKey, TaxiAction>

# static readonly actionMapping

Mapping of actions

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 297

Array.<number>

# static gameStateDim

Set the games state dimension

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 62

Array.<string>

# static getActionSpace

Get The action space

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 39

Methods

# continue() → {void}

Continue the current game

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 368

void

# customer() → {TaxiCustomer}

Get the customer

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 329

TaxiCustomer

# gameState() → {TaxiGameState}

Get the games current state

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 345

# incrementIterations() → {void}

Increment the game iteration

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 437

void

# initGame() → {void}

Initialize the game objects

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 375

void

# isTerminal() → {boolean}

Get whether the game has reached a terminal state

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 361

boolean

# iteration() → {number}

Get the iteration

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 445

number

# player() → {TaxiPlayer}

get the player

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 337

TaxiPlayer

# reset(resetGameStateopt, initialGameStatenullable) → {boolean}

Reset the game

Parameters:
Name Type Attributes Default Description
resetGameState boolean <optional>
true

Whether to reset the games state

initialGameState TaxiGameState <nullable>

The initial game state

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 406

Whether the reset was successful

boolean

# return() → {number}

Get the games current return

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 353

number

# rng() → {seedrandom.PRNG}

Get the random number generator

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 453

seedrandom.PRNG

# setRng(randomSeed)

Set the games random seed

Parameters:
Name Type Description
randomSeed number

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 313

# spawnGameElements() → {void}

Spawn the player and customer object

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 397

void

# step(actionString) → {StepResult}

Perform a single game step

Parameters:
Name Type Description
actionString TaxiActionKey

The action to perform.

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 414

The result of the step

StepResult

# terminateGame() → {void}

Terminate the game

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 390

void

# updatePlayerPosition(action) → {StepResult}

Update the player position with the taken action

Parameters:
Name Type Description
action TaxiAction

the taken action

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 430

The result of the steps

StepResult

# updatePoints(points) → {void}

Update the number of points

Parameters:
Name Type Description
points number

The points to add / subtract

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 383

void

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

encode the game state to an encoded numbers array

Parameters:
Name Type Description
state TaxiGameState

the state to encode

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 422

The encoded array

Array.<number>

# static gameStateDim() → {Array}

Set the games state dimension

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 321

Array

# static getActionSpace() → {Array}

Get The action space

View Source core/src/Games/TaxiGame/TaxiGame.ts, line 305

Array