PaGMO  1.1.5
pade.h
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 #ifndef PAGMO_ALGORITHM_PADE_H
26 #define PAGMO_ALGORITHM_PADE_H
27 
28 #include "../config.h"
29 #include "../serialization.h"
30 #include "base.h"
31 #include "jde.h"
32 #include "../problem/decompose.h"
33 
34 
35 
36 namespace pagmo { namespace algorithm {
37 
39 
52 class __PAGMO_VISIBLE pade: public base
53 {
54 public:
57  RANDOM=0,
58  GRID=1,
59  LOW_DISCREPANCY=2
60  };
61  pade(
62  int gen=10,
63  unsigned int max_parallelism = 1,
67  weight_generation_type = LOW_DISCREPANCY,
68  const fitness_vector & = std::vector<double>()
69  );
70  pade(const pade &);
71 
72  base_ptr clone() const;
73  void evolve(population &) const;
74  std::string get_name() const;
75  std::vector<fitness_vector> generate_weights(const unsigned int, const unsigned int) const;
76 
77 protected:
78  std::string human_readable_extra() const;
79 
80 private:
81  void reksum(std::vector<std::vector<double> > &, const std::vector<unsigned int>&, unsigned int, unsigned int, std::vector<double> = std::vector<double>() ) const;
82  void compute_neighbours(std::vector<std::vector<int> > &, const std::vector<std::vector <double> > &);
84  friend class boost::serialization::access;
85  template <class Archive>
86  void serialize(Archive &ar, const unsigned int)
87  {
88  ar & boost::serialization::base_object<base>(*this);
89  ar & const_cast<int &>(m_gen);
90  ar & const_cast<unsigned int &>(m_threads);
91  ar & const_cast<pagmo::problem::decompose::method_type &>(m_method);
92  ar & const_cast<base_ptr &>(m_solver);
93  ar & const_cast<population::size_type &>(m_T);
94  ar & const_cast<weight_generation_type &>(m_weight_generation);
95  ar & m_z;
96  }
97  //Number of generations
98  const int m_gen;
99  const unsigned int m_threads;
101  const base_ptr m_solver;
102  const population::size_type m_T;
103  const weight_generation_type m_weight_generation;
104  fitness_vector m_z;
105 };
106 
107 }} //namespaces
108 
109 BOOST_CLASS_EXPORT_KEY(pagmo::algorithm::pade)
110 
111 #endif // PAGMO_ALGORITHM_PADE_H
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base algorithm.
Root PaGMO namespace.
Base algorithm class.
Population class.
Definition: population.h:70
The Boundary Intersection method is used to perform the decomposition.
Definition: decompose.h:69
Parallel Decomposition (PaDe)
Definition: pade.h:52
std::vector< double > fitness_vector
Fitness vector type.
Definition: types.h:42
container_type::size_type size_type
Population size type.
Definition: population.h:192
method_type
Mechanism used to perform the problem decomposition.
Definition: decompose.h:66
weight_generation_type
Mechanism used to generate the weight vectors.
Definition: pade.h:56
jDE - Differential Evolution Algorithm - Self-Adaptive C and R (2011)
Definition: jde.h:64