Update after the change in replacements

This commit is contained in:
evomarc 2000-12-19 18:43:25 +00:00
commit ed0e76350a
5 changed files with 18 additions and 21 deletions

View file

@ -218,8 +218,8 @@ void main_function(int argc, char **argv)
// REPLACE
// And we now have the full slection/replacement - though with
// no replacement (== generational replacement) at the moment :-)
eoNoReplacement<Indi> replace;
// the same generational replacement at the moment :-)
eoGenerationalReplacement<Indi> replace;
// OPERATORS
//////////////////////////////////////
@ -235,7 +235,7 @@ void main_function(int argc, char **argv)
// Combine them with relative rates
eoPropCombinedQuadOp<Indi> xover(xover1, onePointRate);
xover.add(xoverU, URate);
xover.add(xover2, twoPointsRate, eo_verbose);
xover.add(xover2, twoPointsRate, true);
// MUTATION
// standard bit-flip mutation for bitstring
@ -244,7 +244,7 @@ void main_function(int argc, char **argv)
eoDetBitFlip<Indi> mutationOneBit;
// Combine them with relative rates
eoPropCombinedMonOp<Indi> mutation(mutationBitFlip, bitFlipRate);
mutation.add(mutationOneBit, oneBitRate, eo_verbose);
mutation.add(mutationOneBit, oneBitRate, true);
// The operators are encapsulated into an eoTRansform object
eoSGATransform<Indi> transform(xover, pCross, mutation, pMut);
@ -294,7 +294,7 @@ void main_function(int argc, char **argv)
checkpoint.add(SecondStat);
// The Stdout monitor will print parameters to the screen ...
eoStdoutMonitor monitor(eo_no_verbose);
eoStdoutMonitor monitor(false);
// when called by the checkpoint (i.e. at every generation)
checkpoint.add(monitor);

View file

@ -203,10 +203,11 @@ void main_function(int argc, char **argv)
// OUTPUT
// sort pop for pretty printout
pop.sort();
// pop.sort();
// Print (sorted) intial population (raw printout)
cout << "Initial Population" << endl << pop << endl;
cout << "Initial Population" << endl << pop ;
cout << "and best is " << pop.best_element() << "\n\n";
cout << "and worse is " << pop.worse_element() << "\n\n";
// ENGINE
/////////////////////////////////////
// selection and replacement
@ -221,6 +222,7 @@ void main_function(int argc, char **argv)
// And we now have the full slection/replacement - though with
// no replacement (== generational replacement) at the moment :-)
eoNoReplacement<Indi> replace;
// eoWeakElitistReplacement<Indi> replace(replace_main);
// OPERATORS
//////////////////////////////////////