Commit c821a097 authored by Georgios Dagkakis's avatar Georgios Dagkakis

set 0 score for ants that were only evaluated deterministically

parent 28f99cec
......@@ -212,11 +212,15 @@ class BatchesStochasticACO(BatchesACO):
self.outputSheet.write(self.rowIndex,3,-ant['score'])
self.rowIndex+=1
# # 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 antsNotEvaluatedStochastically:
# ant['score']=0
# for the ants that were not evaluated stochastically set score = 0
for ant in antsInCurrentGeneration:
antEvaluatedStochastically=False
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 numberOfAntsForStochasticEvaluationInGeneration:
uniqueAntsInThisGeneration = dict()
......
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