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
b7802108
Commit
b7802108
authored
5 years ago
by
Erik Nygren
Browse files
Options
Downloads
Patches
Plain Diff
huge refactoring of render code
also added new prediction rendering editor still broken with this update
parent
d0a739d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flatland/utils/editor.py
+11
-11
11 additions, 11 deletions
flatland/utils/editor.py
with
11 additions
and
11 deletions
flatland/utils/editor.py
+
11
−
11
View file @
b7802108
...
...
@@ -240,10 +240,10 @@ class Controller(object):
self
.
model
.
set_debug
(
event
[
"
new
"
])
def
set_debug_move
(
self
,
event
):
self
.
model
.
set
D
ebug_move
(
event
[
"
new
"
])
self
.
model
.
set
_d
ebug_move
(
event
[
"
new
"
])
def
set_draw_mode
(
self
,
event
):
self
.
draw
M
ode
=
event
[
"
new
"
]
self
.
set_
draw
_m
ode
=
event
[
"
new
"
]
def
set_filename
(
self
,
event
):
self
.
model
.
set_filename
(
event
[
"
new
"
])
...
...
@@ -296,8 +296,8 @@ class Controller(object):
# Convert the xy position to a cell rc
# Enqueue transitions across cells in another queue
if
len
(
q_events
)
>
0
:
t
N
ow
=
time
.
time
()
if
t
N
ow
-
q_events
[
0
][
0
]
>
0.1
:
# wait before trying to draw
t
_n
ow
=
time
.
time
()
if
t
_n
ow
-
q_events
[
0
][
0
]
>
0.1
:
# wait before trying to draw
while
len
(
q_events
)
>
0
:
t
,
x
,
y
=
q_events
.
popleft
()
# get events from our queue
...
...
@@ -329,10 +329,10 @@ class Controller(object):
def
rotate_agent
(
self
,
event
):
self
.
log
(
"
Rotate Agent:
"
,
self
.
model
.
selected_agent
)
if
self
.
model
.
selected_agent
is
not
None
:
for
iA
gent
,
agent
in
enumerate
(
self
.
model
.
env
.
agents_static
):
for
a
gent
_idx
,
agent
in
enumerate
(
self
.
model
.
env
.
agents_static
):
if
agent
is
None
:
continue
if
iA
gent
==
self
.
model
.
selected_agent
:
if
a
gent
_idx
==
self
.
model
.
selected_agent
:
agent
.
direction
=
(
agent
.
direction
+
1
)
%
4
agent
.
old_direction
=
agent
.
direction
self
.
model
.
redraw
()
...
...
@@ -395,13 +395,13 @@ class EditorModel(object):
self
.
debug_bool
=
False
self
.
debug_move_bool
=
False
self
.
wid_output
=
None
self
.
draw
M
ode
=
"
Draw
"
self
.
draw
_m
ode
=
"
Draw
"
self
.
env_filename
=
"
temp.pkl
"
self
.
set_env
(
env
)
self
.
selected_agent
=
None
self
.
init_agents_static
=
None
self
.
thread
=
None
self
.
save
I
mage
C
nt
=
0
self
.
save
_i
mage
_cou
nt
=
0
def
set_env
(
self
,
env
):
"""
...
...
@@ -418,7 +418,7 @@ class EditorModel(object):
self
.
log
(
"
Set DebugMove:
"
,
self
.
debug_move_bool
)
def
set_draw_mode
(
self
,
draw_mode
):
self
.
draw
M
ode
=
draw_mode
self
.
draw
_m
ode
=
draw_mode
def
interpolate_path
(
self
,
rcLast
,
rcCell
):
if
np
.
array_equal
(
rcLast
,
rcCell
):
...
...
@@ -651,8 +651,8 @@ class EditorModel(object):
self
.
env
.
agents
=
temp_store
def
save_image
(
self
):
self
.
view
.
oRT
.
gl
.
save_image
(
'
frame_{:04d}.bmp
'
.
format
(
self
.
save
I
mage
C
nt
))
self
.
save
I
mage
C
nt
+=
1
self
.
view
.
oRT
.
gl
.
save_image
(
'
frame_{:04d}.bmp
'
.
format
(
self
.
save
_i
mage
_cou
nt
))
self
.
save
_i
mage
_cou
nt
+=
1
self
.
view
.
redraw
()
def
regenerate
(
self
,
method
=
None
,
nAgents
=
0
,
env
=
None
):
...
...
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