Add islandNotifier to allow the mig and int policy to be checked in the island. The islandNotifier is added to the algorithm continuator and will make the island perform a binded task. In the case of island, the task is to check policies.

This commit is contained in:
quemy 2012-11-11 22:36:21 +01:00
commit cf561b537a
14 changed files with 498 additions and 93 deletions

View file

@ -53,10 +53,11 @@ int main(void)
eoPeriodicContinue<Indi> criteria(25); // We mig each gen
eoDetTournamentSelect<Indi> selectOne(2);
eoSelectNumber<Indi> who(selectOne, 5);
Policy<Indi> pol;
pol.push_back(PolicyElement<Indi>(who, criteria));
MigPolicy<Indi> migPolicy;
migPolicy.push_back(PolicyElement<Indi>(who, criteria));
IntPolicy<Indi> intPolicy(plainEval,replace);
Island<eoEasyEA,Indi> test(param.popSize, chromInit, replace, pol, genCont, plainEval, select, transform, replace);
Island<eoEasyEA,Indi> test(param.popSize, chromInit, intPolicy, migPolicy, genCont, plainEval, select, transform, replace);
test();
cout << test.getPop() << endl;