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
63d2f0c2
Commit
63d2f0c2
authored
Sep 12, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
signalling in operation process corrected
parent
a13b5330
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
dream/simulation/Machine.py
dream/simulation/Machine.py
+17
-20
No files found.
dream/simulation/Machine.py
View file @
63d2f0c2
...
...
@@ -659,9 +659,8 @@ class Machine(CoreObject):
if
interruption
.
victim
==
self
and
interruption
.
waitingSignal
:
# signal it and reset the flags
if
interruption
.
expectedSignals
[
'endedLastProcessing'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
endedLastProcessing
.
succeed
(
succeedTuple
)
interruption
.
waitinSignal
=
False
self
.
sendSignal
(
receiver
=
self
,
signal
=
self
.
endedLastProcessing
)
interruption
.
waitingSignal
=
False
self
.
isWorkingOnTheLast
=
False
# set timeLastShiftEnded attribute so that if it is overtime working it is not counted as off-shift time
if
self
.
interruptedBy
==
'ShiftScheduler'
:
...
...
@@ -845,11 +844,11 @@ class Machine(CoreObject):
# and the processing time left
self
.
totalProcessingTimeInCurrentEntity
=
self
.
calculateProcessingTime
()
# get the processing time, tinMStarts holds the processing time of the machine
self
.
tinM
=
self
.
totalProcessingTimeInCurrentEntity
# timer to hold the processing time left
# variables used to flag any interruptions and the end of the processing
self
.
interruption
=
False
processingNotFinished
=
True
# if there is a failure that depends on the working time of the Machine
# send it the victimStartsProcess signal
for
oi
in
self
.
objectInterruptions
:
...
...
@@ -857,11 +856,11 @@ class Machine(CoreObject):
if
oi
.
deteriorationType
==
'working'
:
if
oi
.
expectedSignals
[
'victimStartsProcess'
]:
self
.
sendSignal
(
receiver
=
oi
,
signal
=
oi
.
victimStartsProcess
)
# this loop is repeated until the processing time is expired with no failure
# check when the processingEndedFlag switched to false
while
processingNotFinished
:
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'preemptQueue'
]
=
1
...
...
@@ -883,28 +882,28 @@ class Machine(CoreObject):
assert
eventTime
==
self
.
env
.
now
,
'the interruption has not been processed on the time of activation'
self
.
interruptionStart
=
self
.
env
.
event
()
self
.
interruptionActions
()
# execute interruption actions
#===========================================================
# # release the operator if there is interruption
#===========================================================
if
self
.
shouldYield
(
operationTypes
=
{
"Processing"
:
1
},
methods
=
{
'isOperated'
:
1
}):
yield
self
.
env
.
process
(
self
.
release
())
# loop until we reach at a state that there is no interruption
while
1
:
self
.
expectedSignals
[
'interruptionEnd'
]
=
1
yield
self
.
interruptionEnd
# interruptionEnd to be triggered by ObjectInterruption
transmitter
,
eventTime
=
self
.
interruptionEnd
.
value
assert
eventTime
==
self
.
env
.
now
,
'the interruptionEnd was received later than anticipated'
self
.
interruptionEnd
=
self
.
env
.
event
()
if
self
.
Up
and
self
.
onShift
:
break
self
.
postInterruptionActions
()
#===========================================================
# # request a resource after the repair
#===========================================================
...
...
@@ -944,22 +943,20 @@ class Machine(CoreObject):
assert
eventTime
==
self
.
env
.
now
,
'the preemption must be performed on the time of request'
self
.
preemptQueue
=
self
.
env
.
event
()
self
.
interruptionActions
()
# execute interruption actions
#===========================================================
# # release the operator if there is interruption
#===========================================================
if
self
.
shouldYield
(
operationTypes
=
{
"Processing"
:
1
},
methods
=
{
'isOperated'
:
1
}):
yield
self
.
env
.
process
(
self
.
release
())
self
.
postInterruptionActions
()
break
# if no interruption occurred the processing in M1 is ended
else
:
processingNotFinished
=
False
# carry on actions that have to take place when an Entity ends its processing
self
.
endProcessingActions
()
#===================================================================
...
...
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