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
540a1229
Commit
540a1229
authored
Sep 08, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup in ShiftScheduler
parent
e26a81ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
dream/simulation/ShiftScheduler.py
dream/simulation/ShiftScheduler.py
+3
-8
No files found.
dream/simulation/ShiftScheduler.py
View file @
540a1229
...
@@ -125,6 +125,7 @@ class ShiftScheduler(ObjectInterruption):
...
@@ -125,6 +125,7 @@ class ShiftScheduler(ObjectInterruption):
transmitter
,
eventTime
=
self
.
victim
.
endedLastProcessing
.
value
transmitter
,
eventTime
=
self
.
victim
.
endedLastProcessing
.
value
self
.
victim
.
endedLastProcessing
=
self
.
env
.
event
()
self
.
victim
.
endedLastProcessing
=
self
.
env
.
event
()
self
.
interruptVictim
()
# if the victim is operator
# if the victim is operator
elif
issubclass
(
self
.
victim
.
__class__
,
ObjectResource
):
elif
issubclass
(
self
.
victim
.
__class__
,
ObjectResource
):
# if the operator is working in a station and the mode is
# if the operator is working in a station and the mode is
...
@@ -134,6 +135,7 @@ class ShiftScheduler(ObjectInterruption):
...
@@ -134,6 +135,7 @@ class ShiftScheduler(ObjectInterruption):
if
station
:
if
station
:
if
not
self
.
endUnfinished
and
station
.
isProcessing
:
if
not
self
.
endUnfinished
and
station
.
isProcessing
:
station
.
processOperatorUnavailable
.
succeed
(
self
.
env
.
now
)
station
.
processOperatorUnavailable
.
succeed
(
self
.
env
.
now
)
CoreObject
.
requestAllocation
()
# if the victim has interruptions that measure only the on-shift time, they have to be notified
# if the victim has interruptions that measure only the on-shift time, they have to be notified
for
oi
in
self
.
victim
.
objectInterruptions
:
for
oi
in
self
.
victim
.
objectInterruptions
:
...
@@ -142,14 +144,7 @@ class ShiftScheduler(ObjectInterruption):
...
@@ -142,14 +144,7 @@ class ShiftScheduler(ObjectInterruption):
succeedTuple
=
(
self
,
self
.
env
.
now
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
oi
.
victimOffShift
.
succeed
(
succeedTuple
)
oi
.
victimOffShift
.
succeed
(
succeedTuple
)
# if the victim is CoreObject interrupt it. Else ask the router for allocation of operators
# TODO more generic implementation
if
issubclass
(
self
.
victim
.
__class__
,
CoreObject
):
# interrupt the victim only if it was not previously interrupted
self
.
interruptVictim
()
# interrupt the victim
else
:
CoreObject
.
requestAllocation
()
self
.
victim
.
onShift
=
False
# get the victim off-shift
self
.
victim
.
onShift
=
False
# get the victim off-shift
self
.
victim
.
timeLastShiftEnded
=
self
.
env
.
now
self
.
victim
.
timeLastShiftEnded
=
self
.
env
.
now
self
.
outputTrace
(
self
.
victim
.
name
,
"is off shift"
)
self
.
outputTrace
(
self
.
victim
.
name
,
"is off shift"
)
...
...
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