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
8f7596f9
Commit
8f7596f9
authored
Nov 18, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
operator totalWorkingTime to be updated by Machine
parent
c0477e69
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
dream/simulation/Machine.py
dream/simulation/Machine.py
+9
-4
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+0
-1
dream/simulation/SkilledOperatorRouter.py
dream/simulation/SkilledOperatorRouter.py
+0
-1
No files found.
dream/simulation/Machine.py
View file @
8f7596f9
...
...
@@ -440,7 +440,10 @@ class Machine(CoreObject):
self
.
expectedSignals
[
'preemptQueue'
]
=
1
self
.
expectedSignals
[
'processOperatorUnavailable'
]
=
1
# dummy variable to keep track of the time that the operation starts after every interruption
self
.
timeLastOperationStarted
=
self
.
env
.
now
if
self
.
currentOperator
:
self
.
currentOperator
.
timeLastOperationStarted
=
self
.
env
.
now
# # if the type is setup then the time to record is timeLastProcessingStarted
# if type=='Setup':
# self.timeLastSetupStarted=self.timeLastOperationStarted
...
...
@@ -495,6 +498,7 @@ class Machine(CoreObject):
#===========================================================
# # release the operator
#===========================================================
self
.
currentOperator
.
totalWorkingTime
+=
self
.
env
.
now
-
self
.
currentOperator
.
timeLastOperationStarted
yield
self
.
env
.
process
(
self
.
release
())
from
Globals
import
G
# append the entity that was stopped to the pending ones
...
...
@@ -834,6 +838,10 @@ class Machine(CoreObject):
self
.
shouldPreempt
=
False
# reset the variables used to handle the interruptions timing
self
.
breakTime
=
0
if
self
.
currentOperator
:
operator
=
self
.
currentOperator
self
.
outputTrace
(
operator
.
name
,
"ended a process in "
+
self
.
objName
)
operator
.
totalWorkingTime
+=
self
.
env
.
now
-
operator
.
timeLastOperationStarted
# if the station has just concluded a processing turn then
if
type
==
'Processing'
:
# blocking starts
...
...
@@ -1138,9 +1146,6 @@ class Machine(CoreObject):
if
self
.
id
in
G
.
Router
.
expectedFinishSignalsDict
:
signal
=
G
.
Router
.
expectedFinishSignalsDict
[
self
.
id
]
self
.
sendSignal
(
receiver
=
G
.
Router
,
signal
=
signal
)
else
:
self
.
outputTrace
(
operator
.
name
,
"ended a process in "
+
self
.
objName
)
operator
.
totalWorkingTime
+=
self
.
env
.
now
-
operator
.
timeLastOperationStarted
self
.
broker
.
invoke
()
self
.
toBeOperated
=
False
...
...
dream/simulation/OperatedPoolBroker.py
View file @
8f7596f9
...
...
@@ -171,7 +171,6 @@ class Broker(ObjectInterruption):
# The operator is released (the router is not called in the case of skilled ops that work constantly on the same machine)
if
not
self
.
victim
.
checkForDedicatedOperators
():
if
not
self
.
victim
.
isOperated
():
self
.
victim
.
currentOperator
.
totalWorkingTime
+=
self
.
env
.
now
-
self
.
victim
.
currentOperator
.
timeLastOperationStarted
# signal the other brokers waiting for the same operators that they are now free
# also signal the stations that were not requested to receive because the operator was occupied
...
...
dream/simulation/SkilledOperatorRouter.py
View file @
8f7596f9
...
...
@@ -259,7 +259,6 @@ class SkilledRouter(Router):
for
id
in
solution
.
keys
():
operator
=
findObjectById
(
id
)
station
=
findObjectById
(
solution
[
id
])
operator
.
totalWorkingTime
+=
self
.
env
.
now
-
operator
.
timeLastOperationStarted
# signal the station so that it gets the operator
self
.
signalStation
(
station
,
operator
)
...
...
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