humoto
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
humoto::OptimizationProblem Class Reference

Detailed Description

An optimization problem [initialize_stack.m, simulation_loop.m].

A stack of tasks / hierarchy, convertible to a QP in some cases.

Definition at line 20 of file hierarchy.h.

#include <hierarchy.h>

Inheritance diagram for humoto::OptimizationProblem:
Inheritance graph

Public Member Functions

 OptimizationProblem ()
 Default constructor. More...
 
void computeViolations (humoto::Violations &violations, const humoto::Solution &solution) const
 Compute violations based on the solution. More...
 
void determineActiveSet (humoto::ActiveSet &active_set, const humoto::Solution &solution) const
 Determine active set based on the solution. This active set may differ from the active set returned by the solver due to tolerances. More...
 
void form (humoto::Solution &solution, const humoto::Model &model, const humoto::ControlProblem &control_problem)
 Form hierarchy. More...
 
void form (humoto::Solution &solution, humoto::ActiveSet &active_set_guess, const humoto::Model &model, const humoto::ControlProblem &control_problem)
 Form hierarchy. More...
 
void form (humoto::Solution &solution, humoto::Solution &solution_guess, humoto::ActiveSet &active_set_guess, const humoto::Model &model, const humoto::ControlProblem &control_problem, const humoto::Solution &old_solution)
 Form hierarchy. More...
 
void form (humoto::Solution &solution, humoto::Solution &solution_guess, const humoto::Model &model, const humoto::ControlProblem &control_problem, const humoto::Solution &old_solution)
 Form hierarchy. More...
 
std::size_t getNumberOfLevels () const
 Returns number of levels in the hierarchy. More...
 
template<class t_QPConstraints >
void getQPProblem (QPProblemBase< t_QPConstraints > &qp_problem, const humoto::SolutionStructure &sol_structure, const bool initialize_upper_triangular_part=true) const
 Form a QP problem. More...
 
void initializeActiveSet (humoto::ActiveSet &active_set) const
 Initialize active set of the hierarchy. More...
 
void log (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="") const
 Log hierarchy as a set of tasks. More...
 
const humoto::HierarchyLeveloperator[] (const std::size_t level_index) const
 Access hierarchy level (const) More...
 
humoto::HierarchyLeveloperator[] (const std::size_t level_index)
 Access hierarchy level. More...
 
void processActiveSet (const humoto::ActiveSet &active_set)
 Process actual active set: extract active sets of individual tasks. More...
 
void pushTask (TaskSharedPointer task_pointer, const std::size_t level_index)
 Add task to the optimization problem. More...
 
void reset (const std::size_t number_of_levels)
 Reset the optimization problem. More...
 

Protected Member Functions

void formHierarchy (humoto::Solution &solution, const humoto::Model &model, const humoto::ControlProblem &control_problem, const bool is_active_set_guessing_enabled)
 Form hierarchy. More...
 
void guessActiveSet (ActiveSet &active_set) const
 Form active set guess. More...
 

Protected Attributes

std::vector< humoto::HierarchyLevelhierarchy_
 
std::vector< std::size_t > number_of_constraints_
 
std::size_t number_of_levels_
 

Constructor & Destructor Documentation

◆ OptimizationProblem()

humoto::OptimizationProblem::OptimizationProblem ( )
inline

Default constructor.

Definition at line 77 of file hierarchy.h.

Member Function Documentation

◆ computeViolations()

void humoto::OptimizationProblem::computeViolations ( humoto::Violations violations,
const humoto::Solution solution 
) const
inline

Compute violations based on the solution.

Parameters
[out]violationsviolations
[in]solutionsolution

Definition at line 221 of file hierarchy.h.

◆ determineActiveSet()

void humoto::OptimizationProblem::determineActiveSet ( humoto::ActiveSet active_set,
const humoto::Solution solution 
) const
inline

Determine active set based on the solution. This active set may differ from the active set returned by the solver due to tolerances.

Parameters
[out]active_setactive set
[in]solutionsolution

Definition at line 202 of file hierarchy.h.

◆ form() [1/4]

void humoto::OptimizationProblem::form ( humoto::Solution solution,
const humoto::Model model,
const humoto::ControlProblem control_problem 
)
inline

Form hierarchy.

Parameters
[out]solutioninitialized solution
[in]modelmodel of the system
[in]control_problemcontrol problem associated with the model

Definition at line 106 of file hierarchy.h.

◆ form() [2/4]

void humoto::OptimizationProblem::form ( humoto::Solution solution,
humoto::ActiveSet active_set_guess,
const humoto::Model model,
const humoto::ControlProblem control_problem 
)
inline

Form hierarchy.

Parameters
[out]solutioninitialized solution
[out]active_set_guessactive set guess
[in]modelmodel of the system
[in]control_problemcontrol problem associated with the model

Definition at line 122 of file hierarchy.h.

◆ form() [3/4]

