Commit 50a4e123 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Fixup wip calculation in SkilledOperatorRouter. Still not full solution

parent 289bba8d
......@@ -139,12 +139,19 @@ class SkilledRouter(Router):
#===================================================================
for station in self.availableStations:
station.wip=1+(len(station.getActiveObjectQueue())/station.capacity)
for predecessor in station.previous:
try:
station.wip+=float(len(predecessor.getActiveObjectQueue())/float(predecessor.capacity))
except:
# XXX what happens in the case of sources or infinite-capacity-queues
pass
current_object = station
capacity = station.capacity
while 1:
# XXX this is assuming only one predecessor
current_object = current_object.previous[0]
class_name = current_object.__class__.__name__
if class_name == 'BatchSource':
break
station.wip+=float(
len(current_object.getActiveObjectQueue())/float(capacity)
)
if class_name in ('Queue', 'LineClearance', 'RoutingQueue'):
break
#===================================================================
# # stations of the line and their corresponding WIP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment