humoto
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
humoto::HierarchyLevel Class Reference

Detailed Description

This class represents one level of a hierarchy.

Definition at line 18 of file hierarchy_level.h.

#include <hierarchy_level.h>

Classes

class  TaskInfo
 Information about a task in a hierarchy. More...
 

Public Member Functions

 HierarchyLevel ()
 Default constructor. More...
 
void getAllConstraints (constraints::ContainerALU &constraints, const humoto::SolutionStructure &sol_structure) const
 Generates objective containing all constraints on this level. More...
 
void getEqualityConstraints (constraints::ContainerAB &eq_constraints, const humoto::SolutionStructure &sol_structure) const
 Generates (general) objective containing all equality constraints on this level. More...
 
void getGeneralConstraints (constraints::ContainerALU &constraints, const humoto::SolutionStructure &sol_structure) const
 Generates objective containing all general constraints on this level. More...
 
void getInequalityConstraints (constraints::ContainerAL &ineq_constraints, const humoto::SolutionStructure &sol_structure) const
 Generates (general) objective containing all equality constraints on this level. More...
 
std::size_t getNumberOfConstraints () const
 Get total number of constraints. More...
 
std::size_t getNumberOfEqualityConstraints () const
 Get number of inequality constraints. More...
 
std::size_t getNumberOfGeneralConstraints () const
 Get number of general constraints. More...
 
std::size_t getNumberOfInequalityConstraints () const
 Get number of inequality constraints. More...
 
std::size_t getNumberOfInequalityConstraintsOneSided () const
 Get number of inequality constraints, two-sided constraints counted twice. More...
 
std::size_t getNumberOfSimpleConstraints () const
 Get number of simple constraints. More...
 
void getObjective (Eigen::MatrixXd &H, Eigen::VectorXd &g) const
 Form objective of a QP. More...
 
void getSimpleConstraints (constraints::ContainerILU &constraints, const humoto::SolutionStructure &sol_structure) const
 Generates objective containing all simple constraints on this level. More...
 
bool isEquality () const
 True if all constraints on this level are equalitites. More...
 
bool isSimple () const
 True if all constraints on this level are simple. More...
 
void log (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="") const
 Log hierarchy as a set of tasks. More...
 

Public Attributes

std::list< TaskInfotasks_
 General constraints are added in the beginning, simple – in the end. It is easier to process tasks this way and formulation of the Hessian can be slightly faster, if objective includes general and simple tasks. More...
 

Protected Member Functions

void computeViolations (ViolationsConstraints &violations, const Solution &solution) const
 Compute violations based on the solution. More...
 
void determineActiveSet (ActiveSetConstraints &active_set, const Solution &solution) const
 Determine active set based on the solution. More...
 
void form (const humoto::SolutionStructure &sol_structure, const humoto::Model &model, const humoto::ControlProblem &control_problem, const bool is_active_set_guessing_enabled)
 Form hierarchy. More...
 
void guessActiveSet (ActiveSetConstraints &active_set) const
 Form active set guess. More...
 
void processActiveSet (const humoto::ActiveSetConstraints &active_set)
 Process actual active set: extract active sets of individual tasks. More...
 
void pushTask (TaskSharedPointer task_pointer)
 Add task to the optimization problem. More...
 

Private Member Functions

void reset ()
 Reset variables. More...
 

Private Attributes

std::size_t number_of_equality_constraints_
 
std::size_t number_of_general_constraints_
 
std::size_t number_of_simple_constraints_
 
std::size_t number_of_twosided_constraints_
 

Friends

class OptimizationProblem
 

Constructor & Destructor Documentation

◆ HierarchyLevel()

humoto::HierarchyLevel::HierarchyLevel ( )
inline

Default constructor.

Definition at line 243 of file hierarchy_level.h.

Member Function Documentation

◆ computeViolations()

void humoto::HierarchyLevel::computeViolations ( ViolationsConstraints violations,
const Solution solution 
) const
inlineprotected

Compute violations based on the solution.

Parameters
[out]violationsviolations
[in]solutionsolution

Definition at line 167 of file hierarchy_level.h.

◆ determineActiveSet()

void humoto::HierarchyLevel::determineActiveSet ( ActiveSetConstraints active_set,
const Solution solution 
) const
inlineprotected

Determine active set based on the solution.

Parameters
[out]active_setactive set
[in]solutionsolution

Definition at line 148 of file hierarchy_level.h.

◆ form()

void humoto::HierarchyLevel::form ( const humoto::SolutionStructure sol_structure,
const humoto::Model model,
const humoto::ControlProblem control_problem,
const bool  is_active_set_guessing_enabled 
)
inlineprotected

Form hierarchy.

Parameters
[in]sol_structureinitialized solution structure
[in]modelmodel of the system
[in]control_problemcontrol problem associated with the model
[in]is_active_set_guessing_enabled

Definition at line 54 of file hierarchy_level.h.

◆ getAllConstraints()

void humoto::HierarchyLevel::getAllConstraints ( constraints::ContainerALU constraints,
const humoto::SolutionStructure sol_structure 
) const
inline

Generates objective containing all constraints on this level.

Parameters
[in]sol_structurestructure of the solution
[out]constraintsconstraints

Definition at line 398 of file hierarchy_level.h.

◆ getEqualityConstraints()

void humoto::HierarchyLevel::getEqualityConstraints ( constraints::ContainerAB eq_constraints,
const humoto::SolutionStructure sol_structure 
) const
inline

Generates (general) objective containing all equality constraints on this level.

Parameters
[out]eq_constraintsequality constraints
[in]sol_structurestructure of the solution

Definition at line 346 of file hierarchy_level.h.

◆ getGeneralConstraints()

void humoto::HierarchyLevel::getGeneralConstraints ( constraints::ContainerALU constraints,
const humoto::SolutionStructure sol_structure 
) const
inline

