diff --git a/docs/observation_actions.rst b/docs/observation_actions.rst new file mode 100644 index 0000000000000000000000000000000000000000..6e49892a7e8bcc4fa9d7a76156f267aeedfe1b04 --- /dev/null +++ b/docs/observation_actions.rst @@ -0,0 +1,30 @@ +============================= +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 +---------------- diff --git a/examples/custom_railmap_example.py b/examples/custom_railmap_example.py index 9ccef3fdf58aab56f1819a928477118fa8a467a5..6dc157f33ab90d5efa06dc45c914a8de79def7e8 100644 --- a/examples/custom_railmap_example.py +++ b/examples/custom_railmap_example.py @@ -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