25 #ifndef PAGMO_SPHERES_H
26 #define PAGMO_SPHERES_H
30 #include <gsl/gsl_odeiv2.h>
32 #include "../config.h"
33 #include "../serialization.h"
35 #include "base_stochastic.h"
38 namespace pagmo {
namespace problem {
72 static int ode_func(
double t,
const double y[],
double f[],
void *params );
88 spheres(
int n_evaluations = 10,
int n_hidden = 10,
double ode_prec = 1E-6,
unsigned int seed = 0,
bool symmetric =
false,
double sim_time = 50.0,
const std::vector<double>& sides = std::vector<double>(3,0.5));
112 std::vector<std::vector<double> > post_evaluate(
const decision_vector &x,
int N = 25000,
unsigned int seed = 0)
const;
123 std::vector<std::vector<double> > simulate(
const decision_vector & x,
const std::vector<double> &ic,
int N)
const;
124 std::string get_name()
const;
132 std::string human_readable_extra()
const;
138 ffnn(
const unsigned int,
const unsigned int,
const unsigned int);
139 void eval(
double[],
const double[])
const;
140 void set_weights(
const std::vector<double> &);
142 friend class boost::serialization::access;
143 template <
class Archive>
144 void serialize(Archive &ar,
const unsigned int)
146 ar &
const_cast<unsigned int &
>(m_n_inputs);
147 ar &
const_cast<unsigned int &
>(m_n_hidden);
148 ar &
const_cast<unsigned int &
>(m_n_outputs);
152 const unsigned int m_n_inputs;
153 const unsigned int m_n_hidden;
154 const unsigned int m_n_outputs;
155 std::vector<double> m_weights;
156 mutable std::vector<double> m_hidden;
159 double single_fitness(
const std::vector<double> &,
const ffnn& )
const;
160 friend class boost::serialization::access;
161 template <
class Archive>
162 void serialize(Archive &ar,
const unsigned int)
164 ar & boost::serialization::base_object<base_stochastic>(*this);
166 ar & m_n_evaluations;
167 ar & m_n_hidden_neurons;
168 ar &
const_cast<double &
>(m_numerical_precision);
174 gsl_odeiv2_driver* m_gsl_drv_pntr;
175 gsl_odeiv2_system m_sys;
178 int m_n_hidden_neurons;
179 const double m_numerical_precision;
180 mutable std::vector<double> m_ic;
183 std::vector<double> m_sides;
189 #endif // PAGMO_SPHERES_H
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
std::vector< double > decision_vector
Decision vector type.
std::vector< double > fitness_vector
Fitness vector type.
Base Stochastic Optimization Problem.
Evolutionary Neuro-Controller for the MIT Spheres (perception-action defined in the absolute frame) ...