Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yoogottamk
Flatland
Commits
ebe00ddc
"README.md" did not exist on "42fa09f0fc8674f4a9ae03a51c6933b412d10bc5"
Commit
ebe00ddc
authored
5 years ago
by
spmohanty
Browse files
Options
Downloads
Patches
Plain Diff
Changes to the documentation
parent
61e22e63
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/gettingstarted.rst
+22
-12
22 additions, 12 deletions
docs/gettingstarted.rst
with
22 additions
and
12 deletions
docs/gettingstarted.rst
+
22
−
12
View file @
ebe00ddc
...
@@ -106,11 +106,16 @@ following code. Also, tree observation data is displayed by RenderTool by defaul
...
@@ -106,11 +106,16 @@ following code. Also, tree observation data is displayed by RenderTool by defaul
.. code-block:: python
.. code-block:: python
for i in range(env.get_num_agents()):
for i in range(env.get_num_agents()):
env.obs_builder.util_print_obs_subtree(tree=obs[i], num_features_per_node=5)
env.obs_builder.util_print_obs_subtree(
tree=obs[i],
num_features_per_node=5
)
The complete code for this part of the Getting Started guide can be found in
The complete code for this part of the Getting Started guide can be found in
examples/simple_example_1.py, examples/simple_example_2.py and
examples/simple_example_3.py
* `examples/simple_example_1.py <https://gitlab.aicrowd.com/flatland/flatland/blob/master/examples/simple_example_1.py>`_
* `examples/simple_example_2.py <https://gitlab.aicrowd.com/flatland/flatland/blob/master/examples/simple_example_2.py>`_
* `examples/simple_example_3.py <https://gitlab.aicrowd.com/flatland/flatland/blob/master/examples/simple_example_3.py>`_
...
@@ -119,7 +124,7 @@ Part 2 : Training a Simple an Agent on Flatland
...
@@ -119,7 +124,7 @@ Part 2 : Training a Simple an Agent on Flatland
This is a brief tutorial on how to train an agent on Flatland.
This is a brief tutorial on how to train an agent on Flatland.
Here we use a simple random agent to illustrate the process on how to interact with the environment.
Here we use a simple random agent to illustrate the process on how to interact with the environment.
The corresponding code can be found in examples/training_example.py and in the baselines repository
The corresponding code can be found in examples/training_example.py and in the baselines repository
you find a tutorial to train a DQN agent to solve the navigation task.
you find a tutorial to train a
`
DQN
<https://arxiv.org/abs/1312.5602>`_
agent to solve the navigation task.
We start by importing the necessary Flatland libraries
We start by importing the necessary Flatland libraries
...
@@ -133,12 +138,17 @@ Next we configure the difficulty of our task by modifying the complex_rail_gener
...
@@ -133,12 +138,17 @@ Next we configure the difficulty of our task by modifying the complex_rail_gener
.. code-block:: python
.. code-block:: python
env = RailEnv(width=15,
env = RailEnv( width=15,
height=15,
height=15,
rail_generator=complex_rail_generator(nr_start_goal=10, nr_extra=10, min_dist=10, max_dist=99999, seed=0),
rail_generator=complex_rail_generator(
number_of_agents=5)
nr_start_goal=10,
nr_extra=10,
min_dist=10,
max_dist=99999,
seed=0),
number_of_agents=5)
The difficulty of a railway network depends on the dimensions (width x height) and the number of agents in the network.
The difficulty of a railway network depends on the dimensions (
`
width
`
x
`
height
`
) and the number of agents in the network.
By varying the number of start and goal connections (nr_start_goal) and the number of extra railway elements added (nr_extra)
By varying the number of start and goal connections (nr_start_goal) and the number of extra railway elements added (nr_extra)
the number of alternative paths of each agents can be modified. The more possible paths an agent has to reach its target the easier the task becomes.
the number of alternative paths of each agents can be modified. The more possible paths an agent has to reach its target the easier the task becomes.
Here we don't specify any observation builder but rather use the standard tree observation. If you would like to use a custom obervation please follow
Here we don't specify any observation builder but rather use the standard tree observation. If you would like to use a custom obervation please follow
...
@@ -214,10 +224,10 @@ A RailEnv environment can then be created as usual:
...
@@ -214,10 +224,10 @@ A RailEnv environment can then be created as usual:
obs_builder_object=CustomObs())
obs_builder_object=CustomObs())
As for generating custom rail maps, the RailEnv class accepts a rail_generator
As for generating custom rail maps, the RailEnv class accepts a rail_generator
argument that must be a function with arguments
'
width
'
,
'
height
'
,
'
num_agents
'
,
argument that must be a function with arguments
`
width
`
,
`
height
`
,
`
num_agents
`
,
and
'
num_resets=0
'
, and that has to return a GridTransitionMap object (the rail map),
and
`
num_resets=0
`
, and that has to return a GridTransitionMap object (the rail map),
and three lists of tuples containing the (row,column) coordinates of each of
and three lists of tuples containing the (row,column) coordinates of each of
num_agent agents, their initial orientation (0=North, 1=East, 2=South, 3=West),
num_agent agents, their initial orientation
**
(0=North, 1=East, 2=South, 3=West)
**
,
and the position of their targets.
and the position of their targets.
For example, the following custom rail map generator returns an empty map of
For example, the following custom rail map generator returns an empty map of
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment