Commit c821a097 authored by Georgios Dagkakis's avatar Georgios Dagkakis

set 0 score for ants that were only evaluated deterministically

parent 28f99cec
...@@ -212,10 +212,14 @@ class BatchesStochasticACO(BatchesACO): ...@@ -212,10 +212,14 @@ class BatchesStochasticACO(BatchesACO):
self.outputSheet.write(self.rowIndex,3,-ant['score']) self.outputSheet.write(self.rowIndex,3,-ant['score'])
self.rowIndex+=1 self.rowIndex+=1
# # for the ants that were not evaluated stochastically set score = 0 # for the ants that were not evaluated stochastically set score = 0
# antsNotEvaluatedStochastically=[x for x in uniqueAntsInThisGeneration if x not in antsForStochasticEvaluationInGeneration] for ant in antsInCurrentGeneration:
# for ant in antsNotEvaluatedStochastically: antEvaluatedStochastically=False
# ant['score']=0 for stochasticAnt in antsForStochasticEvaluationInGeneration:
if ant['key'] == stochasticAnt['key']:
antEvaluatedStochastically=True
if not antEvaluatedStochastically:
ant['score']=0
# if we had stochastic evaluation keep only those ants in sorting # if we had stochastic evaluation keep only those ants in sorting
if numberOfAntsForStochasticEvaluationInGeneration: if numberOfAntsForStochasticEvaluationInGeneration:
......
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