PaGMO  1.1.5
mga.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 MISSION_H
26 #define MISSION_H
27 
28 #include <vector>
29 #include "Pl_Eph_An.h"
30 #include <boost/archive/text_iarchive.hpp>
31 #include <boost/archive/text_oarchive.hpp>
32 #include <boost/serialization/version.hpp>
33 #include <boost/serialization/vector.hpp>
34 #include <boost/serialization/string.hpp>
35 #include <boost/serialization/split_member.hpp>
36 
37 // problem types
38 #define orbit_insertion 0 // Tandem
39 #define total_DV_orbit_insertion 1 // Cassini 1
40 #define rndv 2 // Rosetta
41 #define total_DV_rndv 3 // Cassini 2 and Messenger
42 #define asteroid_impact 4 // gtoc1
43 #define time2AUs 5 // SAGAS
44 
45 struct customobject
46 {
47  customobject()
48  {
49  for (int i = 0; i < 6; ++i) {
50  keplerian[i] = 0;
51  }
52  epoch = 0;
53  mu = 0;
54  }
55  friend class boost::serialization::access;
56  template<class Archive>
57  void serialize(Archive &ar, const unsigned int){
58  ar & keplerian;
59  ar & epoch;
60  ar & mu;
61  }
62  double keplerian[6];
63  double epoch;
64  double mu;
65 };
66 
67 
68 struct mgaproblem {
69  mgaproblem():type(0),e(0),rp(0),Isp(0),mass(0),DVlaunch(0) {}
70  friend class boost::serialization::access;
71  template<class Archive>
72  void serialize(Archive &ar, const unsigned int){
73  ar & type;
74  ar & sequence;
75  ar & rev_flag;
76  ar & e;
77  ar & rp;
78  ar & asteroid;
79  ar & Isp;
80  ar & mass;
81  ar & DVlaunch;
82  }
83  int type; //problem type
84  std::vector<int> sequence; //fly-by sequence (ex: 3,2,3,3,5,is Earth-Venus-Earth-Earth-Jupiter)
85  std::vector<int> rev_flag; //vector of flags for clockwise legs
86  double e; //insertion e (only in case total_DV_orbit_insertion)
87  double rp; //insertion rp in km (only in case total_DV_orbit_insertion)
88  customobject asteroid; //asteroid data (in case fly-by sequence has a final number = 10)
89  double Isp;
90  double mass;
91  double DVlaunch;
92 };
93 
94 int MGA(
95  //INPUTS
96  std::vector<double>,
97  mgaproblem,
98 
99  //OUTPUTS
100  std::vector <double>&, std::vector<double>&, double&);
101 
102 #endif