Add homogeneous test. Pop is not created by the island anymore and has to me given to the island.

This commit is contained in:
quemy 2012-11-29 22:21:29 +01:00
commit c90fdc579f
5 changed files with 147 additions and 16 deletions

View file

@ -9,11 +9,11 @@ using namespace std;
int main(void)
{
typedef struct {
unsigned popSize = 1000;
unsigned popSize = 10;
unsigned tSize = 2;
double pCross = 0.8;
double pMut = 0.7;
unsigned maxGen = 10;
unsigned maxGen = 100;
} Param;
Param param;
@ -62,8 +62,9 @@ int main(void)
// // Integration policy
eoPlusReplacement<Indi> intPolicy;
Island<eoEasyEA,Indi> test(param.popSize, chromInit, intPolicy, migPolicy, genCont, plainEval, select, transform, replace);
eoPop<Indi> pop(param.popSize, chromInit);
Island<eoEasyEA,Indi> test(pop, intPolicy, migPolicy, genCont, plainEval, select, transform, replace);
// Island 2
// // Emigration policy
@ -77,8 +78,9 @@ int main(void)
// // Integration policy
eoPlusReplacement<Indi> intPolicy_2;
Island<eoEasyEA,Indi> test2(param.popSize, chromInit, intPolicy_2, migPolicy_2, genCont_2, plainEval, select, transform, replace);
eoPop<Indi> pop2(param.popSize, chromInit);
Island<eoEasyEA,Indi> test2(pop2, intPolicy_2, migPolicy_2, genCont_2, plainEval, select, transform, replace);
// Topology
Topology<Complete> topo;
@ -87,8 +89,11 @@ int main(void)
model.add(test);
model.add(test2);
model();
//model();
test();
test2();
cout << test.getPop() << endl;
cout << test2.getPop() << endl;
}