Skip to content

Commit

Permalink
refactor(tests): reduce runtime for foundry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jdreo committed Sep 11, 2024
1 parent cf086ea commit db24e61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions eo/test/t-eoAlgoFoundryFastGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(int /*argc*/, char** /*argv*/)

/***** Crossovers ****/
foundry.crossovers.add< eo1PtBitXover<EOT> >();
foundry.crossovers.add< eoUBitXover<EOT> >(0.5); // preference over 1
// foundry.crossovers.add< eoUBitXover<EOT> >(0.5); // preference over 1
for(size_t i=1; i < 11; i+=4) {
foundry.crossovers.add< eoNPtsBitXover<EOT> >(i); // nb of points
}
Expand All @@ -43,26 +43,26 @@ int main(int /*argc*/, char** /*argv*/)
std::ref(foundry.mutation_selectors) }) {

ops.add< eoRandomSelect<EOT> >();
ops.add< eoStochTournamentSelect<EOT> >(0.5);
ops.add< eoSequentialSelect<EOT> >();
ops.add< eoProportionalSelect<EOT> >();
// ops.add< eoStochTournamentSelect<EOT> >(0.5);
// ops.add< eoSequentialSelect<EOT> >();
// ops.add< eoProportionalSelect<EOT> >();
for(size_t i=2; i < 10; i+=4) {
ops.add< eoDetTournamentSelect<EOT> >(i);
}
}

/***** Replacements ****/
foundry.replacements.add< eoCommaReplacement<EOT> >();
foundry.replacements.add< eoPlusReplacement<EOT> >();
foundry.replacements.add< eoSSGAWorseReplacement<EOT> >();
foundry.replacements.add< eoSSGAStochTournamentReplacement<EOT> >(0.51);
// foundry.replacements.add< eoPlusReplacement<EOT> >();
// foundry.replacements.add< eoSSGAWorseReplacement<EOT> >();
// foundry.replacements.add< eoSSGAStochTournamentReplacement<EOT> >(0.51);
for(size_t i=2; i < 10; i+=4) {
foundry.replacements.add< eoSSGADetTournamentReplacement<EOT> >(i);
}

/***** Continuators ****/
for(size_t i=10; i < 30; i+=10 ) {
foundry.continuators.add< eoSteadyFitContinue<EOT> >(10,i);
for(size_t i=3; i < 5; i+=1 ) {
foundry.continuators.add< eoGenContinue<EOT> >(i);
}


Expand Down
2 changes: 1 addition & 1 deletion eo/test/t-forge-FastGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main(int /*argc*/, char** /*argv*/)
eoBooleanGenerator gen(0.5);
eoInitFixedLength<EOT> init(dim, gen);

eoGenContinue<EOT> common_cont(100);
eoGenContinue<EOT> common_cont(5);

eoForgeVector< eoContinue<EOT> > continuators;
continuators.add< eoSteadyFitContinue<EOT> >(10,10);
Expand Down

0 comments on commit db24e61

Please sign in to comment.