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
71bfe7c7
Commit
71bfe7c7
authored
Aug 15, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Machine to be able to continue when operator is back
parent
fb12ec3f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
dream/simulation/Machine.py
dream/simulation/Machine.py
+17
-17
No files found.
dream/simulation/Machine.py
View file @
71bfe7c7
...
...
@@ -615,7 +615,6 @@ class Machine(CoreObject):
# else (if interrupted()) set interruption flag to true (only if tinM==0),
# and recalculate the processing time left tinM, passivate while waiting for repair.
# if a preemption has occurred then react accordingly (proceed with getting the critical entity)
# receivedEvent = yield self.env.timeout(self.tinM) | self.interruptionStart | self.preemptQueue
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
interruptionStart
,
self
.
env
.
timeout
(
self
.
tinM
)
,
self
.
preemptQueue
,
self
.
processOperatorUnavailable
])
if
self
.
interruptionStart
in
receivedEvent
:
# if a failure occurs while processing the machine is interrupted.
...
...
@@ -682,19 +681,20 @@ class Machine(CoreObject):
assert
self
.
env
.
now
==
self
.
processOperatorUnavailable
.
value
,
'the operator leaving has not been processed at
\
the time it should'
self
.
processOperatorUnavailable
=
self
.
env
.
event
()
# carry interruption actions
self
.
interruptionActions
()
# machine has to release the operator
self
.
releaseOperator
()
# request for allocation
self
.
requestAllocation
()
# wait until the Broker has finished processing
yield
self
.
brokerIsSet
self
.
brokerIsSet
=
self
.
env
.
event
()
# carry interruption actions
self
.
interruptionActions
()
# wait until there is available processing operator (to be sent by Router)
yield
self
.
processOperatorAvailable
# interruptionEnd to be triggered by ObjectInterruption
assert
self
.
env
.
now
==
self
.
processOperatorAvailable
.
value
,
'the operator available has not been received in time'
self
.
processOperatorAvailable
=
self
.
env
.
event
()
from
Globals
import
G
# append the entity that was stopped to the pending ones
if
G
.
Router
:
G
.
pendingEntities
.
append
(
self
.
currentEntity
)
# machine has to request again for operaror
self
.
requestOperator
()
yield
self
.
brokerIsSet
self
.
brokerIsSet
=
self
.
env
.
event
()
# carry post interruption actions
self
.
postInterruptionActions
()
# if the station is reactivated by the preempt method
...
...
@@ -922,15 +922,11 @@ class Machine(CoreObject):
if
self
.
isBlocked
:
self
.
addBlockage
()
# set isProcessing to False
self
.
isProcessing
=
False
# set isBlocked to False
self
.
isBlocked
=
False
activeObjectQueue
=
self
.
Res
.
users
activeEntity
=
activeObjectQueue
[
0
]
self
.
printTrace
(
activeEntity
.
name
,
interrupted
=
self
.
objName
)
# if the interrupt occurred while processing an entity
if
not
self
.
waitToDispose
:
if
self
.
isProcessing
:
# output to trace that the Machine (self.objName) got interrupted
try
:
self
.
outputTrace
(
activeObjectQueue
[
0
].
name
,
"Interrupted at "
+
self
.
objName
)
...
...
@@ -945,6 +941,10 @@ class Machine(CoreObject):
self
.
interruption
=
True
# start counting the down time at breatTime dummy variable
self
.
breakTime
=
self
.
env
.
now
# dummy variable that the interruption happened
# set isProcessing to False
self
.
isProcessing
=
False
# set isBlocked to False
self
.
isBlocked
=
False
# =======================================================================
# actions to be carried out when the processing of an Entity ends
...
...
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