Commit 97ba4dcb authored by Georgios Dagkakis's avatar Georgios Dagkakis

batches ACO to set fill sub-line to zero

parent af83a2f2
...@@ -35,22 +35,32 @@ class BatchesACO(ACO): ...@@ -35,22 +35,32 @@ class BatchesACO(ACO):
# of options collated into a dictionary for ease of referencing in ManPy # of options collated into a dictionary for ease of referencing in ManPy
def createCollatedScenarios(self,data): def createCollatedScenarios(self,data):
collated = dict() collated = dict()
# fill sub-line deactivated (default to zero)
collated["4"]=[0.0]
weightData=data['input'].get('ACO_weights_spreadsheet', None) weightData=data['input'].get('ACO_weights_spreadsheet', None)
for i in range(1,7): for i in range(1,6):
# to deactivate fill sub-line the index of 4 is surpassed
if i<4:
index=str(i)
else:
index=str(i+1)
minValue=weightData[1][i] minValue=weightData[1][i]
maxValue=weightData[2][i] maxValue=weightData[2][i]
stepValue=weightData[3][i] stepValue=weightData[3][i]
staticValue=weightData[4][i] staticValue=weightData[4][i]
if staticValue: if staticValue:
collated[str(i)]=[float(staticValue)] collated[index]=[float(staticValue)]
else: else:
collated[str(i)]=[] collated[index]=[]
value=float(minValue) value=float(minValue)
while 1: while 1:
collated[str(i)].append(round(float(value),2)) collated[index].append(round(float(value),2))
value+=float(stepValue) value+=float(stepValue)
if value>float(maxValue): if value>float(maxValue):
break break
from pprint import pprint
pprint(collated)
return collated return collated
# creates the ant scenario based on what ACO randomly selected # creates the ant scenario based on what ACO randomly selected
......
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