PaGMO  1.1.5
mga_1dsm_alpha.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_PROBLEM_MGA_1DSM_ALPHA_H
26 #define PAGMO_PROBLEM_MGA_1DSM_ALPHA_H
27 
28 #include <string>
29 #include <keplerian_toolbox/planet/jpl_low_precision.h>
30 #include <keplerian_toolbox/epoch.h>
31 
32 #include "../config.h"
33 #include "../serialization.h"
34 #include "../types.h"
35 #include "base.h"
36 
37 
38 
39 namespace pagmo{ namespace problem {
40 
42 
66 class __PAGMO_VISIBLE mga_1dsm_alpha: public base
67 {
68  public:
69  mga_1dsm_alpha(const std::vector<kep_toolbox::planet::planet_ptr> = construct_default_sequence(),
70  const kep_toolbox::epoch t0_l = kep_toolbox::epoch(0), const kep_toolbox::epoch t0_r = kep_toolbox::epoch(1000),
71  const double tof_l = 1.0*365.25, const double tof_u = 5.0*365.25,
72  const double vinf_l = 0.5, const double vinf_u = 2.5,
73  const bool mo = false, const bool add_vinf_dep = false, const bool add_vinf_arr = true);
75  base_ptr clone() const;
76 
77  std::string get_name() const;
78  std::string pretty(const std::vector<double> &x) const;
79  void set_tof(const double, const double);
80  void set_launch_window(const kep_toolbox::epoch&, const kep_toolbox::epoch&);
81  void set_vinf(const double);
82  std::vector<kep_toolbox::planet::planet_ptr> get_sequence() const;
83  std::vector<double> get_tof() const;
84  protected:
85  void objfun_impl(fitness_vector &, const decision_vector &) const;
86  std::string human_readable_extra() const;
87  private:
88  static const std::vector<kep_toolbox::planet::planet_ptr> construct_default_sequence() {
89  std::vector<kep_toolbox::planet::planet_ptr> retval;
90  retval.push_back(kep_toolbox::planet::jpl_lp("earth").clone());
91  retval.push_back(kep_toolbox::planet::jpl_lp("venus").clone());
92  retval.push_back(kep_toolbox::planet::jpl_lp("earth").clone());
93  return retval;
94  }
95 
96  friend class boost::serialization::access;
97  template <class Archive>
98  void serialize(Archive &ar, const unsigned int)
99  {
100  ar & boost::serialization::base_object<base>(*this);
101  ar & m_seq;
102  ar & const_cast<size_t &>(m_n_legs);
103  ar & m_add_vinf_dep;
104  ar & m_add_vinf_arr;
105  }
106  std::vector<kep_toolbox::planet::planet_ptr> m_seq;
107  const size_t m_n_legs;
108  bool m_add_vinf_dep;
109  bool m_add_vinf_arr;
110 };
111 
112 }} // namespaces
113 
114 BOOST_CLASS_EXPORT_KEY(pagmo::problem::mga_1dsm_alpha)
115 #endif // PAGMO_PROBLEM_MGA_1DSM_ALPHA_H
Root PaGMO namespace.
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
Definition: problem/base.h:62
std::vector< double > decision_vector
Decision vector type.
Definition: types.h:40
Base problem class.
Definition: problem/base.h:148
A generic MGA-1DSM Problem.
std::vector< double > fitness_vector
Fitness vector type.
Definition: types.h:42