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
d79769bd
Commit
d79769bd
authored
Sep 15, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction on how the router uses the solution of the assignment"
parent
1f79598b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
32 deletions
+15
-32
dream/simulation/SkilledOperatorRouter.py
dream/simulation/SkilledOperatorRouter.py
+15
-32
No files found.
dream/simulation/SkilledOperatorRouter.py
View file @
d79769bd
...
...
@@ -211,38 +211,21 @@ class SkilledRouter(Router):
# pendingStations/ available stations not yet given operator
self
.
pendingStations
=
[]
from
Globals
import
findObjectById
for
operator
in
solution
.
keys
():
for
resource
in
G
.
OperatorsList
:
if
resource
.
id
==
operator
:
station
=
findObjectById
(
solution
[
operator
])
station
.
operatorPool
.
operators
=
[
resource
]
resource
.
assignTo
(
station
)
self
.
toBeSignalled
.
append
(
station
)
i
=
0
for
op
in
self
.
availableOperatorList
:
if
op
==
resource
.
id
:
self
.
availableOperatorList
.
pop
(
i
)
break
i
+=
1
break
if
len
(
solution
)
!=
len
(
self
.
availableStations
):
from
Globals
import
findObjectById
for
station
in
self
.
availableStations
:
if
not
station
.
id
in
solution
.
keys
():
for
i
in
range
(
len
(
self
.
availableOperatorList
)):
for
resource
in
G
.
OperatorsList
:
if
resource
.
id
==
self
.
availableOperatorList
[
i
]:
candidate
=
resource
if
station
.
id
in
candidate
.
skillsList
:
operatorID
=
self
.
availableOperatorList
.
pop
(
i
)
break
#operator=findObjectById(operatorID)
for
resource
in
G
.
OperatorsList
:
if
resource
.
id
==
operatorID
:
operator
=
resource
station
.
operatorPool
.
operators
=
[
operator
]
operator
.
assignTo
(
station
)
self
.
toBeSignalled
.
append
(
station
)
# apply the solution
# loop through the entries in the solution dictionary
for
operatorID
in
solution
.
keys
():
# obtain the operator and the station
operator
=
findObjectById
(
operatorID
)
station
=
findObjectById
(
solution
[
operatorID
])
# update the operatorPool of the station
station
.
operatorPool
.
operators
=
[
operator
]
# assign the operator to the station
operator
.
assignTo
(
station
)
# append the station to the ones that are to be signalled
self
.
toBeSignalled
.
append
(
station
)
# remove the operator id from availableOperatorList
self
.
availableOperatorList
.
remove
(
operatorID
)
#===================================================================
# # XXX signal the stations that the assignment is complete
#===================================================================
...
...
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