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
be502b94
Commit
be502b94
authored
Jul 23, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the wip for each station is calculated differently
parent
9a04b0d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
dream/simulation/SkilledOperatorRouter.py
dream/simulation/SkilledOperatorRouter.py
+27
-15
No files found.
dream/simulation/SkilledOperatorRouter.py
View file @
be502b94
...
...
@@ -149,21 +149,27 @@ class SkilledRouter(Router):
# # XXX calculate the WIP of each station
#===================================================================
for
station
in
self
.
availableStations
:
station
.
wip
=
0
# station.wip=0
station
.
wip
=
1
+
(
len
(
station
.
getActiveObjectQueue
())
/
station
.
capacity
)
for
predecessor
in
station
.
previous
:
predecessor
.
remainingWip
=
0
if
len
(
predecessor
.
next
)
>
1
:
nextNo
=
len
(
predecessor
.
next
)
for
obj
in
predecessor
.
next
:
if
not
obj
in
self
.
availableStations
:
nextNo
-=
1
station
.
wip
=
int
(
round
(
len
(
predecessor
.
getActiveObjectQueue
())
/
nextNo
))
predecessor
.
remainingWip
=
len
(
predecessor
.
getActiveObjectQueue
())
%
nextNo
for
buffer
in
G
.
QueueList
:
if
buffer
.
remainingWip
:
nextObj
=
next
(
x
for
x
in
buffer
.
next
if
x
in
self
.
availableStations
)
# pick the first of the list available
nextObj
.
wip
+=
buffer
.
remainingWip
buffer
.
remainingWip
=
0
# predecessor.remainingWip=0
# if len(predecessor.next)>1:
# nextNo=len(predecessor.next)
# for obj in predecessor.next:
# if not obj in self.availableStations:
# nextNo-=1
try
:
station
.
wip
+=
float
(
len
(
predecessor
.
getActiveObjectQueue
())
/
predecessor
.
capacity
)
except
:
# XXX what happens in the case of sources or infinite-capacity-queues
pass
print
station
.
id
,
station
.
wip
# predecessor.remainingWip=len(predecessor.getActiveObjectQueue()) % nextNo
# for buffer in G.QueueList:
# if buffer.remainingWip:
# nextObj=next(x for x in buffer.next if x in self.availableStations) # pick the first of the list available
# nextObj.wip+=buffer.remainingWip
# buffer.remainingWip=0
#===================================================================
# # stations of the line and their corresponding WIP
# TODO: the WIP of the stations must be normalised to the max WIP possible on that station
...
...
@@ -195,6 +201,7 @@ class SkilledRouter(Router):
# XXX assign the operators to operatorPools
# 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
:
...
...
@@ -202,7 +209,12 @@ class SkilledRouter(Router):
station
.
operatorPool
.
operators
=
[
resource
]
resource
.
assignTo
(
station
)
self
.
toBeSignalled
.
append
(
station
)
self
.
availableOperatorList
.
pop
(
resource
)
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
...
...
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