t-eoPareto now plots the evolving population and t-eoRandom check is slightly more strict
This commit is contained in:
parent
3798b665d4
commit
fe89662e3c
3 changed files with 22 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ CXXFLAGS = -g -Wall
|
||||||
|
|
||||||
check_PROGRAMS = t-eoPareto t-eofitness t-eoRandom t-eobin t-eoStateAndParser t-eoCheckpointing t-eoSSGA \
|
check_PROGRAMS = t-eoPareto t-eofitness t-eoRandom t-eobin t-eoStateAndParser t-eoCheckpointing t-eoSSGA \
|
||||||
t-eoExternalEO t-eoSymreg t-eo t-eoReplacement t-eoSelect t-eoGenOp t-eoGA t-eoVector
|
t-eoExternalEO t-eoSymreg t-eo t-eoReplacement t-eoSelect t-eoGenOp t-eoGA t-eoVector
|
||||||
TESTS=run_tests t-eoVector t-eoRandom t-eoSSGA
|
TESTS=run_tests t-eoVector t-eoRandom t-eoSSGA t-eoPareto
|
||||||
# removing temporarily t-eoESFull
|
# removing temporarily t-eoESFull
|
||||||
#noinst_PROGRAMS = t-eofitness t-eobin t-eoStateAndParser t-eoCheckpointing t-eoExternalEO t-eoESFull t-eoSymreg t-eo t-eoReplacement t-eoSelect t-eoGenOp t-eoGA
|
#noinst_PROGRAMS = t-eofitness t-eobin t-eoStateAndParser t-eoCheckpointing t-eoExternalEO t-eoESFull t-eoSymreg t-eo t-eoReplacement t-eoSelect t-eoGenOp t-eoGA
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
|
|
||||||
#include <eo>
|
#include <eo>
|
||||||
|
|
||||||
|
//#include <utils/eoMOFitnessStat.h>
|
||||||
|
//#include <utils/eoFileSnapshot.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
typedef vector<double> fitness_type;
|
typedef vector<double> fitness_type;
|
||||||
|
|
||||||
|
|
@ -43,7 +46,7 @@ class Init : public eoInit<eoDouble>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Test pareto dominance and perf2worth
|
// Test pareto dominance and perf2worth, and while you're at it, test the eoGnuPlot monitor as well
|
||||||
|
|
||||||
void the_main()
|
void the_main()
|
||||||
{
|
{
|
||||||
|
|
@ -51,6 +54,7 @@ void the_main()
|
||||||
Eval eval;
|
Eval eval;
|
||||||
Mutate mutate;
|
Mutate mutate;
|
||||||
|
|
||||||
|
unsigned num_gen = 10;
|
||||||
unsigned pop_size = 50;
|
unsigned pop_size = 50;
|
||||||
eoPop<eoDouble> pop(pop_size, init);
|
eoPop<eoDouble> pop(pop_size, init);
|
||||||
|
|
||||||
|
|
@ -80,9 +84,22 @@ void the_main()
|
||||||
eoCommaReplacement<eoDouble> replace;
|
eoCommaReplacement<eoDouble> replace;
|
||||||
|
|
||||||
unsigned long generation = 0;
|
unsigned long generation = 0;
|
||||||
eoGenContinue<eoDouble> gen(10, generation);
|
eoGenContinue<eoDouble> gen(num_gen, generation);
|
||||||
eoCheckPoint<eoDouble> cp(gen);
|
eoCheckPoint<eoDouble> cp(gen);
|
||||||
|
|
||||||
|
eoMOFitnessStat<eoDouble> fitness0(0, "FirstObjective");
|
||||||
|
eoMOFitnessStat<eoDouble> fitness1(1, "SecondObjective");
|
||||||
|
|
||||||
|
cp.add(fitness0);
|
||||||
|
cp.add(fitness1);
|
||||||
|
|
||||||
|
eoGnuplot1DSnapshot snapshot("pareto");
|
||||||
|
|
||||||
|
cp.add(snapshot);
|
||||||
|
|
||||||
|
snapshot.add(fitness0);
|
||||||
|
snapshot.add(fitness1);
|
||||||
|
|
||||||
// Three algos
|
// Three algos
|
||||||
eoEasyEA<eoDouble> ea1(cp, eval, breeder1, replace);
|
eoEasyEA<eoDouble> ea1(cp, eval, breeder1, replace);
|
||||||
eoEasyEA<eoDouble> ea2(cp, eval, breeder2, replace);
|
eoEasyEA<eoDouble> ea2(cp, eval, breeder2, replace);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
CVS Info: $Date: 2001-02-19 12:23:13 $ $Author: maartenkeijzer $ $Revision: 1.10 $
|
CVS Info: $Date: 2001-03-14 10:14:27 $ $Author: maartenkeijzer $ $Revision: 1.11 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -45,6 +45,7 @@ main() {
|
||||||
try
|
try
|
||||||
{ // throws an error
|
{ // throws an error
|
||||||
eoUniformGenerator<unsigned long> utest( 10000000U, 10000U);
|
eoUniformGenerator<unsigned long> utest( 10000000U, 10000U);
|
||||||
|
throw; // if this succeeds something is wrong, make sure that that is noticed
|
||||||
}
|
}
|
||||||
catch (logic_error& e)
|
catch (logic_error& e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Reference in a new issue