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
bef8174e
Commit
bef8174e
authored
5 years ago
by
u214892
Browse files
Options
Downloads
Patches
Plain Diff
#69 enhanced output
parent
0db89d48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
flatland/utils/graphics_pil.py
+7
-7
7 additions, 7 deletions
flatland/utils/graphics_pil.py
tox.ini
+2
-0
2 additions, 0 deletions
tox.ini
with
9 additions
and
7 deletions
flatland/utils/graphics_pil.py
+
7
−
7
View file @
bef8174e
...
@@ -358,17 +358,17 @@ class PILSVG(PILGL):
...
@@ -358,17 +358,17 @@ class PILSVG(PILGL):
"
NN SS
"
:
"
Bahnhof_#d50000_Gleis_vertikal.svg
"
}
"
NN SS
"
:
"
Bahnhof_#d50000_Gleis_vertikal.svg
"
}
# Dict of rail cell images indexed by binary transitions
# Dict of rail cell images indexed by binary transitions
self
.
dPilRail
=
self
.
loadSVGs
(
dRailFiles
,
rotate
=
True
,
backgroundImage
=
"
Background_rail.svg
"
,
dPilRail
Files
=
self
.
loadSVGs
(
dRailFiles
,
rotate
=
True
,
backgroundImage
=
"
Background_rail.svg
"
,
whitefilter
=
"
Background_white_filter.svg
"
)
whitefilter
=
"
Background_white_filter.svg
"
)
# Load the target files (which have rails and transitions of their own)
# Load the target files (which have rails and transitions of their own)
# They are indexed by (binTrans, iAgent), ie a tuple of the binary transition and the agent index
# They are indexed by (binTrans, iAgent), ie a tuple of the binary transition and the agent index
dPil
Rail2
=
self
.
loadSVGs
(
dTargetFiles
,
rotate
=
False
,
agent_colors
=
self
.
ltAgentColors
,
dPil
TargetFiles
=
self
.
loadSVGs
(
dTargetFiles
,
rotate
=
False
,
agent_colors
=
self
.
ltAgentColors
,
backgroundImage
=
"
Background_rail.svg
"
,
backgroundImage
=
"
Background_rail.svg
"
,
whitefilter
=
"
Background_white_filter.svg
"
)
whitefilter
=
"
Background_white_filter.svg
"
)
# Merge them with the regular rails.
# Merge them with the regular rails.
# https://stackoverflow.com/questions/38987/how-to-merge-two-dictionaries-in-a-single-expression
# https://stackoverflow.com/questions/38987/how-to-merge-two-dictionaries-in-a-single-expression
self
.
dPilRail
=
{
**
self
.
dPilRail
,
**
dPil
Rail2
}
self
.
dPilRail
=
{
**
dPilRail
Files
,
**
dPil
TargetFiles
}
def
loadSVGs
(
self
,
dDirFile
,
rotate
=
False
,
agent_colors
=
False
,
backgroundImage
=
None
,
whitefilter
=
None
):
def
loadSVGs
(
self
,
dDirFile
,
rotate
=
False
,
agent_colors
=
False
,
backgroundImage
=
None
,
whitefilter
=
None
):
dPil
=
{}
dPil
=
{}
...
@@ -445,13 +445,13 @@ class PILSVG(PILGL):
...
@@ -445,13 +445,13 @@ class PILSVG(PILGL):
self
.
drawImageRC
(
pilTrack
,
(
row
,
col
))
self
.
drawImageRC
(
pilTrack
,
(
row
,
col
))
else
:
else
:
print
(
"
Illegal rail:
"
,
row
,
col
,
format
(
binTrans
,
"
#018b
"
)[
2
:])
print
(
"
Illegal rail:
"
,
row
,
col
,
format
(
binTrans
,
"
#018b
"
)[
2
:]
,
binTrans
)
else
:
else
:
if
(
binTrans
,
iTarget
)
in
self
.
dPilRail
:
if
(
binTrans
,
iTarget
)
in
self
.
dPilRail
:
pilTrack
=
self
.
dPilRail
[(
binTrans
,
iTarget
)]
pilTrack
=
self
.
dPilRail
[(
binTrans
,
iTarget
)]
self
.
drawImageRC
(
pilTrack
,
(
row
,
col
))
self
.
drawImageRC
(
pilTrack
,
(
row
,
col
))
else
:
else
:
print
(
"
Illegal target rail:
"
,
row
,
col
,
format
(
binTrans
,
"
#018b
"
)[
2
:])
print
(
"
Illegal target rail:
"
,
row
,
col
,
format
(
binTrans
,
"
#018b
"
)[
2
:]
,
(
binTrans
,
iTarget
)
)
if
isSelected
:
if
isSelected
:
svgBG
=
self
.
pilFromSvgFile
(
"
svg
"
,
"
Selected_Target.svg
"
)
svgBG
=
self
.
pilFromSvgFile
(
"
svg
"
,
"
Selected_Target.svg
"
)
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
2
−
0
View file @
bef8174e
...
@@ -98,7 +98,9 @@ deps =
...
@@ -98,7 +98,9 @@ deps =
commands
=
commands
=
; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths
; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths
sh
-c
'mkdir
-p
{envtmpdir}/6f59bc68108c3895b1828abdd04b9a06'
sh
-c
'mkdir
-p
{envtmpdir}/6f59bc68108c3895b1828abdd04b9a06'
sh
-c
'jupyter
nbextension
install
--py
--sys-prefix
widgetsnbextension'
sh
-c
'jupyter
nbextension
enable
--py
--sys-prefix
widgetsnbextension'
sh
-c
'jupyter
nbextension
enable
--py
--sys-prefix
widgetsnbextension'
sh
-c
'jupyter
nbextension
install
--py
--sys-prefix
jpy_canvas'
sh
-c
'jupyter
nbextension
enable
--py
--sys-prefix
jpy_canvas'
sh
-c
'jupyter
nbextension
enable
--py
--sys-prefix
jpy_canvas'
; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463
; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463
sh
-c
'ls
notebooks/*.ipynb
|
xargs
-n
1
jupyter
nbconvert
--to
python'
sh
-c
'ls
notebooks/*.ipynb
|
xargs
-n
1
jupyter
nbconvert
--to
python'
...
...
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