Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
manavsinghal157
flatland-rl
Commits
c53baa0b
Commit
c53baa0b
authored
Oct 18, 2019
by
spmohanty
Browse files
Remove unused imports and stray print statements
parent
2c91e486
Changes
1
Hide whitespace changes
Inline
Side-by-side
my_observation_builder.py
View file @
c53baa0b
...
@@ -8,10 +8,7 @@ import numpy as np
...
@@ -8,10 +8,7 @@ import numpy as np
from
flatland.core.env
import
Environment
from
flatland.core.env
import
Environment
from
flatland.core.env_observation_builder
import
ObservationBuilder
from
flatland.core.env_observation_builder
import
ObservationBuilder
from
flatland.core.env_prediction_builder
import
PredictionBuilder
from
flatland.core.env_prediction_builder
import
PredictionBuilder
from
flatland.core.grid.grid4_utils
import
get_new_position
from
flatland.core.grid.grid_utils
import
coordinate_to_position
from
flatland.envs.agent_utils
import
RailAgentStatus
,
EnvAgent
from
flatland.envs.agent_utils
import
RailAgentStatus
,
EnvAgent
from
flatland.utils.ordered_set
import
OrderedSet
class
CustomObservationBuilder
(
ObservationBuilder
):
class
CustomObservationBuilder
(
ObservationBuilder
):
...
@@ -35,7 +32,6 @@ class CustomObservationBuilder(ObservationBuilder):
...
@@ -35,7 +32,6 @@ class CustomObservationBuilder(ObservationBuilder):
# The instantiations which depend on parameters of the Env object should be
# The instantiations which depend on parameters of the Env object should be
# done here, as it is only here that the updated self.env instance is available
# done here, as it is only here that the updated self.env instance is available
self
.
rail_obs
=
np
.
zeros
((
self
.
env
.
height
,
self
.
env
.
width
))
self
.
rail_obs
=
np
.
zeros
((
self
.
env
.
height
,
self
.
env
.
width
))
print
(
"Env Width : "
,
self
.
env
.
width
,
"Env Height : "
,
self
.
env
.
height
)
def
reset
(
self
):
def
reset
(
self
):
"""
"""
...
@@ -48,7 +44,6 @@ class CustomObservationBuilder(ObservationBuilder):
...
@@ -48,7 +44,6 @@ class CustomObservationBuilder(ObservationBuilder):
# Get the transition map value at location _x, _y
# Get the transition map value at location _x, _y
transition_value
=
self
.
env
.
rail
.
get_full_transitions
(
_y
,
_x
)
transition_value
=
self
.
env
.
rail
.
get_full_transitions
(
_y
,
_x
)
self
.
rail_obs
[
_y
,
_x
]
=
transition_value
self
.
rail_obs
[
_y
,
_x
]
=
transition_value
print
(
"Responding to obs_builder.reset()"
)
def
get
(
self
,
handle
:
int
=
0
):
def
get
(
self
,
handle
:
int
=
0
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment