25 #include <boost/math/constants/constants.hpp>
27 #include "../exceptions.h"
30 #include "tens_comp_string.h"
32 static const std::vector<double> __constraint_tolerances__(
int c_dimension,
int ic_dimension)
34 std::vector<double> constraint_tolerances(c_dimension);
36 for(
int i=0; i<c_dimension-ic_dimension; i++) {
37 constraint_tolerances[i] = 0.0001;
40 for(
int i=c_dimension-ic_dimension; i<c_dimension; i++) {
41 constraint_tolerances[i] = 0.;
43 return constraint_tolerances;
46 namespace pagmo {
namespace problem {
59 const double lb[] = {0.05,0.25,2.};
60 const double ub[] = {2.,1.3,15.};
74 f[0] = x[0]*x[0] * x[1] * (x[2] + 2.);
80 c[0] = 1. - (x[1]*x[1]*x[1] * x[2]) / (71785. * x[0]*x[0]*x[0]*x[0]);
81 c[1] = (4. * x[1]*x[1] - x[0] * x[1]) /
82 ( 12566. * x[0]*x[0]*x[0] * (x[1] - x[0]) ) +
83 1./(5108. * x[0]*x[0]) - 1.;
84 c[2] = 1. - 140.45 * x[0] / (x[2] * x[1]*x[1]);
85 c[3] = (x[0] + x[1]) / 1.5 - 1.;
90 std::string retval(
"Tension compression string");
94 void tens_comp_string::initialize_best(
void)
96 std::vector<decision_vector> best_x;
100 const double x_vector[] = {0.051728, 0.357644, 11.244543};
103 std::copy(x_vector,x_vector + x_dimension,x.begin());
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
std::vector< double > decision_vector
Decision vector type.
void set_best_x(const std::vector< decision_vector > &)
Sets the best known decision vectors.
void compute_constraints_impl(constraint_vector &, const decision_vector &) const
Implementation of the constraint function.
base_ptr clone() const
Clone method.
std::string get_name() const
Get problem's name.
std::vector< double > fitness_vector
Fitness vector type.
std::vector< double > constraint_vector
Constraint vector type.
tens_comp_string()
Constructor.
The tension compression string design problem: Constrained Real-Parameter Optimization.
void set_bounds(const decision_vector &, const decision_vector &)
Bounds setter from pagmo::decision_vector.
void objfun_impl(fitness_vector &, const decision_vector &) const
Implementation of the objective function.