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
b8adf350
Commit
b8adf350
authored
Oct 21, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments added
parent
06e7c3d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
dream/simulation/ShiftScheduler.py
dream/simulation/ShiftScheduler.py
+2
-0
No files found.
dream/simulation/ShiftScheduler.py
View file @
b8adf350
...
@@ -47,6 +47,7 @@ class ShiftScheduler(ObjectInterruption):
...
@@ -47,6 +47,7 @@ class ShiftScheduler(ObjectInterruption):
self
.
endUnfinished
=
endUnfinished
#flag that shows if half processed Jobs should end after the shift ends
self
.
endUnfinished
=
endUnfinished
#flag that shows if half processed Jobs should end after the shift ends
# if the end of shift is below this threshold then the victim is on shift but does not accept new entities
# if the end of shift is below this threshold then the victim is on shift but does not accept new entities
self
.
receiveBeforeEndThreshold
=
receiveBeforeEndThreshold
self
.
receiveBeforeEndThreshold
=
receiveBeforeEndThreshold
# flag that shows if the threshold time is counted as off-shift or waiting
self
.
thresholdTimeIsOnShift
=
thresholdTimeIsOnShift
self
.
thresholdTimeIsOnShift
=
thresholdTimeIsOnShift
# =======================================================================
# =======================================================================
...
@@ -105,6 +106,7 @@ class ShiftScheduler(ObjectInterruption):
...
@@ -105,6 +106,7 @@ class ShiftScheduler(ObjectInterruption):
else
:
else
:
timeToEndShift
=
float
(
self
.
remainingShiftPattern
[
0
][
1
]
-
self
.
env
.
now
)
timeToEndShift
=
float
(
self
.
remainingShiftPattern
[
0
][
1
]
-
self
.
env
.
now
)
yield
self
.
env
.
timeout
(
timeToEndShift
-
self
.
receiveBeforeEndThreshold
)
# wait until the entry threshold
yield
self
.
env
.
timeout
(
timeToEndShift
-
self
.
receiveBeforeEndThreshold
)
# wait until the entry threshold
# if threshold time is counted as onShift, then yield until the end of shift. Else, set as off-shift now
if
self
.
thresholdTimeIsOnShift
:
if
self
.
thresholdTimeIsOnShift
:
self
.
victim
.
isLocked
=
True
# lock the entry of the victim
self
.
victim
.
isLocked
=
True
# lock the entry of the victim
yield
self
.
env
.
timeout
(
self
.
receiveBeforeEndThreshold
)
# wait until the shift is over
yield
self
.
env
.
timeout
(
self
.
receiveBeforeEndThreshold
)
# wait until the shift is over
...
...
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