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
pranjal_dhole
Flatland
Commits
b13b719b
Commit
b13b719b
authored
3 years ago
by
nilabha
Browse files
Options
Downloads
Patches
Plain Diff
update flatland example as per latest examples
parent
297b65c5
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
examples/introduction_flatland_3.py
+4
-4
4 additions, 4 deletions
examples/introduction_flatland_3.py
with
4 additions
and
4 deletions
examples/introduction_flatland_
2_1
.py
→
examples/introduction_flatland_
3
.py
+
4
−
4
View file @
b13b719b
...
@@ -12,7 +12,7 @@ from flatland.envs.rail_env import RailEnv
...
@@ -12,7 +12,7 @@ from flatland.envs.rail_env import RailEnv
from
flatland.envs.rail_env
import
RailEnvActions
from
flatland.envs.rail_env
import
RailEnvActions
from
flatland.envs.rail_generators
import
sparse_rail_generator
from
flatland.envs.rail_generators
import
sparse_rail_generator
#from flatland.envs.sparse_rail_gen import SparseRailGen
#from flatland.envs.sparse_rail_gen import SparseRailGen
from
flatland.envs.
schedul
e_generators
import
sparse_
schedul
e_generator
from
flatland.envs.
lin
e_generators
import
sparse_
lin
e_generator
# We also include a renderer because we want to visualize what is going on in the environment
# We also include a renderer because we want to visualize what is going on in the environment
from
flatland.utils.rendertools
import
RenderTool
,
AgentRenderVariant
from
flatland.utils.rendertools
import
RenderTool
,
AgentRenderVariant
...
@@ -45,7 +45,7 @@ rail_generator = sparse_rail_generator(max_num_cities=cities_in_map,
...
@@ -45,7 +45,7 @@ rail_generator = sparse_rail_generator(max_num_cities=cities_in_map,
seed
=
seed
,
seed
=
seed
,
grid_mode
=
grid_distribution_of_cities
,
grid_mode
=
grid_distribution_of_cities
,
max_rails_between_cities
=
max_rails_between_cities
,
max_rails_between_cities
=
max_rails_between_cities
,
max_rails_in_city
=
max_rail_in_cities
,
max_rail
_pair
s_in_city
=
max_rail_in_cities
,
)
)
#rail_generator = SparseRailGen(max_num_cities=cities_in_map,
#rail_generator = SparseRailGen(max_num_cities=cities_in_map,
...
@@ -68,7 +68,7 @@ speed_ration_map = {1.: 0.25, # Fast passenger train
...
@@ -68,7 +68,7 @@ speed_ration_map = {1.: 0.25, # Fast passenger train
# We can now initiate the schedule generator with the given speed profiles
# We can now initiate the schedule generator with the given speed profiles
schedul
e_generator
=
sparse_
schedul
e_generator
(
speed_ration_map
)
lin
e_generator
=
sparse_
lin
e_generator
(
speed_ration_map
)
# We can furthermore pass stochastic data to the RailEnv constructor which will allow for stochastic malfunctions
# We can furthermore pass stochastic data to the RailEnv constructor which will allow for stochastic malfunctions
# during an episode.
# during an episode.
...
@@ -87,7 +87,7 @@ observation_builder = GlobalObsForRailEnv()
...
@@ -87,7 +87,7 @@ observation_builder = GlobalObsForRailEnv()
env
=
RailEnv
(
width
=
width
,
env
=
RailEnv
(
width
=
width
,
height
=
height
,
height
=
height
,
rail_generator
=
rail_generator
,
rail_generator
=
rail_generator
,
schedul
e_generator
=
schedul
e_generator
,
lin
e_generator
=
lin
e_generator
,
number_of_agents
=
nr_trains
,
number_of_agents
=
nr_trains
,
obs_builder_object
=
observation_builder
,
obs_builder_object
=
observation_builder
,
#malfunction_generator_and_process_data=malfunction_from_params(stochastic_data),
#malfunction_generator_and_process_data=malfunction_from_params(stochastic_data),
...
...
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