28 #define HUMOTO_CONFIG_ENTRIES \ 29 HUMOTO_CONFIG_PARENT_CLASS(TaskGIB0) \ 30 HUMOTO_CONFIG_SCALAR_(variables_id) 31 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 48 variables_id_ = variables_id;
60 const double gain = 2.0,
61 const std::string &task_id =
"Minimize_All_Variables",
62 const std::string &variables_id =
"")
65 location_of_variables_.
set(0,0);
67 variables_id_ = variables_id;
84 if (variables_id_.size() == 0)
94 if ( location_of_variables != location_of_variables_ )
97 location_of_variables_ = location_of_variables;
101 Eigen::VectorXd &gains = getIGains();
103 gains.setConstant(location_of_variables_.
length_, getGain());
105 I.resize(location_of_variables_.
length_);
106 for (std::size_t i = 0; i < location_of_variables_.
length_; ++i)
108 I[i] = location_of_variables_.
offset_ + i;
129 #define HUMOTO_CONFIG_ENTRIES \ 130 HUMOTO_CONFIG_PARENT_CLASS(TaskGIB0) \ 131 HUMOTO_CONFIG_COMPOUND_(variables_indices) 132 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 149 const double gain = 2.0,
150 const std::string &task_id =
"Minimize_Selected_Variables")
153 variables_indices_ = var_indices;
168 getIndices() = variables_indices_;
170 Eigen::VectorXd &gains = getIGains();
171 gains.setConstant(variables_indices_.rows(), getGain());
193 const double gain = 2.0,
194 const std::string &task_id =
"Infeasible_Inequality_Task")
195 :
TaskALU(task_id.c_str(), gain)
197 number_of_variables_ = 0;
216 getA().resize(1, number_of_variables_);
217 getA().setConstant(1);
219 getLowerBounds().resize(1);
220 getUpperBounds().resize(1);
222 getLowerBounds()[0] = 1;
223 getUpperBounds()[0] = -1;
Abstract base class (for control problems)
std::size_t getNumberOfVariables() const
Get total number of variables in the solution vector.
Analog of 'sol_structure' struct in Octave code. [determine_solution_structure.m].
void form(const humoto::SolutionStructure &sol_structure, const humoto::Model &model_base, const humoto::ControlProblem &control_problem)
Form task.
std::size_t number_of_variables_
void form(const humoto::SolutionStructure &sol_structure, const humoto::Model &model_base, const humoto::ControlProblem &control_problem)
Form task.
Eigen::Matrix< unsigned int, Eigen::Dynamic, 1 > IndexVector
humoto::IndexVector variables_indices_
Same as humoto::TaskZeroVariables, but the variables need not to be continuous.
Infeasible inequality task for testing purposes.
[task_zerovars.m] Set given variables to zero, i.e. minimize these variables.
void set(const std::size_t offset, const std::size_t length)
Set location.
Location getSolutionPartLocation(const std::string &id) const
Get location of a data in the solution vector.
void form(const humoto::SolutionStructure &sol_structure, const humoto::Model &model_base, const humoto::ControlProblem &control_problem)
Form task.
The root namespace of HuMoTo.
TaskInfeasibleInequality(const double gain=2.0, const std::string &task_id="Infeasible_Inequality_Task")
Constructor.
Instances of this class are passed to a virtual method 'humoto::TaskBase::form()', so even though this class is basically useless in its present form we cannot avoid its definition using a template.
std::string variables_id_
Location location_of_variables_
void setVariablesID(const std::string &variables_id)
Set variables string id to a given value.
TaskZeroSelectedVariables(const humoto::IndexVector &var_indices, const double gain=2.0, const std::string &task_id="Minimize_Selected_Variables")
Constructor.
Location of a data chunk (offset + length).
TaskZeroVariables(const double gain=2.0, const std::string &task_id="Minimize_All_Variables", const std::string &variables_id="")
Constructor.