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
239eff74
Commit
239eff74
authored
Feb 05, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Feb 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Entity and Exit updated so that number of units can be counted in cases that involve Batches
parent
89259874
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
dream/simulation/Entity.py
dream/simulation/Entity.py
+2
-1
dream/simulation/Exit.py
dream/simulation/Exit.py
+5
-3
No files found.
dream/simulation/Entity.py
View file @
239eff74
...
@@ -53,7 +53,8 @@ class Entity(object):
...
@@ -53,7 +53,8 @@ class Entity(object):
# values to be used in the internal processing of compoundObjects
# values to be used in the internal processing of compoundObjects
self
.
internal
=
False
# informs if the entity is being processed internally
self
.
internal
=
False
# informs if the entity is being processed internally
self
.
isCritical
=
isCritical
# flag to inform weather the entity is critical -> preemption
self
.
isCritical
=
isCritical
# flag to inform weather the entity is critical -> preemption
self
.
manager
=
None
self
.
manager
=
None
# default value
self
.
numberOfUnits
=
1
# default value
# =======================================================================
# =======================================================================
# outputs results to JSON File
# outputs results to JSON File
...
...
dream/simulation/Exit.py
View file @
239eff74
...
@@ -61,6 +61,7 @@ class Exit(CoreObject):
...
@@ -61,6 +61,7 @@ class Exit(CoreObject):
# The number of resource that exited through this exit.
# The number of resource that exited through this exit.
# XXX bug: cannot output as json when nothing has exited.
# XXX bug: cannot output as json when nothing has exited.
self
.
numOfExits
=
0
self
.
numOfExits
=
0
self
.
totalNumberOfUnitsExited
=
0
self
.
totalLifespan
=
0
self
.
totalLifespan
=
0
self
.
totalTaktTime
=
0
# the total time between to consecutive exits
self
.
totalTaktTime
=
0
# the total time between to consecutive exits
...
@@ -112,9 +113,10 @@ class Exit(CoreObject):
...
@@ -112,9 +113,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
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
.
totalTaktTime
+=
now
()
-
self
.
timeLastEntityLeft
# add the takt time
self
.
totalNumberOfUnitsExited
+=
activeEntity
.
numberOfUnits
# add the number of units that xited
self
.
timeLastEntityLeft
=
now
()
# update the time that the last entity left from the Exit
self
.
totalTaktTime
+=
now
()
-
self
.
timeLastEntityLeft
# add the takt time
self
.
timeLastEntityLeft
=
now
()
# update the time that the last entity left from the Exit
return
activeEntity
return
activeEntity
# =======================================================================
# =======================================================================
...
...
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