26 #include <keplerian_toolbox/epoch.h>
28 #include "cassini_2.h"
29 #include "../AstroToolbox/mga_dsm.h"
30 #include "../AstroToolbox/misc4Tandem.h"
33 namespace pagmo {
namespace problem {
35 const int cassini_2::sequence[6] = {3, 2, 2, 3, 5, 6};
43 const double lb[22] = {-1000, 3, 0, 0, 100, 100, 30, 400, 800, 0.01, 0.01, 0.01, 0.01, 0.01, 1.05, 1.05, 1.15, 1.7, -M_PI, -M_PI, -M_PI, -M_PI};
44 const double ub[22] = {0, 5, 1, 1, 400, 500, 300, 1600, 2200, 0.9, 0.9, 0.9, 0.9, 0.9, 6, 6, 6.5, 291, M_PI, M_PI, M_PI, M_PI};
57 MGA_DSM(x, problem,f[0]);
72 MGA_DSM(x, problem, obj);
76 const size_t seq_size = (x.size() + 2) / 4;
77 pagmo_assert((x.size() + 2) % 4 == 0 && seq_size >= 2);
78 pagmo_assert(problem.sequence.size() == seq_size);
79 s <<
"Flyby sequence:\t\t\t";
80 for (
size_t i = 0; i < seq_size; ++i) {
81 s << problem.sequence[i];
84 s <<
"Departure epoch (mjd2000):\t" << x[0] <<
'\n';
85 s <<
"Departure epoch:\t\t" << ::kep_toolbox::epoch(x[0],::kep_toolbox::epoch::MJD2000) <<
'\n';
86 s <<
"Vinf polar components:\t\t";
87 for (
size_t i = 0; i < 3; ++i) {
92 for (
size_t i = 0; i < seq_size - 1; ++i) {
93 s <<
"Leg time of flight:\t\t" << x[i + 4] <<
'\n';
94 totaltime += x[i + 4];
96 s <<
"Total time of flight:\t\t" << totaltime <<
'\n';
97 for (
size_t i = 0; i < seq_size - 2; ++i) {
98 s <<
"Flyby radius:\t\t\t" << x[i + 2 * (seq_size + 1)] <<
'\n';
101 for (
size_t i = 0; i < seq_size - 2; ++i) {
102 totaltime += x[i + 4];
103 s <<
"Flyby date:\t\t\t" << ::kep_toolbox::epoch(totaltime,::kep_toolbox::epoch::MJD2000) <<
'\n';
105 for (
size_t i = 0; i < seq_size - 2; ++i) {
106 s <<
"Vinf at flyby:\t\t\t" << std::sqrt(problem.vrelin_vec[i]) <<
'\n';
108 for (
size_t i = 0; i < seq_size - 1; ++i) {
109 s <<
"dsm" << i+1 <<
":\t\t\t\t" << problem.DV[i+1] <<
'\n';
111 s <<
"Final DV:\t\t\t" << problem.DV.back() <<
'\n';
124 for (
int i = 0; i<lenG; ++i)
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
std::vector< double > decision_vector
Decision vector type.
base_ptr clone() const
Clone method.
std::string get_name() const
Get problem's name.
std::string pretty(const std::vector< double > &x) const
Outputs a stream with the trajectory data.
std::vector< double > fitness_vector
Fitness vector type.
void objfun_impl(fitness_vector &, const decision_vector &) const
Implementation of the objective function.
void set_bounds(const decision_vector &, const decision_vector &)
Bounds setter from pagmo::decision_vector.
void set_sparsity(int &, std::vector< int > &, std::vector< int > &) const
Implementation of the sparsity structure. (just to check the method call ... it is only used in some ...