26 #include <keplerian_toolbox/epoch.h>
28 #include "messenger_full.h"
29 #include "../AstroToolbox/mga_dsm.h"
31 namespace pagmo {
namespace problem {
33 const int messenger_full::sequence[7] = {3, 2, 2, 1, 1, 1, 1};
42 const double lb[26] = {1900, 3, 0, 0, 100, 100, 100, 100, 100, 100, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 1.1, 1.1, 1.05, 1.05, 1.05, -M_PI, -M_PI, -M_PI, -M_PI, -M_PI};
43 const double ub[26] = {2200, 4.05, 1, 1, 500, 500, 500, 500, 500, 550, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 6, 6, 6, 6, 6, M_PI, M_PI, M_PI, M_PI, M_PI};
59 MGA_DSM(x, problem,f[0]);
75 MGA_DSM(x, problem, obj);
79 const size_t seq_size = (x.size() + 2) / 4;
80 pagmo_assert((x.size() + 2) % 4 == 0 && seq_size >= 2);
81 pagmo_assert(problem.sequence.size() == seq_size);
82 s <<
"Flyby sequence:\t\t\t";
83 for (
size_t i = 0; i < seq_size; ++i) {
84 s << problem.sequence[i];
87 s <<
"Departure epoch (mjd2000):\t" << x[0] <<
'\n';
88 s <<
"Departure epoch:\t\t" << ::kep_toolbox::epoch(x[0],::kep_toolbox::epoch::MJD2000) <<
'\n';
89 s <<
"Vinf polar components:\t\t";
90 for (
size_t i = 0; i < 3; ++i) {
95 for (
size_t i = 0; i < seq_size - 1; ++i) {
96 s <<
"Leg time of flight:\t\t" << x[i + 4] <<
'\n';
97 totaltime += x[i + 4];
99 s <<
"Total time of flight:\t\t" << totaltime <<
'\n';
100 for (
size_t i = 0; i < seq_size - 2; ++i) {
101 s <<
"Flyby radius:\t\t\t" << x[i + 2 * (seq_size + 1)] <<
'\n';
104 for (
size_t i = 0; i < seq_size - 2; ++i) {
105 totaltime += x[i + 4];
106 s <<
"Flyby date:\t\t\t" << ::kep_toolbox::epoch(totaltime,::kep_toolbox::epoch::MJD2000) <<
'\n';
108 for (
size_t i = 0; i < seq_size - 2; ++i) {
109 s <<
"Vinf at flyby:\t\t\t" << std::sqrt(problem.vrelin_vec[i]) <<
'\n';
111 for (
size_t i = 0; i < seq_size - 1; ++i) {
112 s <<
"dsm" << i+1 <<
":\t\t\t\t" << problem.DV[i+1] <<
'\n';
114 s <<
"Final DV:\t\t\t" << problem.DV.back() <<
'\n';
124 for (
int i = 0; i<lenG; ++i)
133 return "Messenger full";
Messenger MGA-DSM Problem (full version)
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
void objfun_impl(fitness_vector &, const decision_vector &) const
Implementation of the objective function.
std::vector< double > decision_vector
Decision vector type.
messenger_full()
Problem Constructor.
void set_sparsity(int &, std::vector< int > &, std::vector< int > &) const
Implementation of the sparsity structure.
std::string pretty(const std::vector< double > &x) const
Outputs a stream with the trajectory data.
base_ptr clone() const
Clone method.
std::vector< double > fitness_vector
Fitness vector type.
std::string get_name() const
Get problem's name.
void set_bounds(const decision_vector &, const decision_vector &)
Bounds setter from pagmo::decision_vector.