PaGMO  1.1.5
worhp.h
1 /*****************************************************************************
2  * Copyright (C) 2015 The PaGMO development team, *
3  * Advanced Concepts Team (ACT), European Space Agency (ESA) *
4  * http://apps.sourceforge.net/mediawiki/pagmo *
5  * http://apps.sourceforge.net/mediawiki/pagmo/index.php?title=Developers *
6  * http://apps.sourceforge.net/mediawiki/pagmo/index.php?title=Credits *
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_WORHP_H
26 #define PAGMO_ALGORITHM_WORHP_H
27 
28 #include <worhp/worhp.h>
29 #include <string>
30 #include <map>
31 
32 #include "../serialization.h"
33 #include "worhp_cpp_wrapper/worhp_param_serialization.h"
34 #include "base.h"
35 
36 namespace pagmo {
37 
38 // Forward declaration
39 class population;
40 
41 namespace algorithm {
42 
43 class __PAGMO_VISIBLE worhp: public base
44 {
45 public:
46  worhp(const int iter=100, const double feas=1e-10, const double opt=1e-4, const bool screen_output=true);
47  void evolve(pagmo::population&) const;
48  pagmo::algorithm::base_ptr clone() const;
49  std::string get_name() const;
50 
51  void set_param(const std::string, const double);
52  double get_param(const std::string name) const;
53  std::vector<std::string> get_available_parameters() const;
54 
55 protected:
56  std::string human_readable_extra() const;
57 
58 private:
59  void define_param_map() ;
60 
61  friend class boost::serialization::access;
62  template <class Archive>
63  void serialize(Archive &ar, const unsigned int)
64  {
65  ar & boost::serialization::base_object<base>(*this);
66  ar & m_params;
67  }
68  // Structure containing all the WORHP parameters, see WORHP documentation
69  Params m_params;
70  // A map between the WORHP parameters available to the user for geting and setting and integres 1...N
71  std::map<std::string, int> m_param_map;
72 };
73 
74 }} // namespaces
75 
76 #endif // PAGMO_ALGORITHM_WORHP_H
77 
78 BOOST_CLASS_EXPORT_KEY(pagmo::algorithm::worhp)
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base algorithm.
Root PaGMO namespace.
Population class.
Definition: population.h:70