From 04e429fdb1061039f25c11d4c4212f465e99500a Mon Sep 17 00:00:00 2001 From: evomarc Date: Tue, 2 Jan 2001 07:03:57 +0000 Subject: [PATCH] I had to change the whole way the parameters are read, because EGCS did not allow the nice constructs I had imagined (and compiled with g++) - I removed the createParam method in Parser class - that was creating the parameters on the heap. Not allowed to have a templatized method ??? - I removed the subroutine read_param in SecondBitEA, as you need to create permanent parameters (eoParser only holds references), and egcs did not allow to create them by reference, i.e. in the line eoValueParam & blablaParam(...); So now everything is done in the main_function, and 3 lines are needed to create and read every paramter (sigh ...) --- eo/tutorial/Lesson3/SecondBitEA.cpp | 151 ++++------- eo/tutorial/html/SecondBitEA.html | 398 +++++++++++++--------------- 2 files changed, 231 insertions(+), 318 deletions(-) diff --git a/eo/tutorial/Lesson3/SecondBitEA.cpp b/eo/tutorial/Lesson3/SecondBitEA.cpp index 6b9743bc..8a208e0d 100644 --- a/eo/tutorial/Lesson3/SecondBitEA.cpp +++ b/eo/tutorial/Lesson3/SecondBitEA.cpp @@ -23,6 +23,11 @@ // define your genotype and fitness types typedef eoBin Indi; +// PARAMETRES + +// the main_function: nothing changed(!), except variable initialization +void main_function(int argc, char **argv) +{ // PARAMETRES //----------------------------------------------------------------------------- // instead of having all values of useful parameters as constants, read them: @@ -31,147 +36,99 @@ typedef eoBin Indi; // # = usual comment character // or in the environment (TODO) -// note that the parameters are passed by reference so they can be updated -void read_param(eoParser & _parser, - uint32 & _seed, - unsigned int & _vecSize, - unsigned int & _popSize, - unsigned int & _tSize, - double & _pCross, - double & _pMut, - string & _load_name, - unsigned int & _maxGen, - unsigned int & _minGen, - unsigned int & _steadyGen, - double & _onePointRate, - double & _twoPointsRate, - double & _uRate, - double & _pMutPerBit, - double & _bitFlipRate, - double & _oneBitRate - ) -{ + // First define a parser from the command-line arguments + eoParser parser(argc, argv); + // For each parameter, define Parameter, read it through the parser, // and assign the value to the variable + eoValueParam seedParam(time(0), "seed", "Random number seed", 'S'); - _parser.processParam( seedParam ); - _seed = seedParam.value(); + parser.processParam( seedParam ); + unsigned seed = seedParam.value(); + // description of genotype eoValueParam vecSizeParam(8, "vecSize", "Genotype size",'V'); - _parser.processParam( vecSizeParam, "Representation" ); - _vecSize = vecSizeParam.value(); + parser.processParam( vecSizeParam, "Representation" ); + unsigned vecSize = vecSizeParam.value(); + // parameters for evolution engine eoValueParam popSizeParam(10, "popSize", "Population size",'P'); - _parser.processParam( popSizeParam, "Evolution engine" ); - _popSize = popSizeParam.value(); + parser.processParam( popSizeParam, "Evolution engine" ); + unsigned popSize = popSizeParam.value(); eoValueParam tSizeParam(10, "tSize", "Tournament size",'T'); - _parser.processParam( tSizeParam, "Evolution Engine" ); - _tSize = tSizeParam.value(); + parser.processParam( tSizeParam, "Evolution Engine" ); + unsigned tSize = tSizeParam.value(); + // init and stop eoValueParam loadNameParam("", "Load","A save file to restart from",'L'); - _parser.processParam( loadNameParam, "Persistence" ); - _load_name = loadNameParam.value(); + parser.processParam( loadNameParam, "Persistence" ); + string loadName = loadNameParam.value(); eoValueParam maxGenParam(100, "maxGen", "Maximum number of generations",'G'); - _parser.processParam( maxGenParam, "Stopping criterion" ); - _maxGen = maxGenParam.value(); + parser.processParam( maxGenParam, "Stopping criterion" ); + unsigned maxGen = maxGenParam.value(); eoValueParam minGenParam(100, "minGen", "Minimum number of generations",'g'); - _parser.processParam( minGenParam, "Stopping criterion" ); - _minGen = minGenParam.value(); + parser.processParam( minGenParam, "Stopping criterion" ); + unsigned minGen = minGenParam.value(); eoValueParam steadyGenParam(100, "steadyGen", "Number of generations with no improvement",'s'); - _parser.processParam( steadyGenParam, "Stopping criterion" ); - _steadyGen = steadyGenParam.value(); + parser.processParam( steadyGenParam, "Stopping criterion" ); + unsigned steadyGen = steadyGenParam.value(); + // operators probabilities at the algorithm level eoValueParam pCrossParam(0.6, "pCross", "Probability of Crossover", 'C'); - _parser.processParam( pCrossParam, "Genetic Operators" ); - _pCross = pCrossParam.value(); + parser.processParam( pCrossParam, "Genetic Operators" ); + double pCross = pCrossParam.value(); eoValueParam pMutParam(0.1, "pMut", "Probability of Mutation", 'M'); - _parser.processParam( pMutParam, "Genetic Operators" ); - _pMut = pMutParam.value(); + parser.processParam( pMutParam, "Genetic Operators" ); + double pMut = pMutParam.value(); + // relative rates for crossovers eoValueParam onePointRateParam(1, "onePointRate", "Relative rate for one point crossover", '1'); - _parser.processParam( onePointRateParam, "Genetic Operators" ); - _onePointRate = onePointRateParam.value(); + parser.processParam( onePointRateParam, "Genetic Operators" ); + double onePointRate = onePointRateParam.value(); eoValueParam twoPointsRateParam(1, "twoPointRate", "Relative rate for two point crossover", '2'); - _parser.processParam( twoPointsRateParam, "Genetic Operators" ); - _twoPointsRate = twoPointsRateParam.value(); + parser.processParam( twoPointsRateParam, "Genetic Operators" ); + double twoPointsRate = twoPointsRateParam.value(); eoValueParam uRateParam(2, "uRate", "Relative rate for uniform crossover", 'U'); - _parser.processParam( uRateParam, "Genetic Operators" ); - _uRate = uRateParam.value(); + parser.processParam( uRateParam, "Genetic Operators" ); + double URate = uRateParam.value(); + // relative rates and private parameters for mutations; eoValueParam pMutPerBitParam(0.01, "pMutPerBit", "Probability of flipping 1 bit in bit-flip mutation", 'b'); - _parser.processParam( pMutPerBitParam, "Genetic Operators" ); - _pMutPerBit = pMutPerBitParam.value(); + parser.processParam( pMutPerBitParam, "Genetic Operators" ); + double pMutPerBit = pMutPerBitParam.value(); eoValueParam bitFlipRateParam(0.01, "bitFlipRate", "Relative rate for bit-flip mutation", 'B'); - _parser.processParam( bitFlipRateParam, "Genetic Operators" ); - _bitFlipRate = bitFlipRateParam.value(); + parser.processParam( bitFlipRateParam, "Genetic Operators" ); + double bitFlipRate = bitFlipRateParam.value(); eoValueParam oneBitRateParam(0.01, "oneBitRate", "Relative rate for deterministic bit-flip mutation", 'D'); - _parser.processParam( oneBitRateParam, "Genetic Operators" ); - _oneBitRate = oneBitRateParam.value(); + parser.processParam( oneBitRateParam, "Genetic Operators" ); + double oneBitRate = oneBitRateParam.value(); // the name of the "status" file where all actual parameter values will be saved - string str_status = _parser.ProgramName() + ".status"; + string str_status = parser.ProgramName() + ".status"; // default value eoValueParam statusParam(str_status.c_str(), "status","Status file",'S'); - _parser.processParam( statusParam, "Persistence" ); + parser.processParam( statusParam, "Persistence" ); // do the following AFTER ALL PARAMETERS HAVE BEEN PROCESSED // i.e. in case you need parameters somewhere else, postpone these - if (_parser.userNeedsHelp()) + if (parser.userNeedsHelp()) { - _parser.printHelp(cout); + parser.printHelp(cout); exit(1); } if (statusParam.value() != "") { ofstream os(statusParam.value().c_str()); - os << _parser; // and you can use that file as parameter file + os << parser; // and you can use that file as parameter file } -} - -// GENERAL -// now the main_function: nothing changed, except input/output -void main_function(int argc, char **argv) -{ -// PARAMETRES - uint32 seed; - // decription of genotype - unsigned int vecSize; - // parameters for evolution engine - unsigned int popSize; - unsigned int tSize; - // operators probabilities at the algorithm level - double pCross; - double pMut; - // init and stop - string load_name; - unsigned int maxGen; - unsigned int minGen; - unsigned int steadyGen; - // rates for crossovers - double onePointRate; - double twoPointsRate; - double URate; - // rates and private parameters for mutations; - double pMutPerBit; - double bitFlipRate; - double oneBitRate; - - // define a parser from the command-line arguments - eoParser parser(argc, argv); - - // Now read the parameters of the program - read_param(parser, seed, vecSize, popSize, tSize, - pCross, pMut, load_name, maxGen, minGen, steadyGen, - onePointRate, twoPointsRate, URate, - pMutPerBit, bitFlipRate, oneBitRate ); // EVAL ///////////////////////////// @@ -197,9 +154,9 @@ void main_function(int argc, char **argv) inState.registerObject(rng); inState.registerObject(pop); - if (load_name != "") + if (loadName != "") { - inState.load(load_name); // load the pop and the rng + inState.load(loadName); // load the pop and the rng // the fitness is read in the file: // do only evaluate the pop if the fitness has changed } diff --git a/eo/tutorial/html/SecondBitEA.html b/eo/tutorial/html/SecondBitEA.html index e761dc8d..d64f450b 100644 --- a/eo/tutorial/html/SecondBitEA.html +++ b/eo/tutorial/html/SecondBitEA.html @@ -4,12 +4,14 @@ SecondBitEA.cpp - + Back to Lesson 3 - Tutorial main page - Algorithm-Based - Component-Based - - Programming hints - EO +- +Programming +hints - EO documentation

