PaGMO  1.1.5
island.cpp
1 /*****************************************************************************
2  * Copyright (C) 2004-2015 The PaGMO development team, *
3  * Advanced Concepts Team (ACT), European Space Agency (ESA) *
4  * *
5  * https://github.com/esa/pagmo *
6  * *
7  * act@esa.int *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License *
20  * along with this program; if not, write to the *
21  * Free Software Foundation, Inc., *
22  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
23  *****************************************************************************/
24 
25 #include <string>
26 
27 #include "algorithm/base.h"
28 #include "base_island.h"
29 #include "island.h"
30 #include "migration/base_r_policy.h"
31 #include "migration/base_s_policy.h"
32 #include "population.h"
33 #include "problem/base.h"
34 
35 namespace pagmo
36 {
37 
39 
42 island::island(const algorithm::base &a, const problem::base &p, int n,
43  const migration::base_s_policy &s_policy, const migration::base_r_policy &r_policy):
44  base_island(a,p,n,s_policy,r_policy)
45 {}
46 
48 
52 {}
53 
55 
59  const migration::base_s_policy &s_policy, const migration::base_r_policy &r_policy):
60  base_island(a,pop,s_policy,r_policy)
61 {}
62 
65 {
67  return *this;
68 }
69 
71 {
72  return base_island_ptr(new island(*this));
73 }
74 
76 {
77  algo.evolve(pop);
78 }
79 
80 std::string island::get_name() const
81 {
82  return "Local thread island";
83 }
84 
85 }
86 
87 BOOST_CLASS_EXPORT_IMPLEMENT(pagmo::island)
Root PaGMO namespace.
Base class for migration replacement policies.
Definition: base_r_policy.h:57
Base class for migration selection policies.
Definition: base_s_policy.h:54
Base algorithm class.
island(const island &)
Copy constructor.
Definition: island.cpp:51
Local island class.
Definition: island.h:68
Base problem class.
Definition: problem/base.h:148
Population class.
Definition: population.h:70
island & operator=(const island &)
Assignment operator.
Definition: island.cpp:64
base_island_ptr clone() const
Clone method.
Definition: island.cpp:70
base_island & operator=(const base_island &)
Assignment operator.
Base island class.
Definition: base_island.h:81
virtual void evolve(population &p) const =0
Evolve method.
boost::shared_ptr< base_island > base_island_ptr
Alias for the shared pointer to a pagmo::base_island.
Definition: base_island.h:49
void perform_evolution(const algorithm::base &, population &) const
Method that implements the evolution of the population.
Definition: island.cpp:75
std::string get_name() const
Return a string identifying the island's type.
Definition: island.cpp:80