Skip to content
Snippets Groups Projects
Commit 10b49a64 authored by Erik Nygren's avatar Erik Nygren
Browse files

added initial file for observations and actions

parent 8b8f8e77
No related branches found
No related tags found
No related merge requests found
=============================
Observation and Action Spaces
=============================
This is an introduction to the three standard observations and the action space of **Flatland**.
Action Space
============
Flatland is a railway simulation. Thus the actions of an agent are strongly limited to the railway network. This means that in many cases not all actions are valid.
The possible actions of an agent are
- 0 **Do Nothing**: If the agent is moving it continues moving, if it is stopped it stays stopped
- 1 **Deviate Left**: If the agent is at a switch with a transition to its left, the agent will chose th eleft path. Otherwise the action has no effect. If the agent is stopped, this action will start agent movement again if allowed by the transitions.
- 2 **Go Forward**: This action will start the agent when stopped. This will move the agent forward and chose the go straight direction at switches.
- 3 **Deviate Right**: Exactly the same as deviate left but for right turns.
- 4 **Stop**: This action causes the agent to stop.
Observation Spaces
==================
In the **Flatland** environment we have included three basic observations to get started. The figure below illustrates the observation range of the different basic observation: Global, Local Grid and Local Tree.
.. image:: WGfFtP7.png
:target: https://i.imgur.com/
Global Observation
------------------
Local Grid Observation
----------------------
Tree Observation
----------------
......@@ -17,11 +17,13 @@ def custom_rail_generator():
grid_map = GridTransitionMap(width=width, height=height, transitions=rail_trans)
rail_array = grid_map.grid
rail_array.fill(0)
new_tran = rail_trans.set_transition(1,1,1,1)
print(new_tran)
agents_positions = []
agents_direction = []
agents_target = []
rail_array[0, 0] = new_tran
rail_array[0, 1] = new_tran
return grid_map, agents_positions, agents_direction, agents_target
return generator
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment