Skip to content

Commit

Permalink
WIP to formalize the ad hoc code for SQM (static quality metric).
Browse files Browse the repository at this point in the history
Change main() to do runtime dispatch based on new use_static_quality_metric.
Change trialsPerSQM() from 10 to 5.
  • Loading branch information
cwreynolds committed Sep 25, 2023
1 parent 9a9ed4a commit 17e3bb2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
12 changes: 11 additions & 1 deletion EvoCamoGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
// This class is the top level "main()" for unix-style command evo_camo_game.
// See doc: https://cwreynolds.github.io/TexSyn/evo_camo_game_doc.html
//
// The code in this file became the paper:
//
// Craig Reynolds. 2023. Coevolution of Camouflage. 2023 Artificial Life
// Conference. MIT Press. https://doi.org/10.1162/isal_a_00583
// Preprint with supplemental materials and high resolution images:
// https://arxiv.org/abs/2304.11793
//
// Prototyping inside TexSyn, maybe should be its own library/git repository.
//
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -2246,7 +2253,10 @@ class EvoCamoVsLppSqm : public EvoCamoVsLearnPredPop
std::cout << " **** "; debugPrint(count_new);
}

int trialsPerSQM() const { return 10; }
// 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; }

// Set prey individual's SQM as the average of ten trials
void evaluateIndividualSQM(Individual& individual)
Expand Down
20 changes: 12 additions & 8 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ int main(int argc, const char * argv[])
exit_code = EXIT_SUCCESS;
std::cout << "September 22, 2023" << std::endl;
auto cmd = CommandLine(argc, argv);

// Run Coevolution of Camouflage, specifically "EvoCamoVsLearnPredPop",
// the version which pits evolutionary camouflage against a population
// of learning predators.
// (As used in earlier experiments. See here: https://bit.ly/3sV0bUt)
EvoCamoVsLearnPredPop(cmd).run(); // Normal COC run.
// EvoCamoVsLppSqm(cmd).run(); // Include SQM, runs much slower

// If no command line arguments run various_examples() as proof of life.
// of learning predators. (Code fragments below based on experiments run
// between October 2022 and March 2023. See: https://bit.ly/3sV0bUt)
bool use_static_quality_metric = true;
if (use_static_quality_metric)
{
EvoCamoVsLppSqm(cmd).run(); // Include SQM, runs much slower
}
else
{
EvoCamoVsLearnPredPop(cmd).run(); // Normal COC run, about 6 hours.
}
// If no cmd line arguments, run various_examples() as "proof of life."
if (cmd.parsedTokens().size() == 1)
{
exit_code = EXIT_FAILURE;
Expand All @@ -44,7 +49,6 @@ int main(int argc, const char * argv[])
return exit_code;
}


//------------------------------------------------------------------------------
// Usage notes for running Coevolution of Camouflage from the command line.
//------------------------------------------------------------------------------
Expand Down

0 comments on commit 17e3bb2

Please sign in to comment.