29 namespace pagmo {
namespace algorithm {
31 void worhp::define_param_map() {
32 m_param_map[
"AcceptTolFeas"] = 1;
33 m_param_map[
"AcceptTolOpti"] = 2;
34 m_param_map[
"TolFeas"] = 3;
35 m_param_map[
"TolComp"] = 4;
36 m_param_map[
"TolOpti"] = 5;
37 m_param_map[
"NLPprint"] = 6;
38 m_param_map[
"InitialLMest"] = 7;
39 m_param_map[
"MaxIter"] = 8;
42 void worhp::set_param(
const std::string name,
const double value)
45 auto el = m_param_map.find(name);
46 if (el == m_param_map.end()) {
47 pagmo_throw(value_error,
"Unknown parameter name, cannot set it.");
50 switch ( m_param_map[name] ) {
52 m_params.AcceptTolFeas = value;
55 m_params.AcceptTolOpti = value;
58 m_params.TolFeas = value;
61 m_params.TolComp = value;
64 m_params.TolOpti = value;
67 m_params.NLPprint = value;
70 m_params.InitialLMest = value;
73 m_params.MaxIter = value;
76 pagmo_throw(value_error,
"You should not be here!!");
80 double worhp::get_param(
const std::string name)
const
83 auto el = m_param_map.find(name);
84 if (el == m_param_map.end()) {
85 pagmo_throw(value_error,
"Unknown parameter name, cannot get it.");
89 std::map<std::string, int> map_copy = m_param_map;
94 switch ( map_copy[name] ) {
96 retval = m_params.AcceptTolFeas;
99 retval = m_params.AcceptTolOpti;
102 retval = m_params.TolFeas;
105 retval = m_params.TolComp;
108 retval = m_params.TolOpti;
111 retval = m_params.NLPprint;
114 retval = m_params.InitialLMest;
117 retval = m_params.MaxIter;
120 pagmo_throw(value_error,
"You should not be here!!");
125 std::vector<std::string> worhp::get_available_parameters()
const
127 std::vector<std::string> retval;
128 for(
auto it = m_param_map.begin(); it != m_param_map.end(); ++it) {
129 retval.push_back(it->first);