Skip to Content
API Reference@ignitionai/environmentsSrcClassesClass: GridWorldEnv

ignition-monorepo


ignition-monorepo / environments/src / GridWorldEnv

Class: GridWorldEnv

Defined in: environments/src/gridworld.ts:3 

Implements

  • TrainingEnv

Constructors

Constructor

new GridWorldEnv(gridSize?): GridWorldEnv

Defined in: environments/src/gridworld.ts:15 

Parameters

gridSize?

number = 7

Returns

GridWorldEnv

Properties

actions

actions: string[]

Defined in: environments/src/gridworld.ts:4 

Available actions: named list or count

Implementation of

TrainingEnv.actions


agentRow

agentRow: number = 0

Defined in: environments/src/gridworld.ts:5 


agentCol

agentCol: number = 0

Defined in: environments/src/gridworld.ts:6 


targetRow

readonly targetRow: number

Defined in: environments/src/gridworld.ts:7 


targetCol

readonly targetCol: number

Defined in: environments/src/gridworld.ts:8 


gridSize

readonly gridSize: number

Defined in: environments/src/gridworld.ts:9 


stepCount

stepCount: number = 0

Defined in: environments/src/gridworld.ts:10 


trail

trail: [number, number][] = []

Defined in: environments/src/gridworld.ts:11 

Methods

observe()

observe(): number[]

Defined in: environments/src/gridworld.ts:21 

Return the current observation as a number array

Returns

number[]

Implementation of

TrainingEnv.observe


step()

step(action): void

Defined in: environments/src/gridworld.ts:31 

Apply an action to the environment

Parameters

action

number | number[]

Returns

void

Implementation of

TrainingEnv.step


reward()

reward(): number

Defined in: environments/src/gridworld.ts:43 

Return the reward for the current state

Returns

number

Implementation of

TrainingEnv.reward


done()

done(): boolean

Defined in: environments/src/gridworld.ts:48 

Return true if the episode is over

Returns

boolean

Implementation of

TrainingEnv.done


reset()

reset(): void

Defined in: environments/src/gridworld.ts:53 

Reset the environment for a new episode

Returns

void

Implementation of

TrainingEnv.reset

Last updated on