adding a lot of includes
This commit is contained in:
parent
a9468f38c9
commit
142c7d779c
5 changed files with 52 additions and 34 deletions
|
|
@ -10,9 +10,12 @@
|
||||||
#include <utils/eoParser.h> // eoParser
|
#include <utils/eoParser.h> // eoParser
|
||||||
#include <eoPop.h> // eoPop
|
#include <eoPop.h> // eoPop
|
||||||
#include <eoGenContinue.h> // eoGenContinue
|
#include <eoGenContinue.h> // eoGenContinue
|
||||||
#include <eoProportional.h> // eoProportional
|
|
||||||
#include <eoStochTournament.h> // eoStochTournament
|
#include <eoStochTournament.h> // eoStochTournament
|
||||||
#include <eoSGA.h> // eoSGA
|
#include <eoSGA.h> // eoSGA
|
||||||
|
#include <eoGenContinue.h> // eoGenContinue
|
||||||
|
#include <utils/eoCheckPoint.h> // eoCheckPoint
|
||||||
|
#include <utils/eoStat.h> // eoSecondMomentStats
|
||||||
|
#include <utils/eoStdoutMonitor.h> // eoStdoutMonitor
|
||||||
#include "gprop.h" // Chrom eoChromInit eoChromMutation eoChromXover eoChromEvaluator
|
#include "gprop.h" // Chrom eoChromInit eoChromMutation eoChromXover eoChromEvaluator
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -120,8 +123,6 @@ void load_file(mlp::set& set, const string& ext)
|
||||||
|
|
||||||
void ga()
|
void ga()
|
||||||
{
|
{
|
||||||
eoGenContinue<Chrom> continuator(generations.value());
|
|
||||||
|
|
||||||
// create population
|
// create population
|
||||||
eoInitChrom init;
|
eoInitChrom init;
|
||||||
eoPop<Chrom> pop(pop_size.value(), init);
|
eoPop<Chrom> pop(pop_size.value(), init);
|
||||||
|
|
@ -138,12 +139,27 @@ void ga()
|
||||||
eoChromMutation mutation(generations);
|
eoChromMutation mutation(generations);
|
||||||
eoChromXover xover;
|
eoChromXover xover;
|
||||||
|
|
||||||
|
// stop condition
|
||||||
|
eoGenContinue<Chrom> continuator(generations.value());
|
||||||
|
|
||||||
|
// checkpoint
|
||||||
|
eoCheckPoint<Chrom> checkpoint(continuator);
|
||||||
|
|
||||||
|
// monitor
|
||||||
|
eoStdoutMonitor monitor;
|
||||||
|
checkpoint.add(monitor);
|
||||||
|
|
||||||
|
// statistics
|
||||||
|
eoSecondMomentStats<Chrom> stats;
|
||||||
|
checkpoint.add(stats);
|
||||||
|
monitor.add(stats);
|
||||||
|
|
||||||
// genetic algorithm
|
// genetic algorithm
|
||||||
eoSGA<Chrom> sga(select,
|
eoSGA<Chrom> sga(select,
|
||||||
xover, xover_rate.value(),
|
xover, xover_rate.value(),
|
||||||
mutation, mut_rate.value(),
|
mutation, mut_rate.value(),
|
||||||
evaluator,
|
evaluator,
|
||||||
continuator);
|
checkpoint);
|
||||||
|
|
||||||
cout << pop << endl;
|
cout << pop << endl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,5 +34,5 @@ AC_TYPE_SIZE_T
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
AC_CHECK_FUNCS(select)
|
AC_CHECK_FUNCS(select)
|
||||||
|
|
||||||
AC_OUTPUT(src/obsolete/Makefile doc/Makefile src/Makefile src/utils/Makefile src/other/Makefile win/Makefile src/gp/Makefile src/es/Makefile src/ga/Makefile test/Makefile contrib/Makefile Makefile app/Makefile app/gprop/Makefile)
|
AC_OUTPUT(src/obsolete/Makefile doc/Makefile src/Makefile src/utils/Makefile src/other/Makefile win/Makefile src/gp/Makefile src/es/Makefile src/ga/Makefile test/Makefile contrib/Makefile Makefile app/Makefile app/gprop/Makefile app/mastermind/Makefile)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ class eoSelectPerc : public eoSelect<EOT>
|
||||||
_dest[i] = select(_source);
|
_dest[i] = select(_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
private :
|
private :
|
||||||
eoSelectOne<EOT>& select;
|
eoSelectOne<EOT>& select;
|
||||||
float rate;
|
float rate;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,10 @@
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <functional> //
|
#include <functional>
|
||||||
#include <numeric> // accumulate
|
#include <numeric> // accumulate
|
||||||
#include <utils/eoRNG.h>
|
#include <eoSelectOne.h> // eoSelectOne
|
||||||
|
#include <utils/selectors.h> // stochastic_tournament
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/** eoStochTournament: a selection method that selects ONE individual by
|
/** eoStochTournament: a selection method that selects ONE individual by
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#define _eoCheckPoint_h
|
#define _eoCheckPoint_h
|
||||||
|
|
||||||
#include <eoContinue.h>
|
#include <eoContinue.h>
|
||||||
|
#include <utils/eoUpdater.h>
|
||||||
|
|
||||||
template <class EOT> class eoStatBase;
|
template <class EOT> class eoStatBase;
|
||||||
template <class EOT> class eoSortedStatBase;
|
template <class EOT> class eoSortedStatBase;
|
||||||
|
|
|
||||||
Reference in a new issue