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
dac39ecb
Commit
dac39ecb
authored
Aug 14, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MachineJobShop to count processing time in new style
parent
b0dbe2bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
dream/simulation/MachineJobShop.py
dream/simulation/MachineJobShop.py
+7
-5
No files found.
dream/simulation/MachineJobShop.py
View file @
dac39ecb
...
@@ -45,12 +45,14 @@ class MachineJobShop(Machine):
...
@@ -45,12 +45,14 @@ class MachineJobShop(Machine):
# =======================================================================
# =======================================================================
def
endProcessingActions
(
self
):
def
endProcessingActions
(
self
):
self
.
isProcessing
=
False
self
.
isProcessing
=
False
self
.
totalWorkingTime
+=
self
.
env
.
now
-
self
.
timeLastProcessingStarted
activeObject
=
self
.
getActiveObject
()
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
Res
.
users
activeObjectQueue
=
activeObject
.
Res
.
users
activeEntity
=
activeObjectQueue
[
0
]
activeEntity
=
activeObjectQueue
[
0
]
# self.printTrace(activeEntity.name,processEnd=activeObject.objName)
# self.printTrace(activeEntity.name,processEnd=activeObject.objName)
# reset the variables used to handle the interruptions timing
# reset the variables used to handle the interruptions timing
self
.
timeRestartingProcessing
=
0
#
self.timeRestartingProcessing=0
self
.
breakTime
=
0
self
.
breakTime
=
0
# output to trace that the processing in the Machine self.objName ended
# output to trace that the processing in the Machine self.objName ended
try
:
try
:
...
@@ -86,10 +88,10 @@ class MachineJobShop(Machine):
...
@@ -86,10 +88,10 @@ class MachineJobShop(Machine):
if
not
activeObject
.
onShift
:
if
not
activeObject
.
onShift
:
activeObject
.
timeLastShiftEnded
=
self
.
env
.
now
activeObject
.
timeLastShiftEnded
=
self
.
env
.
now
# update the total working time # the total processing time for this entity is what the distribution initially gave
# update the total working time # the total processing time for this entity is what the distribution initially gave
if
not
self
.
shouldPreempt
:
#
if not self.shouldPreempt:
activeObject
.
totalWorkingTime
+=
activeObject
.
totalProcessingTimeInCurrentEntity
#
activeObject.totalWorkingTime+=activeObject.totalProcessingTimeInCurrentEntity
else
:
#
else:
activeObject
.
totalWorkingTime
+=
self
.
env
.
now
-
(
self
.
timeLastEntityEntered
)
#
activeObject.totalWorkingTime+=self.env.now-(self.timeLastEntityEntered)
# update the variables keeping track of Entity related attributes of the machine
# update the variables keeping track of Entity related attributes of the machine
activeObject
.
timeLastEntityEnded
=
self
.
env
.
now
# this holds the time that the last entity ended processing in Machine
activeObject
.
timeLastEntityEnded
=
self
.
env
.
now
# this holds the time that the last entity ended processing in Machine
activeObject
.
nameLastEntityEnded
=
activeObject
.
currentEntity
.
name
# this holds the name of the last entity that ended processing in Machine
activeObject
.
nameLastEntityEnded
=
activeObject
.
currentEntity
.
name
# this holds the name of the last entity that ended processing in Machine
...
...
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