Generates objective containing all general constraints on this level.

Parameters
[in]sol_structurestructure of the solution
[out]constraintsconstraints

Definition at line 423 of file hierarchy_level.h.

◆ getInequalityConstraints()

void humoto::HierarchyLevel::getInequalityConstraints ( constraints::ContainerAL ineq_constraints,
const humoto::SolutionStructure sol_structure 
) const
inline

Generates (general) objective containing all equality constraints on this level.

Parameters
[out]ineq_constraintsequality constraints
[in]sol_structurestructure of the solution

Definition at line 372 of file hierarchy_level.h.

◆ getNumberOfConstraints()

std::size_t humoto::HierarchyLevel::getNumberOfConstraints ( ) const
inline

Get total number of constraints.

Returns
total number of constraints

Definition at line 255 of file hierarchy_level.h.

◆ getNumberOfEqualityConstraints()

std::size_t humoto::HierarchyLevel::getNumberOfEqualityConstraints ( ) const
inline

Get number of inequality constraints.

Returns
number of inequality constraints

Definition at line 290 of file hierarchy_level.h.

◆ getNumberOfGeneralConstraints()

std::size_t humoto::HierarchyLevel::getNumberOfGeneralConstraints ( ) const
inline

Get number of general constraints.

Returns
number of general constraints

Definition at line 279 of file hierarchy_level.h.

◆ getNumberOfInequalityConstraints()

std::size_t humoto::HierarchyLevel::getNumberOfInequalityConstraints ( ) const
inline

Get number of inequality constraints.

Returns
number of inequality constraints

Definition at line 301 of file hierarchy_level.h.

◆ getNumberOfInequalityConstraintsOneSided()

std::size_t humoto::HierarchyLevel::getNumberOfInequalityConstraintsOneSided ( ) const
inline

Get number of inequality constraints, two-sided constraints counted twice.

Returns
number of inequality constraints

Definition at line 312 of file hierarchy_level.h.

◆ getNumberOfSimpleConstraints()

std::size_t humoto::HierarchyLevel::getNumberOfSimpleConstraints ( ) const
inline

Get number of simple constraints.

Returns
number of simple constraints

Definition at line 268 of file hierarchy_level.h.

◆ getObjective()

void humoto::HierarchyLevel::getObjective ( Eigen::MatrixXd &  H,
Eigen::VectorXd &  g 
) const
inline

Form objective of a QP.

Parameters
[out]Hhessian
[out]ggradient

Definition at line 479 of file hierarchy_level.h.

◆ getSimpleConstraints()

void humoto::HierarchyLevel::getSimpleConstraints ( constraints::ContainerILU constraints,
const humoto::SolutionStructure sol_structure 
) const
inline

Generates objective containing all simple constraints on this level.

Parameters
[in]sol_structurestructure of the solution
[out]constraintsconstraints

Definition at line 450 of file hierarchy_level.h.

◆ guessActiveSet()

void humoto::HierarchyLevel::guessActiveSet ( ActiveSetConstraints active_set) const
inlineprotected

Form active set guess.

Parameters
[out]active_setactive set guess

Definition at line 113 of file hierarchy_level.h.

◆ isEquality()

bool humoto::HierarchyLevel::isEquality ( ) const
inline

True if all constraints on this level are equalitites.

Returns
true/false

Definition at line 334 of file hierarchy_level.h.

◆ isSimple()

bool humoto::HierarchyLevel::isSimple ( ) const
inline

True if all constraints on this level are simple.

Returns
true/false

Definition at line 323 of file hierarchy_level.h.

◆ log()

void humoto::HierarchyLevel::log ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "" 
) const
inline

Log hierarchy as a set of tasks.

Parameters
[in,out]loggerlogger
[in]parentparent
[in]namename

Definition at line 505 of file hierarchy_level.h.

◆ processActiveSet()

void humoto::HierarchyLevel::processActiveSet ( const humoto::ActiveSetConstraints active_set)
inlineprotected

Process actual active set: extract active sets of individual tasks.

Parameters
[in]active_set

Definition at line 130 of file hierarchy_level.h.

◆ pushTask()

void humoto::HierarchyLevel::pushTask ( TaskSharedPointer  task_pointer)
inlineprotected

Add task to the optimization problem.

Parameters
[in,out]task_pointerpointer to a task

Definition at line 184 of file hierarchy_level.h.

◆ reset()

void humoto::HierarchyLevel::reset ( )
inlineprivate

Reset variables.

Definition at line 35 of file hierarchy_level.h.

Friends And Related Function Documentation

◆ OptimizationProblem

friend class OptimizationProblem
friend

Definition at line 21 of file hierarchy_level.h.

Member Data Documentation

◆ number_of_equality_constraints_

std::size_t humoto::HierarchyLevel::number_of_equality_constraints_
private

Definition at line 27 of file hierarchy_level.h.

◆ number_of_general_constraints_

std::size_t humoto::HierarchyLevel::number_of_general_constraints_
private

Definition at line 24 of file hierarchy_level.h.

◆ number_of_simple_constraints_

std::size_t humoto::HierarchyLevel::number_of_simple_constraints_
private

Definition at line 25 of file hierarchy_level.h.

◆ number_of_twosided_constraints_

std::size_t humoto::HierarchyLevel::number_of_twosided_constraints_
private

Definition at line 28 of file hierarchy_level.h.

◆ tasks_

std::list<TaskInfo> humoto::HierarchyLevel::tasks_

General constraints are added in the beginning, simple – in the end. It is easier to process tasks this way and formulation of the Hessian can be slightly faster, if objective includes general and simple tasks.

Definition at line 235 of file hierarchy_level.h.


The documentation for this class was generated from the following file: