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
245ef0ee
Commit
245ef0ee
authored
Sep 08, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interruption objects updated for the new type of signalling
parent
f05ce07f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
dream/simulation/ScheduledMaintenance.py
dream/simulation/ScheduledMaintenance.py
+4
-2
dream/simulation/ShiftScheduler.py
dream/simulation/ShiftScheduler.py
+6
-3
No files found.
dream/simulation/ScheduledMaintenance.py
View file @
245ef0ee
...
...
@@ -83,7 +83,8 @@ class ScheduledMaintenance(ObjectInterruption):
self
.
waitingSignal
=
True
# TODO: signal to be triggered by postProcessingActions of Machines
yield
self
.
victim
.
endedLastProcessing
# there is no signal yet that signals the change of such state (an object getting empty)
assert
self
.
victim
.
endedLastProcessing
.
value
==
self
.
env
.
now
,
'the processing end signal is not received by maintenance on time'
transmitter
,
eventTime
=
self
.
victim
.
endedLastProcessing
.
value
assert
eventTime
==
self
.
env
.
now
,
'the processing end signal is not received by maintenance on time'
self
.
victim
.
endedLastProcessing
=
self
.
env
.
event
()
waitTime
=
self
.
env
.
now
-
waitStartTime
self
.
interruptVictim
()
...
...
@@ -93,7 +94,8 @@ class ScheduledMaintenance(ObjectInterruption):
self
.
waitingSignal
=
True
# TODO: signal to be triggered by removeEntity of Machines
yield
self
.
victimIsEmptyBeforeMaintenance
# there is no signal yet that signals the change of such state (an object getting empty)
assert
self
.
victimIsEmptyBeforeMaintenance
.
value
==
self
.
env
.
now
,
'the processing end signal is not received by maintenance on time'
transmitter
,
eventTime
=
self
.
victimIsEmptyBeforeMaintenance
.
value
assert
eventTime
==
self
.
env
.
now
,
'the processing end signal is not received by maintenance on time'
self
.
victimIsEmptyBeforeMaintenance
=
self
.
env
.
event
()
waitTime
=
self
.
env
.
now
-
waitStartTime
self
.
interruptVictim
()
...
...
dream/simulation/ShiftScheduler.py
View file @
245ef0ee
...
...
@@ -78,7 +78,8 @@ class ShiftScheduler(ObjectInterruption):
# if the victim has interruptions that measure only the on-shift time, they have to be notified
for
oi
in
self
.
victim
.
objectInterruptions
:
if
oi
.
isWaitingForVictimOnShift
:
oi
.
victimOnShift
.
succeed
()
succeedTuple
=
(
self
,
self
.
env
.
now
)
oi
.
victimOnShift
.
succeed
(
succeedTuple
)
self
.
victim
.
totalOffShiftTime
+=
self
.
env
.
now
-
self
.
victim
.
timeLastShiftEnded
self
.
victim
.
onShift
=
True
...
...
@@ -96,13 +97,15 @@ class ShiftScheduler(ObjectInterruption):
if
self
.
endUnfinished
and
len
(
self
.
victim
.
getActiveObjectQueue
())
==
1
and
(
not
self
.
victim
.
waitToDispose
):
self
.
victim
.
isWorkingOnTheLast
=
True
self
.
waitingSignal
=
True
yield
self
.
victim
.
endedLastProcessing
yield
self
.
victim
.
endedLastProcessing
transmitter
,
eventTime
=
self
.
victim
.
endedLastProcessing
.
value
self
.
victim
.
endedLastProcessing
=
self
.
env
.
event
()
# if the victim has interruptions that measure only the on-shift time, they have to be notified
for
oi
in
self
.
victim
.
objectInterruptions
:
if
oi
.
isWaitingForVictimOffShift
:
oi
.
victimOffShift
.
succeed
()
succeedTuple
=
(
self
,
self
.
env
.
now
)
oi
.
victimOffShift
.
succeed
(
succeedTuple
)
# interrupt the victim only if it was not previously interrupted
if
not
self
.
victim
.
interruptionStart
.
triggered
:
...
...
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