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): ...@@ -139,12 +139,19 @@ class SkilledRouter(Router):
#=================================================================== #===================================================================
for station in self.availableStations: for station in self.availableStations:
station.wip=1+(len(station.getActiveObjectQueue())/station.capacity) station.wip=1+(len(station.getActiveObjectQueue())/station.capacity)
for predecessor in station.previous: current_object = station
try: capacity = station.capacity
station.wip+=float(len(predecessor.getActiveObjectQueue())/float(predecessor.capacity)) while 1:
except: # XXX this is assuming only one predecessor
# XXX what happens in the case of sources or infinite-capacity-queues current_object = current_object.previous[0]
pass 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 # # 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