Class

GridWorldPlayer

GridWorldPlayer(grid, startPosition)

The player.

Constructor

# new GridWorldPlayer(grid, startPosition)

Parameters:
Name Type Description
grid Grid

The reference to the game grid

startPosition Vec2

The starting position of the player

View Source core/src/Games/GridWorld/Player.ts, line 12

Members

GridField

# field

The current field the player consides on

View Source core/src/Games/GridWorld/Player.ts, line 47

Vec2

# pos

The player position.

View Source core/src/Games/GridWorld/Player.ts, line 33

number

# return

The current players return.

View Source core/src/Games/GridWorld/Player.ts, line 40

Methods

# act(action) → {number}

Let player act.

Parameters:
Name Type Description
action GridWorldAction

The action.

View Source core/src/Games/GridWorld/Player.ts, line 109

The reward.

number

# field() → {GridField}

The current field the player consides on

View Source core/src/Games/GridWorld/Player.ts, line 101

GridField

# pos() → {Vec2}

The player position.

View Source core/src/Games/GridWorld/Player.ts, line 85

Vec2

# return() → {number}

The current players return.

View Source core/src/Games/GridWorld/Player.ts, line 93

number