void humoto::OptimizationProblem::form ( humoto::Solution solution,
humoto::Solution solution_guess,
humoto::ActiveSet active_set_guess,
const humoto::Model model,
const humoto::ControlProblem control_problem,
const humoto::Solution old_solution 
)
inline

Form hierarchy.

Parameters
[out]solutioninitialized solution
[out]solution_guessguess of the solution
[out]active_set_guessactive set guess
[in]modelmodel of the system
[in]control_problemcontrol problem associated with the model
[in]old_solutionold solution

Definition at line 142 of file hierarchy.h.

◆ form() [4/4]

void humoto::OptimizationProblem::form ( humoto::Solution solution,
humoto::Solution solution_guess,
const humoto::Model model,
const humoto::ControlProblem control_problem,
const humoto::Solution old_solution 
)
inline

Form hierarchy.

Parameters
[out]solutioninitialized solution
[out]solution_guessguess of the solution
[in]modelmodel of the system
[in]control_problemcontrol problem associated with the model
[in]old_solutionold solution

Definition at line 164 of file hierarchy.h.

◆ formHierarchy()

void humoto::OptimizationProblem::formHierarchy ( humoto::Solution solution,
const humoto::Model model,
const humoto::ControlProblem control_problem,
const bool  is_active_set_guessing_enabled 
)
inlineprotected

Form hierarchy.

Parameters
[out]solutioninitialized solution
[in]modelmodel of the system
[in]control_problemcontrol problem associated with the model
[in]is_active_set_guessing_enabled

Definition at line 39 of file hierarchy.h.

◆ getNumberOfLevels()

std::size_t humoto::OptimizationProblem::getNumberOfLevels ( ) const
inline

Returns number of levels in the hierarchy.

Returns
number of levels in the hierarchy.

Definition at line 280 of file hierarchy.h.

◆ getQPProblem()

template<class t_QPConstraints >
void humoto::OptimizationProblem::getQPProblem ( QPProblemBase< t_QPConstraints > &  qp_problem,
const humoto::SolutionStructure sol_structure,
const bool  initialize_upper_triangular_part = true 
) const
inline

Form a QP problem.

Template Parameters
t_QPConstraintsQP constraints type
Parameters
[in]qp_problemQP problem
[in]sol_structuresolution structure
[in]initialize_upper_triangular_partof the Hessian

Definition at line 329 of file hierarchy.h.

◆ guessActiveSet()

void humoto::OptimizationProblem::guessActiveSet ( ActiveSet active_set) const
inlineprotected

Form active set guess.

Parameters
[out]active_setactive set guess

Definition at line 62 of file hierarchy.h.

◆ initializeActiveSet()

void humoto::OptimizationProblem::initializeActiveSet ( humoto::ActiveSet active_set) const
inline

Initialize active set of the hierarchy.

Parameters
[in,out]active_setactive set.

Definition at line 312 of file hierarchy.h.

◆ log()

void humoto::OptimizationProblem::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 293 of file hierarchy.h.

◆ operator[]() [1/2]

const humoto::HierarchyLevel& humoto::OptimizationProblem::operator[] ( const std::size_t  level_index) const
inline

Access hierarchy level (const)

Parameters
[in]level_indexindex of the level
Returns
reference to a hierarchy level.

Definition at line 256 of file hierarchy.h.

◆ operator[]() [2/2]

humoto::HierarchyLevel& humoto::OptimizationProblem::operator[] ( const std::size_t  level_index)
inline

Access hierarchy level.

Parameters
[in]level_indexindex of the level
Returns
reference to a hierarchy level.

Definition at line 269 of file hierarchy.h.

◆ processActiveSet()

void humoto::OptimizationProblem::processActiveSet ( const humoto::ActiveSet active_set)
inline

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

Parameters
[in]active_set

Definition at line 181 of file hierarchy.h.

◆ pushTask()

void humoto::OptimizationProblem::pushTask ( TaskSharedPointer  task_pointer,
const std::size_t  level_index 
)
inline

Add task to the optimization problem.

Parameters
[in,out]task_pointerpointer to a task
[in]level_indexlevel in the hierarchy
Todo:
It might be a good idea to check for collisions of task ids.

Definition at line 91 of file hierarchy.h.

◆ reset()

void humoto::OptimizationProblem::reset ( const std::size_t  number_of_levels)
inline

Reset the optimization problem.

Parameters
[in]number_of_levelsnew number of levels

Definition at line 238 of file hierarchy.h.

Member Data Documentation

◆ hierarchy_

std::vector< humoto::HierarchyLevel > humoto::OptimizationProblem::hierarchy_
protected

Definition at line 25 of file hierarchy.h.

◆ number_of_constraints_

std::vector< std::size_t > humoto::OptimizationProblem::number_of_constraints_
protected

Definition at line 26 of file hierarchy.h.

◆ number_of_levels_

std::size_t humoto::OptimizationProblem::number_of_levels_
protected

Definition at line 23 of file hierarchy.h.


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