diff --git a/trunk/paradiseo-peo/examples/lesson1/doclsn.h b/trunk/paradiseo-peo/examples/lesson1/doclsn.h new file mode 100644 index 000000000..146ffc0cf --- /dev/null +++ b/trunk/paradiseo-peo/examples/lesson1/doclsn.h @@ -0,0 +1,166 @@ +//! \mainpage Creating a simple ParadisEO-PEO Evolutionary Algorithm +//! +//! \section structure Introduction +//! +//! One of the first steps in designing an evolutionary algorihtm using the ParadisEO-PEO framework +//! consists in having a clear overview of the implemented algorithm. A brief pseudo-code description is offered +//! bellow - the entire source code for the ParadisEO-PEO evolutionary algorithm is defined in the peoEA.h +//! header file. The main elements to be considered when building an evolutionary algorithm are the transformation +//! operators, i.e. crossover and mutation, the evaluation function, the continuation criterion and the selection +//! and replacement strategy. +//! +//!
| do { | |
| select( population, offsprings ); | // select the offsprings from the current population |
| transform( offsprings ); | // crossover and mutation operators are applied on the selected offsprings |
| evaluate( offsprings ); | // evaluation step of the resulting offsprings |
| replace( population, offsprings ); | // replace the individuals in the current population whith individuals from the offspring population, according to a specified replacement strategy |
| } while ( eaCheckpointContinue( population ) ); | // checkpoint operators are applied on the current population |
|
+//! peoEA(
+//! eoContinue< EOT >& __cont, +//! peoPopEval< EOT >& __pop_eval, +//! eoSelect< EOT >& __select, +//! peoTransform< EOT >& __trans, +//! eoReplacement< EOT >& __replace +//! ); +//! |
+//! +//! \image html peoEA.png +//! |
| ... | |
| eoPop< EOT > population( POP_SIZE, popInitializer ); | // creation of a population with POP_SIZE individuals - the popInitializer is a functor to be called for each individual |
| eoGenContinue< EOT > eaCont( NUM_GEN ); | // number of generations for the evolutionary algorithm |
| eoCheckPoint< EOT > eaCheckpointContinue( eaCont ); | // checkpoint incorporating the continuation criterion - startpoint for adding other checkpoint objects |
| peoSeqPopEval< EOT > eaPopEval( evalFunction ); | // sequential evaluation functor wrapper - evalFunction represents the actual evaluation functor |
| eoRankingSelect< EOT > selectionStrategy; | // selection strategy for creating the offspring population - a simple ranking selection in this case |
| eoSelectNumber< EOT > eaSelect( selectionStrategy, POP_SIZE ); | // the number of individuals to be selected for creating the offspring population |
| eoRankingSelect< EOT > selectionStrategy; | // selection strategy for creating the offspring population - a simple ranking selection in this case |
| eoSGATransform< EOT > transform( crossover, CROSS_RATE, mutation, MUT_RATE ); | // transformation operator - crossover and mutation operators with their associated probabilities |
| peoSeqTransform< EOT > eaTransform( transform ); | // ParadisEO specific sequential operator - a parallel version may be specified in the same manner |
| eoPlusReplacement< EOT > eaReplace; | // replacement strategy - for integrating the offspring resulting individuals in the initial population |
| peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace ); | // ParadisEO evolutionary algorithm integrating the above defined objects |
| eaAlg( population ); | // specifying the initial population for the algorithm |
| ... |