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
e370619a
Commit
e370619a
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
ShiftScheduler update to work correctly if victim starts off-shif
parent
af2110cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
dream/simulation/ShiftScheduler.py
dream/simulation/ShiftScheduler.py
+2
-6
No files found.
dream/simulation/ShiftScheduler.py
View file @
e370619a
...
...
@@ -61,17 +61,13 @@ class ShiftScheduler(ObjectInterruption):
def
run
(
self
):
self
.
victim
.
totalOffShiftTime
=
0
self
.
victim
.
timeLastShiftEnded
=
self
.
env
.
now
# if in the beginning the victim is offShift
# if in the beginning the victim is offShift
set it as such
if
float
(
self
.
remainingShiftPattern
[
0
][
0
])
!=
self
.
env
.
now
:
self
.
victim
.
onShift
=
False
yield
self
.
env
.
timeout
(
float
(
self
.
remainingShiftPattern
[
0
][
1
]
-
self
.
env
.
now
))
# wait until the shift is over
self
.
interruptVictim
()
# interrupt processing operations if any
self
.
victim
.
onShift
=
False
# get the victim off-shift
self
.
victim
.
timeLastShiftEnded
=
self
.
env
.
now
self
.
outputTrace
(
"is off shift"
)
self
.
remainingShiftPattern
.
pop
(
0
)
while
1
:
if
not
self
.
victim
.
onShift
:
yield
self
.
env
.
timeout
(
float
(
self
.
remainingShiftPattern
[
0
][
0
]
-
self
.
env
.
now
))
# wait for the onShift
...
...
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