Commit a1a20c0b authored by Georgios Dagkakis's avatar Georgios Dagkakis

do not crash in case of zero throughput

parent c821a097
......@@ -45,6 +45,8 @@ class BatchesStochasticACO(BatchesACO):
#id the class is Exit get the unitsThroughput
if element_family == 'Exit':
unitsThroughput=element['results'].get('unitsThroughput',None)
if not unitsThroughput:
unitsThroughput=element['results']['throughput']
# below checking the predecessors of exit. If a predecessor is reassembly and
# has WIP add this also in the throughput
for objectId in self.getPredecessors(ant['input'], element['id']):
......@@ -175,12 +177,6 @@ class BatchesStochasticACO(BatchesACO):
self.outputSheet.write(self.rowIndex,3,-ant['score'])
self.rowIndex+=1
# for ant in scenario_list:
# ant['score'] = self._calculateAntScore(ant)
# self.outputSheet.write(self.rowIndex,0,'Units Throughput')
# self.outputSheet.write(self.rowIndex,1,-ant['score'])
# self.rowIndex+=1
ants.extend(scenario_list)
antsInCurrentGeneration.extend(scenario_list)
......
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