![]() |
YANE-Framework 1.1.0
|
Implementation of a parenting manager class for solving control systems and computing their derivatives.
Public Member Functions | |
virtual void | calcObjectiveFunction (double *t, double *x, double *u, double *fx)=0 |
Function to evaluate the objective function using the supplied differential equation manager. | |
virtual void | calcObjectiveFunctionGrad (double *t, double *x, double *u, double *fx)=0 |
Function to evaluate the gradient of the objective function using the supplied differential equation manager. | |
virtual void | calcRestrFunction (double *t, double *x, double *u, double *fx)=0 |
Function to evaluate the restrictions using the supplied differential equation manager. | |
virtual void | calcRestrFunctionGrad (double *t, double *x, double *u, double *fx, yane::MinProg::T_MEMMODEL memmodel, int *needc=0)=0 |
Function to evaluate the Jacobian of the restrictions using the supplied differential equation manager. | |
virtual OdeManager * | clone ()=0 |
Function to generate a clone of the current OdeManager object. | |
virtual void * | configuration ()=0 |
Function to return an internal pointer of the configuration of the discretized object. | |
virtual void | getObjFunValues (double *t, double *x, double *u, double *fx, double *trajectory)=0 |
Function to compute the state and objective function values for each point of the current time grid. | |
virtual void | setAuxilliaryObjects (void *discretization, void *configuration=0)=0 |
Function to set required auxilliary objects. | |
virtual void | setFunctions (int horizont, int total_restr, yane::Model::Model *model, T_DISCRRESTRFUNC restrfunc, int sdatalength=0, T_SHOOTINGDATA *sdata=0)=0 |
Function to supply required data for defining and evaluating the restrictions. | |
virtual | ~OdeManager () |
Destructor. |
virtual void yane::MPC::OdeManager::calcObjectiveFunction | ( | double * | t, |
double * | x, | ||
double * | u, | ||
double * | fx | ||
) | [pure virtual] |
Function to evaluate the objective function using the supplied differential equation manager. This function has to be defined in every derived class.
t | Current time grid |
x | Initial state vector |
u | Control vector |
fx | Value of the objective function |
yane::OdeSolve::OdeSolEx | is thrown if the ode solver returns with an error message |
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.
virtual void yane::MPC::OdeManager::calcObjectiveFunctionGrad | ( | double * | t, |
double * | x, | ||
double * | u, | ||
double * | fx | ||
) | [pure virtual] |
Function to evaluate the gradient of the objective function using the supplied differential equation manager. This function has to be defined in every derived class.
t | Current time grid |
x | Initial state vector |
u | Control vector |
fx | Gradient of the objective function |
yane::OdeSolve::OdeSolEx | is thrown if the ode solver returns with an error message |
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.
virtual void yane::MPC::OdeManager::calcRestrFunction | ( | double * | t, |
double * | x, | ||
double * | u, | ||
double * | fx | ||
) | [pure virtual] |
Function to evaluate the restrictions using the supplied differential equation manager. This function has to be defined in every derived class.
t | Current time grid |
x | Initial state vector |
u | Control vector |
fx | Vector of restriction values |
yane::OdeSolve::OdeSolEx | is thrown if the ode solver returns with an error message |
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.
virtual void yane::MPC::OdeManager::calcRestrFunctionGrad | ( | double * | t, |
double * | x, | ||
double * | u, | ||
double * | fx, | ||
yane::MinProg::T_MEMMODEL | memmodel, | ||
int * | needc = 0 |
||
) | [pure virtual] |
Function to evaluate the Jacobian of the restrictions using the supplied differential equation manager. This function has to be defined in every derived class.
t | Current time grid |
x | Initial state vector |
u | Control vector |
fx | Jacobian of the restrictions |
memmodel | Memory model |
needc | Variable containing a list of the derivatives which need to be updated |
yane::OdeSolve::OdeSolEx | is thrown if the ode solver returns with an error message |
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.
virtual OdeManager* yane::MPC::OdeManager::clone | ( | ) | [pure virtual] |
Function to generate a clone of the current OdeManager object. The object itself is not initialized yet and has to be destructed manually.
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.
virtual void* yane::MPC::OdeManager::configuration | ( | ) | [pure virtual] |
Function to return an internal pointer of the configuration of the discretized object
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.
virtual void yane::MPC::OdeManager::getObjFunValues | ( | double * | t, |
double * | x, | ||
double * | u, | ||
double * | fx, | ||
double * | trajectory | ||
) | [pure virtual] |
Function to compute the state and objective function values for each point of the current time grid.
t | Current time grid |
x | Initial state vector |
u | Control vector |
fx | Objective function values for the current time grid |
trajectory | State vectors for the current time grid |
yane::OdeSolve::OdeSolEx | is thrown if the ode solver returns with an error message |
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.
virtual void yane::MPC::OdeManager::setAuxilliaryObjects | ( | void * | discretization, |
void * | configuration = 0 |
||
) | [pure virtual] |
Function to set required auxilliary objects
discretization | Class Discretization objects |
configuration | Class MPCConfig object |
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.
virtual void yane::MPC::OdeManager::setFunctions | ( | int | horizont, |
int | total_restr, | ||
yane::Model::Model * | model, | ||
T_DISCRRESTRFUNC | restrfunc, | ||
int | sdatalength = 0 , |
||
T_SHOOTINGDATA * | sdata = 0 |
||
) | [pure virtual] |
Function to supply required data for defining and evaluating the restrictions
horizont | Length of the horizon |
total_restr | Number of restrictions |
model | Pointer of the model |
restrfunc | Pointer of the restriction function |
sdatalength | Number of shooting nodes |
sdata | Structure of the shooting nodes |
yane::Utils::MemoryException | is thrown if internal memory allocation failed |
yane::OdeSolve::OdeSolEx | is thrown if the reset of the ode solver failed |
Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.