Skip to content

Commit

Permalink
Fix off-by-one bug preventing the final SQM log for step 12000.
Browse files Browse the repository at this point in the history
Change trialsPerSQM() from 5 (yesterday's experiment) back to 10.
  • Loading branch information
cwreynolds committed Sep 26, 2023
1 parent 17e3bb2 commit d56fe72
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions EvoCamoGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ class EvoCamoGame
getPopulation()->evolutionStep([&]
(TournamentGroup tg)
{ return tournamentFunction(tg); });
setRunningState(getMaxSteps() > getStepCount());
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// TODO 20230926 fix off-by-one bug that prevented final SQM report
// setRunningState(getMaxSteps() > getStepCount());
setRunningState(getMaxSteps() >= getStepCount());
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}
// Delete Population instance.
setPopulation(nullptr);
Expand Down Expand Up @@ -2253,10 +2257,14 @@ class EvoCamoVsLppSqm : public EvoCamoVsLearnPredPop
std::cout << " **** "; debugPrint(count_new);
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// TODO 20230926 fix off-by-one bug that prevented final SQM report
// TODO 20230925 to reduce runtime cost. Hoping the already very noisy
// metric is still useful with half the samples.
// int trialsPerSQM() const { return 10; }
int trialsPerSQM() const { return 5; }
// int trialsPerSQM() const { return 5; }
int trialsPerSQM() const { return 10; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Set prey individual's SQM as the average of ten trials
void evaluateIndividualSQM(Individual& individual)
Expand Down

0 comments on commit d56fe72

Please sign in to comment.