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
6ed6336d
Commit
6ed6336d
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
80b518d9
Changes
1
Show 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 @
6ed6336d
...
@@ -211,38 +211,21 @@ class SkilledRouter(Router):
...
@@ -211,38 +211,21 @@ class SkilledRouter(Router):
# pendingStations/ available stations not yet given operator
# pendingStations/ available stations not yet given operator
self
.
pendingStations
=
[]
self
.
pendingStations
=
[]
from
Globals
import
findObjectById
from
Globals
import
findObjectById
for
operator
in
solution
.
keys
():
# apply the solution
for
resource
in
G
.
OperatorsList
:
# loop through the entries in the solution dictionary
if
resource
.
id
==
operator
:
for
operatorID
in
solution
.
keys
():
station
=
findObjectById
(
solution
[
operator
])
# obtain the operator and the station
station
.
operatorPool
.
operators
=
[
resource
]
operator
=
findObjectById
(
operatorID
)
resource
.
assignTo
(
station
)
station
=
findObjectById
(
solution
[
operatorID
])
self
.
toBeSignalled
.
append
(
station
)
# update the operatorPool of the 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
]
station
.
operatorPool
.
operators
=
[
operator
]
# assign the operator to the station
operator
.
assignTo
(
station
)
operator
.
assignTo
(
station
)
# append the station to the ones that are to be signalled
self
.
toBeSignalled
.
append
(
station
)
self
.
toBeSignalled
.
append
(
station
)
# remove the operator id from availableOperatorList
self
.
availableOperatorList
.
remove
(
operatorID
)
#===================================================================
#===================================================================
# # XXX signal the stations that the assignment is complete
# # 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