Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
15e782cf
Commit
15e782cf
authored
Jun 15, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
endSimulation method corrected to keep the last event (chronologically)
parent
fdd3f329
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
dream/simulation/ManPyObject.py
dream/simulation/ManPyObject.py
+8
-2
No files found.
dream/simulation/ManPyObject.py
View file @
15e782cf
...
...
@@ -184,9 +184,15 @@ class ManPyObject(object):
# cancel all the scheduled events
from
Globals
import
G
from
copy
import
copy
G
.
env
.
_queue
.
sort
(
key
=
lambda
item
:
item
[
0
])
scheduledEvents
=
copy
(
G
.
env
.
_queue
)
for
scheduledEvent
in
scheduledEvents
:
G
.
env
.
_queue
.
remove
(
scheduledEvent
)
for
index
,
scheduledEvent
in
enumerate
(
scheduledEvents
):
if
not
index
==
len
(
scheduledEvents
)
-
1
:
G
.
env
.
_queue
.
remove
(
scheduledEvent
)
else
:
edited
=
[[
i
for
i
in
event
]
for
event
in
G
.
env
.
_queue
]
edited
[
-
1
][
0
]
=
G
.
env
.
now
G
.
env
.
_queue
=
[
tuple
(
i
for
i
in
event
)
for
event
in
edited
]
G
.
maxSimTime
=
G
.
env
.
now
# =======================================================================
...
...
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