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
9c343788
Commit
9c343788
authored
Sep 18, 2014
by
Ioannis Papagiannopoulos
Committed by
Jérome Perrin
Feb 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
findCandidateStation updated
parent
bbe187ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
dream/simulation/Operator.py
dream/simulation/Operator.py
+8
-5
No files found.
dream/simulation/Operator.py
View file @
9c343788
...
...
@@ -93,6 +93,7 @@ class Operator(ObjectResource):
self
.
totalOffShiftTime
=
0
#holds the total off-shift time
self
.
timeLastShiftStarted
=
0
#holds the time that the last shift of the object started
self
.
timeLastShiftEnded
=
0
#holds the time that the last shift of the object ended
self
.
candidateStation
=
None
#holds the candidate receiver of the entity the resource will work on - used by router
@
staticmethod
def
getSupportedSchedulingRules
():
...
...
@@ -138,11 +139,13 @@ class Operator(ObjectResource):
def
findCandidateStation
(
self
):
from
Globals
import
G
router
=
G
.
Router
candidateStation
=
next
(
x
for
x
in
self
.
candidateStations
if
not
x
in
router
.
conflictingStations
)
if
not
router
.
sorting
:
if
not
candidateStation
:
candidateStation
=
next
(
x
for
x
in
self
.
candidateStations
)
router
.
conflictingStations
.
append
(
candidateStation
)
candidateStation
=
None
possibleReceivers
=
[
x
for
x
in
self
.
candidateStations
if
not
x
in
router
.
conflictingStations
and
not
x
in
router
.
getReceivers
()]
if
possibleReceivers
:
candidateStation
=
next
(
x
for
x
in
possibleReceivers
)
if
not
candidateStation
:
candidateStation
=
next
(
x
for
x
in
self
.
candidateStations
)
router
.
conflictingStations
.
append
(
candidateStation
)
return
candidateStation
#===========================================================================
...
...
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