@@ -46,14 +48,15 @@ cout
istrstream
#include <fstream>
// the general include for eo -
#include <eo> +
#include <eo> - +
// a simple fitness function that computes the number of ones of a bitstring
-#include "binary_value.h"
// a simple fitness function that computes +the number of ones of a bitstring +
#include "binary_value.h"
@@ -64,6 +67,15 @@ istrstream
typedef eoBin<double> Indi; + + + + + +
// the main_function: nothing changed(!), +except variable initialization +
void main_function(int argc, char **argv) +
{
@@ -78,190 +90,130 @@ or in a parameter file (same syntax, order independent,  # = usual comment character 
//        or in the environment (TODO) -
// note that the parameters are passed by -reference so they can be updated -
void read_param(eoParser & _parser,  -
uint32 & -_seed, -
unsigned int & _vecSize, -
unsigned int & _popSize, -
unsigned int & _tSize, -
double & _pCross, -
double & _pMut, -
string & _load_name, -
unsigned int & _maxGen, -
unsigned int & _minGen, -
unsigned int & _steadyGen, -
double & _onePointRate,  -
double & _twoPointsRate,  -
double & _uRate,  -
double & _pMutPerBit,  -
double & _bitFlipRate,  -
double & _oneBitRate -
) -
-
     // For each -parameter, define Parameters directly in the parser,  -
     // and assign -the value to the variable -
    -eoValueParam<uint32>& seedParam = _parser.createParam<uint32>(time(0), +

// First define a parser from the command-line +arguments +
eoParser parser(argc, argv); +

// For each parameter, define Parameter, read +it through the parser, +
// and assign the value to the variable +
+
eoValueParam<uint32> seedParam(time(0), "seed", "Random number seed", 'S'); -
     -_seed = seedParam.value(); -

     eoValueParam<unsigned -int>& vecSizeParam = _parser.createParam<unsigned int>(8, "vecSize", -"Genotype size",'V', "Representation"); -
     _vecSize = vecSizeParam.value(); -

     eoValueParam<unsigned -int>& popSizeParam = _parser.createParam<unsigned int>(10, "popSize", -"Population size",'P', "Evolution"); -
     _popSize = popSizeParam.value(); -
     eoValueParam<unsigned -int>& tSizeParam = _parser.createParam<unsigned int>(10, "tSize", -"Tournament size",'T', "Evolution"); -
     _tSize = tSizeParam.value(); +
parser.processParam( seedParam ); +
unsigned seed += seedParam.value(); +

// decription +of genotype +
eoValueParam<unsigned int>& vecSizeParam(8, +"vecSize", "Genotype size",'V'); +
parser.processParam( vecSizeParam, "Representation" +); +
unsigned vecSize = vecSizeParam.value(); +

// parameters for evolution engine +
eoValueParam<unsigned int>& popSizeParam(10, +"popSize", "Population size",'P'); +
parser.processParam( popSizeParam, "Evolution +engine" ); +
unsigned popSize = popSizeParam.value(); +

eoValueParam<unsigned int>& tSizeParam(10, +"tSize", "Tournament size",'T'); +
parser.processParam( seedParam ); +
unsigned tSize = tSizeParam.value();
-
    eoValueParam<string>& -load_nameParam = _parser.createParam<string>("", "Load","A save file -to restart from",'L', "Persistence"); -
     _load_name = -load_nameParam.value(); -

     eoValueParam<unsigned -int>& maxGenParam = _parser.createParam<unsigned int>(100, "maxGen", -"Maximum number of generations",'G', "Stopping criterion"); -
     _maxGen = maxGenParam.value(); -
     eoValueParam<unsigned -int>& minGenParam = _parser.createParam<unsigned int>(100, "minGen", -"Minimum number of generations",'g', "Stopping criterion"); -
     _minGen = minGenParam.value(); -
     eoValueParam<unsigned -int>& steadyGenParam = _parser.createParam<unsigned int>(100, "steadyGen", -"Number of generations with no improvement",'s', "Stopping criterion"); -
     _steadyGen = -steadyGenParam.value(); -

     eoValueParam<double>& -pCrossParam = _parser.createParam<double>(0.6, "pCross", "Probability -of Crossover", 'C', "Genetic Operators");  -
     _pCross = pCrossParam.value(); -
     eoValueParam<double>& -pMutParam = _parser.createParam<double>(0.1, "pMut", "Probability of -Mutation", 'M', "Genetic Operators"); -
     _pMut = pMutParam.value(); -
     eoValueParam<double>& -onePointRateParam = _parser.createParam<double>(1, "onePointRate", "Relative -rate for one point crossover", '1', "Genetic Operators"); -
     _onePointRate -= onePointRateParam.value(); -
     eoValueParam<double>& -twoPointsRateParam = _parser.createParam<double>(1, "twoPointRate", "Relative -rate for two point crossover", '2', "Genetic Operators"); -
     _twoPointsRate -= twoPointsRateParam.value(); -
     eoValueParam<double>& -uRateParam = _parser.createParam<double>(2, "uRate", "Relative rate for -uniform crossover", 'U', "Genetic Operators"); -
     _uRate =  -uRateParam.value(); -
     eoValueParam<double>& -pMutPerBitParam = _parser.createParam<double>(0.01, "pMutPerBit", "Probability -of flipping 1 bit in bit-flip mutation", 'b', "Genetic Operators"); -
     _pMutPerBit = -pMutPerBitParam.value(); -
     eoValueParam<double>& -bitFlipRateParam = _parser.createParam<double>(0.01, "bitFlipRate", "Relative -rate for bit-flip mutation", 'B', "Genetic Operators"); -
     _bitFlipRate -=  bitFlipRateParam.value(); -
     eoValueParam<double>& -oneBitRateParam = _parser.createParam<double>(0.01, "oneBitRate", "Relative -rate for deterministic bit-flip mutation", 'D', "Genetic Operators"); -
         -_oneBitRate = oneBitRateParam.value(); -

     // the name -of the "status" file where all actual parameter values will be saved -
     string str_status -= _parser.ProgramName() + ".status"; -
     eoValueParam<string>& -status_nameParam = _parser.createParam<string>(str_status.c_str(), "status","Status -file",'S', "Persistence"); -
   // do the following AFTER -ALL PARAMETERS HAVE BEEN PROCESSED -
   // i.e. in case you need -parameters somewhere else, postpone these -
     if (_parser.userNeedsHelp()) -
         -{ -
             -_parser.printHelp(cout); -
             -exit(1); -
         -} -
     if (status_nameParam.value() -!= "") -
         -{ -
ofstream os(status_nameParam.value().c_str()); -
os << _parser; // and you can -use that file as parameter file -
         -} -
} -

-
- - - - - -
// now the main_function: nothing changed, -except input/output -
void main_function(int argc, char **argv) -
{
- - - - +
eoValueParam<string> loadNameParam("", +"Load","A save file to restart from",'L'); +
parser.processParam( loadNameParam, "Persistence" +); +
string loadName = loadNameParam.value(); +

eoValueParam<unsigned int> maxGenParam(100, +"maxGen", "Maximum number of generations",'G'); +
parser.processParam( maxGenParam, "Stopping +criterion" ); +
unsigned maxGen = maxGenParam.value(); +

eoValueParam<unsigned int> minGenParam(100, +"minGen", "Minimum number of generations",'g'); +
parser.processParam( minGenParam, "Stopping +criterion" ); +
unsigned minGen = minGenParam.value(); +

eoValueParam<unsigned int> steadyGenParam(100, +"steadyGen", "Number of generations with no improvement",'s'); +
parser.processParam( steadyGenParam, "Stopping +criterion" ); +
unsigned steadyGen = steadyGenParam.value(); +

// operators probabilities at the algorithm +level +
eoValueParam<double> pCrossParam(0.6, +"pCross", "Probability of Crossover", 'C');  +
parser.processParam( pCrossParam, "Genetic +Operators" ); +
double pCross = pCrossParam.value(); +

eoValueParam<double> pMutParam(0.1, +"pMut", "Probability of Mutation", 'M'); +
parser.processParam( pMutParam, "Genetic +Operators" ); +
double pMut = pMutParam.value(); +

// relative rates for crossovers +
eoValueParam<double> onePointRateParam(1, +"onePointRate", "Relative rate for one point crossover", '1'); +
parser.processParam( onePointRateParam, +"Genetic Operators" ); +
double onePointRate = onePointRateParam.value(); +

eoValueParam<double> twoPointsRateParam(1, +"twoPointRate", "Relative rate for two point crossover", '2'); +
parser.processParam( twoPointsRateParam, +"Genetic Operators" ); +
double twoPointsRate = twoPointsRateParam.value(); +

eoValueParam<double> uRateParam(2, "uRate", +"Relative rate for uniform crossover", 'U'); +
parser.processParam( uRateParam, "Genetic +Operators" ); +
double URate =  uRateParam.value(); +

// relative rates and private parameters for +mutations; +
eoValueParam<double> pMutPerBitParam(0.01, +"pMutPerBit", "Probability of flipping 1 bit in bit-flip mutation", 'b'); +
parser.processParam( pMutPerBitParam, +"Genetic Operators" ); +
double pMutPerBit = pMutPerBitParam.value(); +

eoValueParam<double> bitFlipRateParam(0.01, +"bitFlipRate", "Relative rate for bit-flip mutation", 'B'); +
parser.processParam( bitFlipRateParam, +"Genetic Operators" ); +
double bitFlipRate =  bitFlipRateParam.value(); +

eoValueParam<double> oneBitRateParam(0.01, +"oneBitRate", "Relative rate for deterministic bit-flip mutation", 'D'); +
parser.processParam( oneBitRateParam, +"Genetic Operators" ); +
double oneBitRate = oneBitRateParam.value(); +

// the name of the "status" file where all +actual parameter values will be saved +
string str_status = parser.ProgramName() ++ ".status"; // default value +
eoValueParam<string> statusParam(str_status.c_str(), +"status","Status file",'S'); +
parser.processParam( statusParam, "Persistence" +); +

// do the following AFTER ALL PARAMETERS HAVE +BEEN PROCESSED +
// i.e. in case you need parameters somewhere +else, postpone these +
if (parser.userNeedsHelp()) +
   { +
      parser.printHelp(cout); +
      exit(1); +
   } +
if (status_nameParam.value() != "") +
   { +
      ofstream +os(status_nameParam.value().c_str()); +
      os << +parser; // and you can use that file as parameter file +
   } +

+ + +
   -uint32 seed; -
   // decription of genotype -
   unsigned int vecSize; -
   // parameters for evolution -engine -
   unsigned int popSize; -
   unsigned int tSize; -
   // operators probabilities -at the algorithm level -
   double pCross; -
   double pMut;
   // init and stop -
   string load_name; -
   unsigned int maxGen; -
   unsigned int minGen; -
   unsigned int steadyGen; -
   // rates for crossovers -
   double onePointRate; -
   double twoPointsRate; -
   double URate; -
   // rates and private -parameters for mutations; -
   double pMutPerBit; -
   double bitFlipRate; -
   double oneBitRate; -
   // define a -parser from the command-line arguments -
     eoParser parser(argc, -argv); -
   // Now read the parameters -of the program -
     read_param(argc, -argv, seed, vecSize, popSize, tSize, -
           -pCross, pMut, load_name, maxGen, minGen, steadyGen, -
           -onePointRate, twoPointsRate, URate,  -
           -pMutPerBit, bitFlipRate, oneBitRate );
@@ -304,29 +256,29 @@ parameters

     {
         inState.load(load_name); //  load the pop and the rng -
        -// the fitness is read in the file:  -
        -// do only evaluate the pop if the fitness has changed +
       // +the fitness is read in the file:  +
       // +do only evaluate the pop if the fitness has changed
     }
 else
     {
         rng.reseed(seed); -
        -// a Indi random initializer -
        -// based on boolean_generator class (see utils/rnd_generator.h) +
       // +a Indi random initializer +
       // +based on boolean_generator class (see utils/rnd_generator.h)
         eoInitFixedLength<Indi, boolean_generator> 
            random(vecSize, boolean_generator()); -
        -// Init pop from the randomizer: need to use the append function +
       // +Init pop from the randomizer: need to use the append function
         pop.append(popSize, random);  -
        -// and evaluate pop (STL syntax)  +
       // +and evaluate pop (STL syntax) 
         apply<Indi>(eval, pop);
     } // end @@ -356,7 +308,8 @@ of initializatio of the population +
 // the same generational replacement +at the moment :-) +
 eoGenerationalReplacement<Indi> +replace; 
 // The robust tournament selection -
 eoDetTournament<Indi> selectOne(tSize);           +
 eoDetTournament<Indi> selectOne(tSize);        + // tSize in [2,POPSIZE]
 // is now encapsulated in a eoSelectPerc (entage) @@ -369,9 +322,10 @@ by default rate==1
 // And we now have the full slection/replacement - though with  -
 // the same generational -replacement at the moment :-) -
 eoGenerationalReplacement<Indi> replace; 
@@ -451,12 +405,12 @@ a continuator: an eoCheckPoint 
 // IS AN eoContinue and will be called in the loop of all algorithms)
 eoCheckPoint<Indi> checkpoint(continuator); -

    -// Create a counter parameter +

  // +Create a counter parameter
     eoValueParam<unsigned> generationCounter(0, "Gen."); -

    -// Create an incrementor (sub-class of eoUpdater). Note that the  +

   // +Create an incrementor (sub-class of eoUpdater). Note that the 
     // parameter's value is passed by reference, 
     // so every @@ -465,13 +419,13 @@ time the incrementer is updated (every generation), in generationCounter will change.
     eoIncrementor<unsigned> increment(generationCounter.value()); -
    -// Add it to the checkpoint,  +
  // +Add it to the checkpoint, 
     // so the counter is updated (here, incremented) every generation
     checkpoint.add(increment); -
    -// now some statistics on the population: +
  // +now some statistics on the population:
     // Best fitness in population
     eoBestFitnessStat<Indi> @@ -480,9 +434,8 @@ bestStat; moment stats: average and stdev
     eoSecondMomentStats<Indi> SecondStat; -
    -// Add them to the checkpoint to get them called at the appropriate -time +
   // +Add them to the checkpoint to get them called at the appropriate time
     checkpoint.add(bestStat);
     checkpoint.add(SecondStat);
     // The Stdout @@ -496,8 +449,7 @@ checkpoint.add(monitor);

     // the monitor will output a series of parameters: add them 
     -monitor.add(generationCounter); - +monitor.add(generationCounter);
     monitor.add(eval); // because now eval is an eoEvalFuncCounter! @@ -521,21 +473,23 @@ of item the eoCheckpoint can handle: state savers: eoState outState;
     // Register the algorithm into the state -
     outState.registerObject(parser); +
     +outState.registerObject(parser);
     outState.registerObject(pop);
     outState.registerObject(rng);
     // and feed the state to state savers -
    -// save state every 100th  generation +
+// +save state every 100th  generation
     eoCountedStateSaver stateSaver1(100, outState, "generation"); 
     // save state every 1 seconds 
     eoTimedStateSaver    stateSaver2(1, outState, "time");  -
    -// Don't forget to add the two savers to the checkpoint +
  // +Don't forget to add the two savers to the checkpoint
     checkpoint.add(stateSaver1);
     checkpoint.add(stateSaver2);
     // and that's @@ -599,7 +553,9 @@ cout << "Exception: " << e.what() << '\n';


Back to Lesson 3 - Tutorial main page - Algorithm-Based - Component-Based - - Programming hints - EO +- +Programming +hints - EO documentation