YANE-Framework 1.1.0
Public Member Functions | Protected Attributes

yane::MPC::Cache Class Reference

Class to save, identify and access intermediate results of trajectories computed by the class OdeManager object.

Collaboration diagram for yane::MPC::Cache:
[legend]

List of all members.

Public Member Functions

bool & baseIsCalc ()
 Function to return information on the computing status.
 Cache (int horizon, yane::Model::Model *model, T_SHOOTINGDATA *sdata, int sdatalength, T_SYNCMODETYPE type=ASYNCMODE, int countcopy_u=1)
 Constructor.
bool & disturbedIsCalc (int uindex)
 Function to return information on the computing status.
int horizon ()
 Function to return the length of the horizon.
void lock ()
 Function to lock a thread.
yane::Model::Modelmodel ()
 Function to return the underlying class yane::Model::Model object.
double & objDisturbedValue (int uindex)
 Function to return the value of the cost function for disturbed control vector.
double * objHorizonValues ()
 Function to return the value of the cost function.
double & objValue (int uindex=0)
 Function to return the value of the cost function.
void setStamp (double *t, double *x, double *u)
 Function to define comparison criterion to prevent repeated evaluations.
T_SHOOTINGDATAstartData ()
 Function to return the shooting node information.
int startDataLength ()
 Function to return the number of shooting nodes.
double * t ()
 Function to return the pointer of the time grid.
double * trajectoryDisturbedValues (int uindex)
 Function to return the trajectory values for a disturbed control vector.
double * trajectoryValues (int uindex=0)
 Function to return the trajectory values.
double * u (int countcopy_u=0)
 Function to return the control variable.
void unlock ()
 Function to unlock a thread.
double * x ()
 Function to return the initial value of the state.
 ~Cache ()
 Destructor.

Protected Attributes

bool _baseiscalced
 Bool variable containing information on the computing status of the base problem.
double ** _cache
 Array to store all computed data such as time grid, state trajectories and control vectors.
double * _cmpstamp
 Array containing comparison values.
double ** _copy_u
 Array of control vectors used for parallel computing.
int _countcopy_u
 Number of threads.
int _dimu
 Dimension of the control vector.
int _dimx
 Dimension of the state vector.
double * _fxcache
 Array of cost function values.
double * _fxhorizonvalues
 Array of all cost function values.
int _horizon
 Length of the horizon.
bool * _iscalced
 Bool array containing information on the computing status.
yane::Utils::Mutex_locker
 Locking routine for threads.
yane::Model::Model_model
 Pointer of the underlying class yane::Model::Model object.
T_SHOOTINGDATA_sdata
 Strukture of the shooting nodes.
int _sdatalength
 Number of shooting nodes.
double * _stamp
 Array containing comparison values.
T_SYNCMODETYPE _type
 Synchronisation mode.

Constructor & Destructor Documentation

yane::MPC::Cache::Cache ( int  horizon,
yane::Model::Model model,
T_SHOOTINGDATA sdata,
int  sdatalength,
T_SYNCMODETYPE  type = ASYNCMODE,
int  countcopy_u = 1 
)

Constructor

Parameters:
horizonLength of the horizon
modelPointer of the used class yane::Model::Model object
sdataStructure of the shooting nodes
sdatalengthNumber of shooting nodes
typeType of synchronization
countcopy_uNumber of parallel threads
Exceptions:
yane::Utils::MemoryExceptionIs thrown if memory allocation fails

Member Function Documentation

bool & yane::MPC::Cache::baseIsCalc ( )

Function to return information on the computing status

Returns:
Information on the computing status
bool & yane::MPC::Cache::disturbedIsCalc ( int  uindex)

Function to return information on the computing status for a disturbed control vector

Parameters:
uindexDistinguished time instant of evaluation
Returns:
Information on the computing status for a disturbed control vector
int yane::MPC::Cache::horizon ( )

Function to return the length of the horizon

Returns:
Length of the horizon
yane::Model::Model * yane::MPC::Cache::model ( )

Function to return the underlying class yane::Model::Model object

Returns:
Pointer of the underlying class yane::Model::Model object
double & yane::MPC::Cache::objDisturbedValue ( int  uindex)

Function to return the value of the cost function for disturbed control vector

Parameters:
uindexDistinguished time instant of evaluation
Returns:
Value of the cost function for disturbed control vector at the distinguished time instant
double * yane::MPC::Cache::objHorizonValues ( )

Function to return the value of the cost function

Returns:
Pointer of the cost function values
double & yane::MPC::Cache::objValue ( int  uindex = 0)

Function to return the value of the cost function

Parameters:
uindexDistinguished time instant of evaluation
Returns:
Value of the cost function at the distinguished time instant
void yane::MPC::Cache::setStamp ( double *  t,
double *  x,
double *  u 
)

Function to define comparison criterion to prevent repeated evaluations

Parameters:
tTime grid
xEstimate of the initial value of the state
uControl vector
yane::MPC::T_SHOOTINGDATA * yane::MPC::Cache::startData ( )

Function to return the shooting node information

Returns:
Strukture of the shooting nodes
int yane::MPC::Cache::startDataLength ( )

Function to return the number of shooting nodes

Returns:
Number of shooting nodes
double * yane::MPC::Cache::t ( )

Function to return the pointer of the time grid

Returns:
Pointer of the time grid
double * yane::MPC::Cache::trajectoryDisturbedValues ( int  uindex)

Function to return the trajectory values for a disturbed control vector

Parameters:
uindexDistinguished time instant of evaluation
Returns:
Pointer of the trajectory values for a disturbed control vector at the distinguished time instant
double * yane::MPC::Cache::trajectoryValues ( int  uindex = 0)

Function to return the trajectory values

Parameters:
uindexDistinguished time instant of evaluation
Returns:
Pointer of the trajectory values at the distinguished time instant
double * yane::MPC::Cache::u ( int  countcopy_u = 0)

Function to return the control variable

Parameters:
countcopy_uNumber of associated thread
Returns:
Pointer of the control variable
double * yane::MPC::Cache::x ( )

Function to return the initial value of the state

Returns:
Pointer of the initial state vector