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
91ff7d01
Commit
91ff7d01
authored
5 years ago
by
Erik Nygren
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.aicrowd.com:flatland/flatland
parents
03aacc07
c31d45e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flatland/utils/graphics_pil.py
+11
-11
11 additions, 11 deletions
flatland/utils/graphics_pil.py
flatland/utils/rendertools.py
+2
-0
2 additions, 0 deletions
flatland/utils/rendertools.py
setup.py
+3
-5
3 additions, 5 deletions
setup.py
with
16 additions
and
16 deletions
flatland/utils/graphics_pil.py
+
11
−
11
View file @
91ff7d01
...
@@ -276,7 +276,7 @@ class PILSVG(PILGL):
...
@@ -276,7 +276,7 @@ class PILSVG(PILGL):
def
loadBuildingSVGs
(
self
):
def
loadBuildingSVGs
(
self
):
dBuildingFiles
=
{
dBuildingFiles
=
[
"
Buildings/Bank.svg
"
,
"
Buildings/Bank.svg
"
,
"
Buildings/Bar.svg
"
,
"
Buildings/Bar.svg
"
,
"
Buildings/Fabrik_A.svg
"
,
"
Buildings/Fabrik_A.svg
"
,
...
@@ -295,7 +295,7 @@ class PILSVG(PILGL):
...
@@ -295,7 +295,7 @@ class PILSVG(PILGL):
"
Buildings/Post.svg
"
,
"
Buildings/Post.svg
"
,
"
Buildings/Supermarkt.svg
"
,
"
Buildings/Supermarkt.svg
"
,
"
Buildings/Tankstelle.svg
"
,
"
Buildings/Tankstelle.svg
"
,
"
Buildings/Wohnhaus.svg
"
}
"
Buildings/Wohnhaus.svg
"
]
self
.
dBuildings
=
[]
self
.
dBuildings
=
[]
for
sFile
in
dBuildingFiles
:
for
sFile
in
dBuildingFiles
:
...
@@ -303,19 +303,19 @@ class PILSVG(PILGL):
...
@@ -303,19 +303,19 @@ class PILSVG(PILGL):
self
.
dBuildings
.
append
(
img
)
self
.
dBuildings
.
append
(
img
)
def
loadScenerySVGs
(
self
):
def
loadScenerySVGs
(
self
):
dSceneryFiles
=
{
dSceneryFiles
=
[
"
Scenery/Bergwelt_A_Teil_1_links.svg
"
,
"
Scenery/Bergwelt_A_Teil_2_mitte.svg
"
,
"
Scenery/Bergwelt_A_Teil_3_rechts.svg
"
,
"
Scenery/Bergwelt_B.svg
"
,
"
Scenery/Bergwelt_C_Teil_1_links.svg
"
,
"
Scenery/Bergwelt_C_Teil_2_rechts.svg
"
,
"
Scenery/Laubbaume_A.svg
"
,
"
Scenery/Laubbaume_A.svg
"
,
"
Scenery/Laubbaume_B.svg
"
,
"
Scenery/Laubbaume_B.svg
"
,
"
Scenery/Laubbaume_C.svg
"
,
"
Scenery/Laubbaume_C.svg
"
,
"
Scenery/Nadelbaume_A.svg
"
,
"
Scenery/Nadelbaume_A.svg
"
,
"
Scenery/Nadelbaume_B.svg
"
,
"
Scenery/Nadelbaume_B.svg
"
,
}
"
Scenery/Bergwelt_B.svg
"
,
"
Scenery/Bergwelt_C_Teil_1_links.svg
"
,
"
Scenery/Bergwelt_C_Teil_2_rechts.svg
"
,
"
Scenery/Bergwelt_A_Teil_1_links.svg
"
,
"
Scenery/Bergwelt_A_Teil_2_mitte.svg
"
,
"
Scenery/Bergwelt_A_Teil_3_rechts.svg
"
,
]
self
.
dScenery
=
[]
self
.
dScenery
=
[]
for
sFile
in
dSceneryFiles
:
for
sFile
in
dSceneryFiles
:
img
=
self
.
pilFromSvgFile
(
'
svg
'
,
sFile
)
img
=
self
.
pilFromSvgFile
(
'
svg
'
,
sFile
)
...
@@ -418,7 +418,7 @@ class PILSVG(PILGL):
...
@@ -418,7 +418,7 @@ class PILSVG(PILGL):
a
=
a
%
len
(
self
.
dBuildings
)
a
=
a
%
len
(
self
.
dBuildings
)
pilTrack
=
self
.
dBuildings
[
a
]
pilTrack
=
self
.
dBuildings
[
a
]
else
:
else
:
a
=
int
(
self
.
background_grid
[
col
][
row
])
a
=
int
(
self
.
background_grid
[
col
][
row
])
-
4
a
=
a
%
len
(
self
.
dScenery
)
a
=
a
%
len
(
self
.
dScenery
)
pilTrack
=
self
.
dScenery
[
a
]
pilTrack
=
self
.
dScenery
[
a
]
...
...
This diff is collapsed.
Click to expand it.
flatland/utils/rendertools.py
+
2
−
0
View file @
91ff7d01
...
@@ -658,6 +658,8 @@ class RenderTool(object):
...
@@ -658,6 +658,8 @@ class RenderTool(object):
self
.
gl
.
setRailAt
(
r
,
c
,
binTrans
,
iTarget
=
target
,
isSelected
=
isSelected
)
self
.
gl
.
setRailAt
(
r
,
c
,
binTrans
,
iTarget
=
target
,
isSelected
=
isSelected
)
self
.
gl
.
build_background_map
(
dTargets
)
for
iAgent
,
agent
in
enumerate
(
self
.
env
.
agents
):
for
iAgent
,
agent
in
enumerate
(
self
.
env
.
agents
):
if
agent
is
None
:
if
agent
is
None
:
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
3
−
5
View file @
91ff7d01
...
@@ -63,10 +63,8 @@ else:
...
@@ -63,10 +63,8 @@ else:
def
get_all_svg_files
(
directory
=
'
./svg/
'
):
def
get_all_svg_files
(
directory
=
'
./svg/
'
):
ret
=
[]
ret
=
[]
for
f
in
os
.
listdir
(
directory
):
for
f
in
os
.
listdir
(
directory
):
if
f
!=
'
__pycache__
'
:
if
os
.
path
.
isfile
(
os
.
path
.
join
(
directory
,
f
)):
if
f
!=
"
Buildings
"
and
f
!=
"
Scenery
"
:
ret
.
append
(
directory
+
f
)
ret
.
append
(
directory
+
f
)
print
(
"
install svg:
"
,
ret
)
return
ret
return
ret
...
@@ -105,7 +103,7 @@ setup(
...
@@ -105,7 +103,7 @@ setup(
keywords
=
'
flatland
'
,
keywords
=
'
flatland
'
,
name
=
'
flatland-rl
'
,
name
=
'
flatland-rl
'
,
packages
=
find_packages
(
'
.
'
),
packages
=
find_packages
(
'
.
'
),
data_files
=
[(
'
svg
'
,
get_all_svg_files
())
,(
'
svg/Buildings
'
,
get_all_svg_files
(
'
svg/Buildings/
'
)),(
'
svg/Scenery
'
,
get_all_svg_files
(
'
svg/Scenery/
'
))
],
data_files
=
[(
'
svg
'
,
get_all_svg_files
())],
setup_requires
=
setup_requirements
,
setup_requires
=
setup_requirements
,
test_suite
=
'
tests
'
,
test_suite
=
'
tests
'
,
tests_require
=
test_requirements
,
tests_require
=
test_requirements
,
...
...
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