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
fd87bbb3
Commit
fd87bbb3
authored
Jun 06, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jun 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments added
parent
3869c130
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
dream/simulation/Machine.py
dream/simulation/Machine.py
+4
-0
dream/simulation/ShiftScheduler.py
dream/simulation/ShiftScheduler.py
+2
-0
No files found.
dream/simulation/Machine.py
View file @
fd87bbb3
...
...
@@ -528,13 +528,17 @@ class Machine(CoreObject):
self
.
completedJobs
+=
1
# Machine completed one more Job
# reseting the shouldPreempt flag
self
.
shouldPreempt
=
False
# in case Machine just performed the last work before end of shift it should signal the ShiftScheduler
if
self
.
isWorkingOnTheLastBeforeOffShift
:
# find the ShiftSchedulerList
mySS
=
None
for
SS
in
G
.
ShiftSchedulerList
:
if
SS
.
victim
==
self
:
mySS
=
SS
break
# set the signal
mySS
.
victimEndedLastProcessing
.
succeed
()
# reset the flag
self
.
isWorkingOnTheLastBeforeOffShift
=
False
# =======================================================================
...
...
dream/simulation/ShiftScheduler.py
View file @
fd87bbb3
...
...
@@ -84,6 +84,8 @@ class ShiftScheduler(ObjectInterruption):
startShift
=
self
.
env
.
now
else
:
yield
self
.
env
.
timeout
(
float
(
self
.
remainingShiftPattern
[
0
][
1
]
-
self
.
env
.
now
))
# wait until the shift is over
# if the mode is to end current work before going off-shift and there is current work, wait for victimEndedLastProcessing
# signal before going off-shift
if
self
.
endUnfinished
and
len
(
self
.
victim
.
getActiveObjectQueue
())
==
1
and
(
not
self
.
victim
.
waitToDispose
):
self
.
victim
.
isWorkingOnTheLastBeforeOffShift
=
True
yield
self
.
victimEndedLastProcessing
...
...
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