25 #ifndef PAGMO_PROBLEM_CSTRS_CO_EVOLUTION_H
26 #define PAGMO_PROBLEM_CSTRS_CO_EVOLUTION_H
29 #include <boost/functional/hash.hpp>
30 #include <boost/serialization/map.hpp>
32 #include "../serialization.h"
36 #include "base_meta.h"
37 #include "../algorithm/cstrs_co_evolution.h"
42 namespace pagmo{
namespace problem {
57 class __PAGMO_VISIBLE cstrs_co_evolution :
public base_meta
65 std::string get_name()
const;
67 void set_penalty_coeff(
const std::vector<double> &);
68 int get_penalty_coeff_size();
71 std::string human_readable_extra()
const;
75 void compute_penalty(std::vector<double> &, std::vector<int> &,
const constraint_vector &)
const;
78 friend class boost::serialization::access;
79 template <
class Archive>
80 void serialize(Archive &ar,
const unsigned int)
82 ar & boost::serialization::base_object<base>(*this);
86 ar & m_map_constraint;
89 std::vector<double> m_penalty_coeff;
94 std::map<std::size_t, fitness_vector> m_map_fitness;
95 std::map<std::size_t, constraint_vector> m_map_constraint;
98 boost::hash< std::vector<double> > m_decision_vector_hash;
104 class __PAGMO_VISIBLE cstrs_co_evolution_penalty :
public base
109 cstrs_co_evolution_penalty(
const base & = cec2006(4),
int dimension = 2,
int size = 30);
112 cstrs_co_evolution_penalty(
const cstrs_co_evolution_penalty &);
114 std::string get_name()
const;
119 std::string human_readable_extra()
const;
127 friend class boost::serialization::access;
128 template <
class Archive>
129 void serialize(Archive &ar,
const unsigned int)
131 ar & boost::serialization::base_object<base>(*this);
132 ar & m_original_problem;
133 ar & m_pop_2_x_vector;
134 ar & m_feasible_count_vector;
135 ar & m_feasible_fitness_sum_vector;
136 ar & m_max_feasible_fitness;
137 ar & m_total_sum_viol;
138 ar & m_total_num_viol;
142 std::vector<decision_vector> m_pop_2_x_vector;
145 std::vector<int> m_feasible_count_vector;
146 std::vector<double> m_feasible_fitness_sum_vector;
147 double m_max_feasible_fitness;
150 std::vector<double> m_total_sum_viol;
151 std::vector<int> m_total_num_viol;
157 BOOST_CLASS_EXPORT_KEY(pagmo::problem::cstrs_co_evolution)
158 BOOST_CLASS_EXPORT_KEY(
pagmo::problem::cstrs_co_evolution_penalty)
160 #endif // PAGMO_PROBLEM_cstrs_co_evolution_H
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
std::vector< double > decision_vector
Decision vector type.
method_type
Type of co-evolution.
std::vector< double > fitness_vector
Fitness vector type.
std::vector< double > constraint_vector
Constraint vector type.
container_type::size_type size_type
Population size type.