Wrap model in order to create homogeneous model easily.
This commit is contained in:
parent
f8d2d1cfa5
commit
6974bc7bbe
10 changed files with 252 additions and 20 deletions
|
|
@ -6,19 +6,6 @@
|
|||
using namespace paradiseo::smp;
|
||||
using namespace std;
|
||||
|
||||
void changeTopo(IslandModel<Indi>& _model, AbstractTopology& _topo)
|
||||
{
|
||||
static bool first = false;
|
||||
// Change topology after 1s of computation
|
||||
std::chrono::milliseconds dura(1000);
|
||||
std::this_thread::sleep_for( dura );
|
||||
if(!first)
|
||||
{
|
||||
_model.setTopology(_topo);
|
||||
first = !first;
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// Defining parameters
|
||||
|
|
@ -63,10 +50,6 @@ int main(void)
|
|||
eoDetTournamentSelect<Indi> selectOne1(20);
|
||||
eoSelectNumber<Indi> who(selectOne1, 3);
|
||||
|
||||
Topology<Ring> topo2;
|
||||
//std::function<void(void)> task = std::bind(changeTopo, model, topo2);
|
||||
//Notifier topoChanger(task);
|
||||
|
||||
MigPolicy<Indi> migPolicy;
|
||||
migPolicy.push_back(PolicyElement<Indi>(who, criteria));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue