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:
parent
477dbe49a9
commit
cf561b537a
14 changed files with 498 additions and 93 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue