- 3.0.2 optimal control module.
|
The ConstraintBase Class is the base class for defining the non-linear optimization constraints. More...
#include <ConstraintContainerBase.h>
Public Types | |
typedef core::ControlVector< CONTROL_DIM, SCALAR > | input_vector_t |
typedef ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR > * | ConstraintBase_Raw_Ptr_t |
typedef Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > | VectorXs |
Public Member Functions | |
ConstraintContainerBase () | |
Default constructor. More... | |
ConstraintContainerBase (const ConstraintContainerBase &arg) | |
copy constructor More... | |
virtual | ~ConstraintContainerBase () |
Destructor. More... | |
virtual ConstraintBase_Raw_Ptr_t | clone () const =0 |
virtual void | setCurrentStateAndControl (const state_vector_t &x, const input_vector_t &u, const SCALAR t=SCALAR(0.0)) |
virtual VectorXs | evaluateIntermediate ()=0 |
Evaluates the intermediate constraints. More... | |
virtual VectorXs | evaluateTerminal ()=0 |
Evaluates the terminal constraints. More... | |
virtual size_t | getIntermediateConstraintsCount ()=0 |
Retrieves the number of intermediate constraints. More... | |
virtual size_t | getTerminalConstraintsCount ()=0 |
Retrieves the number of final constraints. More... | |
size_t | getConstraintsCount () |
Retrieves the total number of constraints. More... | |
VectorXs | getLowerBoundsIntermediate () const |
Retrieves the lower constraint bound on the intermediate constraints. More... | |
VectorXs | getLowerBoundsTerminal () const |
Retrieves the lower constraint bound on the terminal constraints. More... | |
VectorXs | getUpperBoundsIntermediate () const |
Retrieves the upper constraint bound on the intermediate constraints. More... | |
VectorXs | getUpperBoundsTerminal () const |
Retrieves the upper constraint bound on the terminal constraints. More... | |
VectorXs | getUpperBoundsViolationIntermediate () |
Retrieves the violation of the upper constraint bound on the intermediate constraints. More... | |
VectorXs | getLowerBoundsViolationIntermediate () |
Retrieves the violation of the lower constraint bound on the intermediate constraints. More... | |
VectorXs | getUpperBoundsViolationTerminal () |
Retrieves the violation of the upper constraint bound on the terminal constraints. More... | |
VectorXs | getLowerBoundsViolationTerminal () |
Retrieves the violation of the lower constraint bound on the terminal constraints. More... | |
VectorXs | getTotalBoundsViolationIntermediate () |
Retrieves the total violation of the constraints bounds on the intermediate constraints. More... | |
VectorXs | getTotalBoundsViolationTerminal () |
Retrieves the total violation of the constraints bounds on the terminal constraints. More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef core::StateVector< STATE_DIM, SCALAR > | state_vector_t |
Protected Member Functions | |
virtual void | update ()=0 |
Gets called by the setCurrentStateAndControl method. Can be used to update container properties. More... | |
Protected Attributes | |
state_vector_t | x_ |
input_vector_t | u_ |
SCALAR | t_ |
VectorXs | lowerBoundsIntermediate_ |
VectorXs | lowerBoundsTerminal_ |
VectorXs | upperBoundsIntermediate_ |
VectorXs | upperBoundsTerminal_ |
The ConstraintBase Class is the base class for defining the non-linear optimization constraints.
STATE_DIM | Dimension of the state vector |
CONTROL_DIM | Dimension of the control input vector An example for usage is given in the unit test @ref ConstraintTest.h |
typedef core::ControlVector<CONTROL_DIM, SCALAR> ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::input_vector_t |
typedef ConstraintContainerBase<STATE_DIM, CONTROL_DIM, SCALAR>* ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::ConstraintBase_Raw_Ptr_t |
typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, 1> ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs |
ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::ConstraintContainerBase | ( | ) |
Default constructor.
Default constructor, sets state, control and time to zero
ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::ConstraintContainerBase | ( | const ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR > & | arg | ) |
copy constructor
Copy constructor
|
virtual |
Destructor.
Destructor
|
pure virtual |
Clones the constraint.
Implemented in ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
|
virtual |
This methods updates the current time, state, and input in the class. It also call the user defined update() method, which can be used to make the implementation more efficient by executing shared calculations directly at the time of updating time, state and control.
[in] | t | current time |
[in] | x | state vector |
[in] | x | input vector |
References t, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, u, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::update(), x, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
pure virtual |
Evaluates the intermediate constraints.
Implemented in ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsViolationIntermediate(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTotalBoundsViolationIntermediate(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsViolationIntermediate().
|
pure virtual |
Evaluates the terminal constraints.
Implemented in ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsViolationTerminal(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTotalBoundsViolationTerminal(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsViolationTerminal().
|
pure virtual |
Retrieves the number of intermediate constraints.
Implemented in ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getConstraintsCount().
|
pure virtual |
Retrieves the number of final constraints.
Implemented in ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getConstraintsCount().
size_t ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getConstraintsCount | ( | ) |
Retrieves the total number of constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getIntermediateConstraintsCount(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTerminalConstraintsCount().
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsIntermediate | ( | ) | const |
Retrieves the lower constraint bound on the intermediate constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::lowerBoundsIntermediate_.
Referenced by ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::printout().
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsTerminal | ( | ) | const |
Retrieves the lower constraint bound on the terminal constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::lowerBoundsTerminal_.
Referenced by ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::printout().
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsIntermediate | ( | ) | const |
Retrieves the upper constraint bound on the intermediate constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::upperBoundsIntermediate_.
Referenced by ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::printout().
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsTerminal | ( | ) | const |
Retrieves the upper constraint bound on the terminal constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::upperBoundsTerminal_.
Referenced by ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::printout().
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsViolationIntermediate | ( | ) |
Retrieves the violation of the upper constraint bound on the intermediate constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateIntermediate(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::upperBoundsIntermediate_.
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsViolationIntermediate | ( | ) |
Retrieves the violation of the lower constraint bound on the intermediate constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateIntermediate(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::lowerBoundsIntermediate_.
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsViolationTerminal | ( | ) |
Retrieves the violation of the upper constraint bound on the terminal constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateTerminal(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::upperBoundsTerminal_.
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsViolationTerminal | ( | ) |
Retrieves the violation of the lower constraint bound on the terminal constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateTerminal(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::lowerBoundsTerminal_.
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTotalBoundsViolationIntermediate | ( | ) |
Retrieves the total violation of the constraints bounds on the intermediate constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateIntermediate(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::lowerBoundsIntermediate_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::upperBoundsIntermediate_.
ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTotalBoundsViolationTerminal | ( | ) |
Retrieves the total violation of the constraints bounds on the terminal constraints.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateTerminal(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::lowerBoundsTerminal_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::upperBoundsTerminal_.
|
protectedpure virtual |
Gets called by the setCurrentStateAndControl method. Can be used to update container properties.
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::setCurrentStateAndControl().
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef core::StateVector<STATE_DIM, SCALAR> ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_t |
|
protected |
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateTerminal(), ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputSparseIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputSparseTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateSparseIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateSparseTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateTerminal(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::setCurrentStateAndControl().
|
protected |
state vector
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateTerminal(), ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputSparseIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputSparseTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateSparseIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateSparseTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateTerminal(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::setCurrentStateAndControl().
|
protected |
control vector
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::evaluateTerminal(), ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputSparseIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputSparseTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianInputTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateSparseIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateSparseTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::jacobianStateTerminal(), and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::setCurrentStateAndControl().
|
protected |
time
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsIntermediate(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsViolationIntermediate(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTotalBoundsViolationIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeIntermediate(), and ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal().
|
protected |
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsTerminal(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBoundsViolationTerminal(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTotalBoundsViolationTerminal(), ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal(), and ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal().
|
protected |
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTotalBoundsViolationIntermediate(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsIntermediate(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsViolationIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeIntermediate(), and ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal().
|
protected |
Referenced by ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getTotalBoundsViolationTerminal(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsTerminal(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBoundsViolationTerminal(), ct::optcon::SwitchedLinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal(), and ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal().