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
a81d9c26
Commit
a81d9c26
authored
Sep 24, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Oct 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction in findStationsForOperators method of Router
parent
ffa8d1de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+6
-6
No files found.
dream/simulation/OperatorRouter.py
View file @
a81d9c26
...
...
@@ -354,12 +354,13 @@ class Router(ObjectInterruption):
#=======================================================================
def
sortOperators
(
self
):
if
self
.
candidateOperators
:
# calculate the time the operators have been waiting
for
op
in
self
.
candidateOperators
:
op
.
criterion
=
0
op
.
waitingTime
=
0
if
op
.
schedule
:
op
.
criterion
=
self
.
env
.
now
-
op
.
schedule
[
-
1
][
-
1
]
op
.
waitingTime
=
self
.
env
.
now
-
op
.
schedule
[
-
1
][
-
1
]
# sort according to the time they concluded their last operation
self
.
candidateOperators
.
sort
(
key
=
lambda
x
:
x
.
criterion
,
reverse
=
True
)
self
.
candidateOperators
.
sort
(
key
=
lambda
x
:
x
.
waitingTime
,
reverse
=
True
)
#===========================================================================
...
...
@@ -380,7 +381,7 @@ class Router(ObjectInterruption):
operator
.
candidateEntities
.
append
(
station
.
currentEntity
)
else
:
for
predecessor
in
station
.
previous
:
if
predecessor
in
self
.
pendingQueues
and
not
station
in
occupiedStations
:
if
predecessor
in
self
.
pendingQueues
and
not
station
in
occupiedStations
and
station
.
isInRoute
(
predecessor
)
:
if
predecessor
.
getActiveObjectQueue
()[
0
]
in
self
.
pending
\
and
not
predecessor
.
getActiveObjectQueue
()[
0
]
in
occupiedEntities
:
operator
.
candidateEntities
.
append
(
predecessor
.
getActiveObjectQueue
()[
0
])
...
...
@@ -392,11 +393,10 @@ class Router(ObjectInterruption):
if
operator
in
self
.
preemptiveOperators
:
operator
.
candidateEntities
.
sort
(
key
=
lambda
x
:
x
.
isCritical
,
reverse
=
True
)
# sort the candidate entities according to their responsible personnel
operator
.
candidateEntities
.
sort
(
key
=
lambda
x
:
x
.
responsibleForCurrentStep
()
==
operator
)
operator
.
candidateEntities
.
sort
(
key
=
lambda
x
:
x
.
responsibleForCurrentStep
()
==
operator
,
reverse
=
True
)
# pick an entity and a station
if
operator
.
candidateEntities
:
operator
.
candidateEntity
=
operator
.
candidateEntities
[
0
]
# if the entities currentStation is machine
if
operator
.
candidateEntity
.
currentStation
in
self
.
pendingMachines
:
operator
.
candidateStation
=
operator
.
candidateEntity
.
currentStation
...
...
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