GridWorld
Module that implements a simple grid world with obstacles and rewards/reinforcement.
Movements are given either as absolute or relative directions in the MOVE input.
In absolute mode set by move = "max", the maximum direction in the MOVE array sets the
direction of movement. The four components in the array correspond to north (up), east (right),
south (down) and west (left). In absolute mode with summation, set by move = "sum", the movement
is the result of adding all directions in the MOVE input before finding the maximum direction.
In relative mode, set by move = "relative", the array MOVE is interpreted as having
three components: move-ahead, turn-left, turn-right. With mode = "relative_sum", the components
turn-left and turn-right are subtracted before the maximum is found.
No action is performed if MOVE is the zero vector.
The agent is automatically moved to the initial location when a reward location is reached.
Example XML definition
A simple example
<module class = "GridWorld" name = "GridWorld" start_x = "2" start_y = "2" move = "absolute" />
Parameters
Name | Description | Type | Default |
---|---|---|---|
class | The class name for the module; must be "GridWorld". | string | |
name | The name of this instance of the module. | string | |
move | How to use the MOVE input | choices: max sum relative_max relative_sum | max |
start_x | Starting x coordinate for the agent | int | 1 |
start_y | Starting y coordinate for the agent | int | 1 |
normalize_coordinate | Map coordinate output to the interval 0..1 | bool | no |
Module Connections
Inputs
Name | Description |
---|---|
MOVE | Move in absolute directions (N, E, S, W) or relative (Forward, Turn-Left, Turn-Right). |
OBSTACLES | Matrix with obstacles |
VALUES | Matrix with values |
Outputs
Name | Description |
---|---|
LOCATION | Matrix with location of agent |
COORDINATE | Array with location of agent as an x, y value |
LOCAL_OBSTACLES | 3x3 grid around agent |
LOCAL_VALUES | 3x3 grid around agent |
REWARD | The current reward value |
COLLISION | The action makes the agent collide with a wall |
IMAGE | An image of the world with agent. Can be used by a viewer to visualize the world |
Limitations
It should be possible to turn off the automatic movement of the agent from goal to start locations.
Author
Christian Balkenius
christian.balkenius@lucs.lu.se
Lund University Cognitive Science
Files
GridWorld.h
GridWorld.cc
GridWorld.ikc