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
2b2be4ee
Commit
2b2be4ee
authored
Feb 21, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now Exit deletes entities from G.pendingEntities
parent
df00aac6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
dream/simulation/Exit.py
dream/simulation/Exit.py
+4
-0
No files found.
dream/simulation/Exit.py
View file @
2b2be4ee
...
@@ -114,6 +114,10 @@ class Exit(CoreObject):
...
@@ -114,6 +114,10 @@ class Exit(CoreObject):
# =======================================================================
# =======================================================================
def
getEntity
(
self
):
def
getEntity
(
self
):
activeEntity
=
CoreObject
.
getEntity
(
self
)
#run the default method
activeEntity
=
CoreObject
.
getEntity
(
self
)
#run the default method
# if the entity is in the G.pendingEntities list then remove it from there
from
Globals
import
G
if
activeEntity
in
G
.
pendingEntities
:
G
.
pendingEntities
.
remove
(
activeEntity
)
self
.
totalLifespan
+=
now
()
-
activeEntity
.
startTime
#Add the entity's lifespan to the total one.
self
.
totalLifespan
+=
now
()
-
activeEntity
.
startTime
#Add the entity's lifespan to the total one.
self
.
numOfExits
+=
1
# increase the exits by one
self
.
numOfExits
+=
1
# increase the exits by one
self
.
totalNumberOfUnitsExited
+=
activeEntity
.
numberOfUnits
# add the number of units that xited
self
.
totalNumberOfUnitsExited
+=
activeEntity
.
numberOfUnits
# add the number of units that xited
...
...
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