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
Flatland
Flatland
Commits
b1e76401
Commit
b1e76401
authored
May 01, 2019
by
Erik Nygren
Browse files
minor updates
parent
38423832
Pipeline
#468
failed with stage
in 1 minute and 53 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
flatland/core/env_observation_builder.py
View file @
b1e76401
...
...
@@ -342,8 +342,8 @@ class TreeObsForRailEnv(ObservationBuilder):
elif
num_transitions
==
0
:
# Wrong cell type, but let's cover it and treat it as a dead-end, just in case
print
(
"WRONG CELL TYPE detected in tree-search (0 transitions possible) at cell"
,
position
[
0
],
position
[
1
],
direction
)
#
print("WRONG CELL TYPE detected in tree-search (0 transitions possible) at cell", position[0],
#
position[1], direction)
last_isTerminal
=
True
break
...
...
flatland/envs/rail_env.py
View file @
b1e76401
...
...
@@ -1021,6 +1021,8 @@ class RailEnv(Environment):
nbits
=
0
tmp
=
self
.
rail
.
get_transitions
((
pos
[
0
],
pos
[
1
]))
print
(
np
.
sum
(
self
.
rail
.
get_transitions
((
pos
[
0
],
pos
[
1
],
direction
))),
self
.
rail
.
get_transitions
((
pos
[
0
],
pos
[
1
],
direction
)),
self
.
rail
.
get_transitions
((
pos
[
0
],
pos
[
1
])),(
pos
[
0
],
pos
[
1
],
direction
))
while
tmp
>
0
:
nbits
+=
(
tmp
&
1
)
tmp
=
tmp
>>
1
...
...
tests/test_rendertools.py
View file @
b1e76401
...
...
@@ -30,8 +30,8 @@ def checkFrozenImage(sFileImage):
if
bytesFrozenImage
is
None
:
bytesFrozenImage
=
bytesImage
else
:
assert
(
bytesFrozenImage
.
shape
==
bytesImage
.
shape
)
assert
((
np
.
sum
(
np
.
square
(
bytesFrozenImage
-
bytesImage
))
/
bytesFrozenImage
.
size
)
<
1e-3
)
assert
(
bytesFrozenImage
.
shape
==
bytesImage
.
shape
)
assert
((
np
.
sum
(
np
.
square
(
bytesFrozenImage
-
bytesImage
))
/
bytesFrozenImage
.
size
)
<
1e-3
)
def
test_render_env
():
...
...
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