PaGMO  1.1.5
gtoc_1.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 "gtoc_1.h"
28 #include "../AstroToolbox/mga.h"
29 
30 namespace pagmo { namespace problem {
31 
33 
36 gtoc_1::gtoc_1():base(8),Delta_V(8),rp(6),t(8)
37 {
38  // Set bounds.
39  const double lb[8] = {3000,14,14,14,14,100,366,300};
40  const double ub[8] = {10000,2000,2000,2000,2000,9000,9000,9000};
41  set_bounds(lb,lb+8,ub,ub+8);
42 
43  //Defining the problem data up the problem parameters
44  problem.type = asteroid_impact;
45  problem.mass = 1500.0; // Satellite initial mass [Kg]
46  problem.Isp = 2500.0; // Satellite specific impulse [s]
47  problem.DVlaunch = 2.5; // Launcher DV in km/s
48 
49  int sequence_[8] = {3,2,3,2,3,5,6,10}; // sequence of planets
50  std::vector<int> sequence(8);
51  problem.sequence.insert(problem.sequence.begin(), sequence_, sequence_+8);
52 
53  const int rev_[8] = {0,0,0,0,0,0,1,0}; // sequence of clockwise legs
54  std::vector<int> rev(8);
55  problem.rev_flag.insert(problem.rev_flag.begin(), rev_, rev_+8);
56 
57  problem.asteroid.keplerian[0] = 2.5897261; // Asteroid data
58  problem.asteroid.keplerian[1] = 0.2734625;
59  problem.asteroid.keplerian[2] = 6.40734;
60  problem.asteroid.keplerian[3] = 128.34711;
61  problem.asteroid.keplerian[4] = 264.78691;
62  problem.asteroid.keplerian[5] = 320.479555;
63  problem.asteroid.epoch = 53600;
64 }
65 
68 {
69  return base_ptr(new gtoc_1(*this));
70 }
71 
74 {
75  MGA(x,problem,rp,Delta_V,f[0]);
76 }
77 
78 std::string gtoc_1::get_name() const
79 {
80  return "GTOC_1";
81 }
82 
83 
84 
85 }}
86 
87 BOOST_CLASS_EXPORT_IMPLEMENT(pagmo::problem::gtoc_1)
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_ptr clone() const
Clone method.
Definition: gtoc_1.cpp:67
Base problem class.
Definition: problem/base.h:148
std::string get_name() const
Get problem's name.
Definition: gtoc_1.cpp:78
std::vector< double > fitness_vector
Fitness vector type.
Definition: types.h:42
GTOC_1 MGA problem.
Definition: gtoc_1.h:52
void objfun_impl(fitness_vector &, const decision_vector &) const
Implementation of the objective function.
Definition: gtoc_1.cpp:73
void set_bounds(const decision_vector &, const decision_vector &)
Bounds setter from pagmo::decision_vector.
gtoc_1()
Problem Constructor.
Definition: gtoc_1.cpp:36