Changed the names of the exercise files to exerciseN.p - N lesson nb, p exercise nb
This commit is contained in:
parent
67ae5f5a6f
commit
b1fa5076e2
3 changed files with 11 additions and 8 deletions
|
|
@ -91,18 +91,18 @@ void main_function(int argc, char **argv)
|
|||
// comment out the eoDetTournament lines
|
||||
|
||||
// The well-known roulette
|
||||
// eoProportional<Indi> select;
|
||||
// eoProportionalSelect<Indi> select;
|
||||
|
||||
// could also use stochastic binary tournament selection
|
||||
//
|
||||
// const double RATE = 0.75;
|
||||
// eoStochTournament<Indi> select(RATE); // RATE in ]0.5,1]
|
||||
// eoStochTournamentSelect<Indi> select(RATE); // RATE in ]0.5,1]
|
||||
// The robust tournament selection
|
||||
const unsigned int T_SIZE = 3; // size for tournament selection
|
||||
eoDetTournament<Indi> select(T_SIZE); // T_SIZE in [2,POP_SIZE]
|
||||
eoDetTournamentSelect<Indi> select(T_SIZE); // T_SIZE in [2,POP_SIZE]
|
||||
|
||||
// and of course the random selection
|
||||
// eoSelectRandom<Indi> select;
|
||||
// eoRandomSelect<Indi> select;
|
||||
|
||||
// The simple GA evolution engine uses generational replacement
|
||||
// so no replacement procedure is needed
|
||||
|
|
@ -95,10 +95,13 @@ void main_function(int argc, char **argv)
|
|||
////////////////////////////////////
|
||||
// SELECT
|
||||
// The robust tournament selection
|
||||
eoDetTournament<Indi> selectOne(T_SIZE); // T_SIZE in [2,POP_SIZE]
|
||||
eoDetTournamentSelect<Indi> selectOne(T_SIZE); // T_SIZE in [2,POP_SIZE]
|
||||
// solution solution solution solution solution solution solution
|
||||
// modify the rate in the constructor
|
||||
eoSelectMany<Indi> select(selectOne,2, eo_is_an_integer);// rate is second arg.
|
||||
// modify the nb offspring / rate in the constructor. 2 ways:
|
||||
// second arg treated as integer
|
||||
eoSelectMany<Indi> select(selectOne,2, eo_is_an_integer);
|
||||
// second arg treated as a rate (default behavior)
|
||||
// eoSelectMany<Indi> select(selectOne,0.1);
|
||||
|
||||
// REPLACE
|
||||
// solution solution solution solution solution solution solution
|
||||
|
|
@ -186,7 +186,7 @@ void main_function(int argc, char **argv)
|
|||
////////////////////////////////////
|
||||
// SELECT
|
||||
// The robust tournament selection
|
||||
eoDetTournament<Indi> selectOne(tSize); // tSize in [2,POPSIZE]
|
||||
eoDetTournamentSelect<Indi> selectOne(tSize); // tSize in [2,POPSIZE]
|
||||
// is now encapsulated in a eoSelectPerc (entage)
|
||||
eoSelectPerc<Indi> select(selectOne);// by default rate==1
|
||||
|
||||
Reference in a new issue