template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Assigns the optimal control problem to the solver.
Most solvers will require some computational effort to adjust to a new problem. Therefore, when only adjusting a problem, it is more efficient to adjust individual properties instead of assigning an entirely new problem. To adjust properties, you can use
- Returns
- returns true if the optimal control structure is valid for the given solver
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
solve the optimal control problem
- Returns
- true if solve succeeded, false otherwise.
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::configureFromFile().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Get the optimized control policy to the optimal control problem
- Returns
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Get the optimized trajectory to the optimal control problem
- Returns
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Get the optimal feedforward control input corresponding to the optimal trajectory
- Returns
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Get the time indices corresponding to the solution
- Returns
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Set the initial guess used by the solver (not all solvers might support initial guesses)
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Get the time horizon the solver currently operates on.
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Change the time horizon the solver operates on.
This function does not need to be called if setProblem() has been called with an OptConProblem that had the correct time horizon set.
Implemented in ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >, and ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration(), and ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::setProblem().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
Change the initial state for the optimal control problem.
This function does not need to be called if setProblem() has been called with an OptConProblem that had the correct initial state set
Implemented in ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >, and ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration(), and ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::setProblem().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual void ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::changeCostFunction |
( |
const typename OptConProblem_t::CostFunctionPtr_t & |
cf | ) |
|
|
pure virtual |
Change the cost function.
This function does not need to be called if setProblem() has been called with an OptConProblem that had the correct cost function
Implemented in ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration(), and ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::setProblem().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual void ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::changeNonlinearSystem |
( |
const typename OptConProblem_t::DynamicsPtr_t & |
dyn | ) |
|
|
pure virtual |
Change the nonlinear system.
This function does not need to be called if setProblem() has been called with an OptConProblem that had the correct nonlinear system
Implemented in ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration(), and ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::setProblem().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual void ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::changeLinearSystem |
( |
const typename OptConProblem_t::LinearPtr_t & |
lin | ) |
|
|
pure virtual |
Change the linear system.
This function does not need to be called if setProblem() has been called with an OptConProblem that had the correct linear system
Implemented in ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::runIteration(), and ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::setProblem().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual void ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::changeInputBoxConstraints |
( |
const typename OptConProblem_t::ConstraintPtr_t |
con | ) |
|
|
inlinevirtual |
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual void ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::changeGeneralConstraints |
( |
const typename OptConProblem_t::ConstraintPtr_t |
con | ) |
|
|
inlinevirtual |
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual std::vector<typename OptConProblem_t::DynamicsPtr_t>& ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::getNonlinearSystemsInstances |
( |
| ) |
|
|
pure virtual |
Direct accessor to the system instances.
- Warning
- {Use this only when performance absolutely matters and if you know what you are doing. Otherwise use e.g. changeNonlinearSystem() to change the system dynamics in a safe and easy way. You should especially not change the size of the vector or modify each entry differently.}
- Returns
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::getCost().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual std::vector<typename OptConProblem_t::LinearPtr_t>& ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::getLinearSystemsInstances |
( |
| ) |
|
|
pure virtual |
Direct accessor to the linear system instances.
- Warning
- {Use this only when performance absolutely matters and if you know what you are doing. Otherwise use e.g. changeLinearSystem() to change the system dynamics in a safe and easy way. You should especially not change the size of the vector or modify each entry differently.}
- Returns
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::getCost().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual std::vector<typename OptConProblem_t::CostFunctionPtr_t>& ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::getCostFunctionInstances |
( |
| ) |
|
|
pure virtual |
Direct accessor to the cost function instances.
- Warning
- {Use this only when performance absolutely matters and if you know what you are doing. Otherwise use e.g. changeCostFunction() to change the system dynamics in a safe and easy way. You should especially not change the size of the vector or modify each entry differently.}
- Returns
Implemented in ct::optcon::DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, and ct::optcon::NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >.
Referenced by ct::optcon::OptConSolver< DmsSolver< STATE_DIM, CONTROL_DIM, SCALAR >, DmsPolicy< STATE_DIM, CONTROL_DIM, SCALAR >, DmsSettings, STATE_DIM, CONTROL_DIM, SCALAR >::getCost().
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual std::vector<typename OptConProblem_t::ConstraintPtr_t>& ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::getInputBoxConstraintsInstances |
( |
| ) |
|
|
inlinevirtual |
template<typename DERIVED, typename POLICY, typename SETTINGS, size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double, bool CONTINUOUS = true>
virtual std::vector<typename OptConProblem_t::ConstraintPtr_t>& ct::optcon::OptConSolver< DERIVED, POLICY, SETTINGS, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS >::getGeneralConstraintsInstances |
( |
| ) |
|
|
inlinevirtual |