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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
elrichgro
Flatland
Commits
eaac3484
Commit
eaac3484
authored
5 years ago
by
Erik Nygren
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.aicrowd.com:flatland/flatland
parents
318a4df6
0d32b1ee
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/demo.py
+5
-5
5 additions, 5 deletions
examples/demo.py
flatland/utils/render_qt.py
+1
-0
1 addition, 0 deletions
flatland/utils/render_qt.py
with
6 additions
and
5 deletions
examples/demo.py
+
5
−
5
View file @
eaac3484
...
...
@@ -131,10 +131,10 @@ class Demo:
self
.
state_size
=
105
*
2
self
.
action_size
=
4
self
.
agent
=
Agent
(
self
.
state_size
,
self
.
action_size
,
"
FC
"
,
0
)
self
.
agent
.
qnetwork_local
.
load_state_dict
(
torch
.
load
(
'
.
.
/flatland/baselines/Nets/avoid_checkpoint15000.pth
'
))
self
.
agent
.
qnetwork_local
.
load_state_dict
(
torch
.
load
(
'
./flatland/baselines/Nets/avoid_checkpoint15000.pth
'
))
def
create_renderer
(
self
):
self
.
renderer
=
RenderTool
(
self
.
env
,
gl
=
"
QT
"
)
self
.
renderer
=
RenderTool
(
self
.
env
,
gl
=
"
QT
SVG
"
)
handle
=
self
.
env
.
get_agent_handles
()
return
handle
...
...
@@ -201,14 +201,14 @@ if False:
demo_001
.
run_demo
()
demo_001
=
None
demo_000
=
Demo
(
Scenario_Generator
.
load_scenario
(
'
.
.
/env-data/railway/example_network_000.pkl
'
))
demo_000
=
Demo
(
Scenario_Generator
.
load_scenario
(
'
./env-data/railway/example_network_000.pkl
'
))
demo_000
.
run_demo
()
demo_000
=
None
demo_001
=
Demo
(
Scenario_Generator
.
load_scenario
(
'
.
.
/env-data/railway/example_network_001.pkl
'
))
demo_001
=
Demo
(
Scenario_Generator
.
load_scenario
(
'
./env-data/railway/example_network_001.pkl
'
))
demo_001
.
run_demo
()
demo_001
=
None
demo_002
=
Demo
(
Scenario_Generator
.
load_scenario
(
'
.
.
/env-data/railway/example_network_002.pkl
'
))
demo_002
=
Demo
(
Scenario_Generator
.
load_scenario
(
'
./env-data/railway/example_network_002.pkl
'
))
demo_002
.
run_demo
()
demo_002
=
None
This diff is collapsed.
Click to expand it.
flatland/utils/render_qt.py
+
1
−
0
View file @
eaac3484
...
...
@@ -170,6 +170,7 @@ class QTSVG(GraphicsLayer):
def
setRailAt
(
self
,
row
,
col
,
binTrans
):
if
binTrans
in
self
.
track
.
dSvg
:
sSVG
=
self
.
track
.
dSvg
[
binTrans
].
to_string
()
sSVG
=
sSVG
.
replace
(
"
ASCII
"
,
"
UTF-8
"
)
bySVG
=
bytearray
(
sSVG
,
encoding
=
'
utf-8
'
)
svgWidget
=
QtSvg
.
QSvgWidget
()
svgWidget
.
renderer
().
load
(
bySVG
)
...
...
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