Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

A user class for auto-generation of OCP solvers. More...

#include <ocp_export.hpp>

Inheritance diagram for OCPexport:
Inheritance graph
[legend]

Public Member Functions

virtual returnValue exportCode (const std::string &dirName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16)
 
 OCPexport ()
 
 OCPexport (const OCP &_ocp)
 
returnValue printDimensionsQP ()
 
virtual ~OCPexport ()
 
- Public Member Functions inherited from ExportModule
 ExportModule ()
 
virtual ~ExportModule ()
 
- Public Member Functions inherited from UserInteraction
virtual int addPlotWindow (PlotWindow &_window)
 
virtual int operator<< (PlotWindow &_window)
 
virtual int operator<< (LogRecord &_record)
 
UserInteractionoperator= (const UserInteraction &rhs)
 
 UserInteraction ()
 
 UserInteraction (const UserInteraction &rhs)
 
virtual ~UserInteraction ()
 
- Public Member Functions inherited from Options
returnValue addOptionsList ()
 
returnValue ensureConsistency ()
 
returnValue ensureConsistency ()
 
returnValue get (OptionsName name, int &value) const
 
returnValue get (OptionsName name, double &value) const
 
returnValue get (OptionsName name, std::string &value) const
 
returnValue get (uint idx, OptionsName name, int &value) const
 
returnValue get (uint idx, OptionsName name, double &value) const
 
returnValue get (uint idx, OptionsName name, std::string &value) const
 
uint getNumOptionsLists () const
 
Options getOptions (uint idx) const
 
Optionsoperator= (const Options &rhs)
 
Optionsoperator= (const Options &rhs)
 
 Options ()
 
 Options ()
 
 Options (const Options &rhs)
 
 Options (const Options &rhs)
 
 Options ()
 
 Options (const OptionsList &_optionsList)
 
returnValue print () const
 
returnValue print () const
 
returnValue printOptionsList () const
 
returnValue printOptionsList (uint idx) const
 
returnValue set (OptionsName name, int value)
 
returnValue set (OptionsName name, double value)
 
returnValue set (OptionsName name, const std::string &value)
 
returnValue set (uint idx, OptionsName name, int value)
 
returnValue set (uint idx, OptionsName name, double value)
 
returnValue set (uint idx, OptionsName name, const std::string &value)
 
returnValue setOptions (const Options &arg)
 
returnValue setOptions (uint idx, const Options &arg)
 
returnValue setToDefault ()
 
returnValue setToDefault ()
 
returnValue setToFast ()
 
returnValue setToFast ()
 
returnValue setToMPC ()
 
returnValue setToReliable ()
 
returnValue setToReliable ()
 
 ~Options ()
 
 ~Options ()
 
virtual ~Options ()
 
- Public Member Functions inherited from Logging
int addLogRecord (LogRecord &record)
 
returnValue getAll (LogName _name, MatrixVariablesGrid &values) const
 
returnValue getFirst (LogName _name, DMatrix &firstValue) const
 
returnValue getFirst (LogName _name, VariablesGrid &firstValue) const
 
returnValue getLast (LogName _name, DMatrix &lastValue) const
 
returnValue getLast (LogName _name, VariablesGrid &lastValue) const
 
returnValue getLogRecord (LogRecord &_record) const
 
uint getNumLogRecords () const
 
 Logging ()
 
int operator<< (LogRecord &record)
 
returnValue printLoggingInfo () const
 
returnValue printNumDoubles () const
 
returnValue setAll (LogName _name, const MatrixVariablesGrid &values)
 
returnValue setLast (LogName _name, const DMatrix &value, double time=-INFTY)
 
returnValue setLast (LogName _name, VariablesGrid &value, double time=-INFTY)
 
returnValue updateLogRecord (LogRecord &_record) const
 
virtual ~Logging ()
 
- Public Member Functions inherited from Plotting
int addPlotWindow (PlotWindow &_window)
 
uint getNumPlotWindows () const
 
returnValue getPlotWindow (uint idx, PlotWindow &_window) const
 
returnValue getPlotWindow (PlotWindow &_window) const
 
int operator<< (PlotWindow &_window)
 
Plottingoperator= (const Plotting &rhs)
 
virtual returnValue plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
 Plotting ()
 
 Plotting (const Plotting &rhs)
 
virtual returnValue replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
virtual ~Plotting ()
 

Protected Member Functions

returnValue checkConsistency () const
 
returnValue collectDataDeclarations (ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
 
returnValue collectFunctionDeclarations (ExportStatementBlock &declarations) const
 
returnValue exportAcadoHeader (const std::string &_dirName, const std::string &_fileName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
 
returnValue setup ()
 
- Protected Member Functions inherited from ExportModule
returnValue setupOptions ()
 
- Protected Member Functions inherited from UserInteraction
virtual returnValue getPlotDataFromMemberLoggings (PlotWindow &_window) const
 
BlockStatus getStatus () const
 
returnValue setStatus (BlockStatus _status)
 
- Protected Member Functions inherited from Options
returnValue addOption (OptionsName name, int value)
 
returnValue addOption (OptionsName name, double value)
 
returnValue addOption (OptionsName name, const std::string &value)
 
returnValue addOption (uint idx, OptionsName name, int value)
 
returnValue addOption (uint idx, OptionsName name, double value)
 
returnValue addOption (uint idx, OptionsName name, const std::string &value)
 
returnValue clearOptionsList ()
 
returnValue copy (const Options &rhs)
 
returnValue copy (const Options &rhs)
 
returnValue declareOptionsUnchanged ()
 
returnValue declareOptionsUnchanged (uint idx)
 
BooleanType haveOptionsChanged () const
 
BooleanType haveOptionsChanged (uint idx) const
 
- Protected Member Functions inherited from Logging
virtual returnValue setupLogging ()
 

Protected Attributes

std::shared_ptr< IntegratorExportintegrator
 
OCP ocp
 
std::shared_ptr< ExportNLPSolversolver
 
- Protected Attributes inherited from ExportModule
std::string commonHeaderName
 
- Protected Attributes inherited from UserInteraction
BlockStatus status
 
- Protected Attributes inherited from Options
std::vector< OptionsListlists
 
- Protected Attributes inherited from Logging
std::vector< LogRecordlogCollection
 
int logIdx
 
- Protected Attributes inherited from Plotting
PlotCollection plotCollection
 

Additional Inherited Members

- Public Attributes inherited from Options
real_t boundRelaxation
 
real_t boundTolerance
 
int dropBoundPriority
 
int_t dropBoundPriority
 
int dropEqConPriority
 
int_t dropEqConPriority
 
int dropIneqConPriority
 
int_t dropIneqConPriority
 
int enableCholeskyRefactorisation
 
int_t enableCholeskyRefactorisation
 
int enableDriftCorrection
 
int_t enableDriftCorrection
 
BooleanType enableDropInfeasibles
 
BooleanType enableEqualities
 
BooleanType enableFarBounds
 
BooleanType enableFlippingBounds
 
BooleanType enableFullLITests
 
BooleanType enableInertiaCorrection
 
BooleanType enableNZCTests
 
BooleanType enableRamping
 
BooleanType enableRegularisation
 
real_t epsDen
 
real_t epsFlipping
 
real_t epsIterRef
 
real_t epsLITests
 
real_t epsNum
 
real_t epsNZCTests
 
real_t epsRegularisation
 
real_t finalRamping
 
real_t growFarBounds
 
real_t initialFarBounds
 
real_t initialRamping
 
SubjectToStatus initialStatusBounds
 
real_t maxDualJump
 
real_t maxPrimalJump
 
int numRefinementSteps
 
int_t numRefinementSteps
 
int numRegularisationSteps
 
int_t numRegularisationSteps
 
PrintLevel printLevel
 
real_t rcondSMin
 
real_t terminationTolerance
 

Detailed Description

A user class for auto-generation of OCP solvers.

The class OCPexport is a user-interface to automatically generate tailored algorithms for fast model predictive control and moving horizon estimation. It takes an optimal control problem (OCP) formulation and generates code based on given user options, e.g specifying the number of integrator steps or the online QP solver.

\authors Boris Houska, Hans Joachim Ferreau, Milan Vukov

\note Based on the old mpc_export class.

Definition at line 57 of file ocp_export.hpp.

Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO OCPexport::OCPexport ( )

Default constructor.

Definition at line 54 of file ocp_export.cpp.

OCPexport::OCPexport ( const OCP _ocp)

Constructor which takes OCP formulation.

@param[in] _ocp             OCP formulation for code export.

Definition at line 60 of file ocp_export.cpp.

virtual OCPexport::~OCPexport ( )
inlinevirtual

Destructor.

Definition at line 72 of file ocp_export.hpp.

Member Function Documentation

returnValue OCPexport::checkConsistency ( ) const
protected

Checks whether OCP formulation is compatible with code export capabilities.

\return SUCCESSFUL_RETURN, \n
        RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT, \n
        RET_ONLY_ODE_FOR_CODE_EXPORT, \n
        RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT, \n
        RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT, \n
        RET_ONLY_EQUIDISTANT_GRID_FOR_CODE_EXPORT, \n
        RET_ONLY_BOUNDS_FOR_CODE_EXPORT

Definition at line 654 of file ocp_export.cpp.

returnValue OCPexport::collectDataDeclarations ( ExportStatementBlock declarations,
ExportStruct  dataStruct = ACADO_ANY 
) const
protectedvirtual

Collects all data declarations of the auto-generated sub-modules to given list of declarations.

Parameters
[in]declarationsList of declarations.
Returns
SUCCESSFUL_RETURN,
RET_UNABLE_TO_EXPORT_CODE

Implements ExportModule.

Definition at line 703 of file ocp_export.cpp.

returnValue OCPexport::collectFunctionDeclarations ( ExportStatementBlock declarations) const
protectedvirtual

Collects all function (forward) declarations of the auto-generated sub-modules to given list of declarations.

Parameters
[in]declarationsList of declarations.
Returns
SUCCESSFUL_RETURN,
RET_UNABLE_TO_EXPORT_CODE

Implements ExportModule.

Definition at line 717 of file ocp_export.cpp.

returnValue OCPexport::exportAcadoHeader ( const std::string &  _dirName,
const std::string &  _fileName,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const
protectedvirtual

Exports main header file for using the exported MHE algorithm.

@param[in] _dirName                 Name of directory to be used to export file.
@param[in] _fileName                Name of file to be exported.
@param[in] _realString              std::string to be used to declare real variables.
@param[in] _intString               std::string to be used to declare integer variables.
@param[in] _precision               Number of digits to be used for exporting real values.

\return SUCCESSFUL_RETURN

Implements ExportModule.

Definition at line 729 of file ocp_export.cpp.

returnValue OCPexport::exportCode ( const std::string &  dirName,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
)
virtual

Exports all files of the auto-generated code into the given directory.

@param[in] dirName                  Name of directory to be used to export files.
@param[in] _realString              std::string to be used to declare real variables.
@param[in] _intString               std::string to be used to declare integer variables.
@param[in] _precision               Number of digits to be used for exporting real values.

\return SUCCESSFUL_RETURN

Implements ExportModule.

Definition at line 68 of file ocp_export.cpp.

returnValue OCPexport::printDimensionsQP ( )

Prints dimensions (i.e. number of variables and constraints) of underlying QP.

\return SUCCESSFUL_RETURN

Definition at line 464 of file ocp_export.cpp.

returnValue OCPexport::setup ( )
protected

Sets-up code export and initializes underlying export modules.

\return SUCCESSFUL_RETURN, \n
        RET_INVALID_OPTION, \n
        RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT, \n
        RET_ONLY_ODE_FOR_CODE_EXPORT, \n
        RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT, \n
        RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT, \n
        RET_ONLY_EQUIDISTANT_GRID_FOR_CODE_EXPORT, \n
        RET_ONLY_BOUNDS_FOR_CODE_EXPORT, \n
        RET_UNABLE_TO_EXPORT_CODE

Definition at line 476 of file ocp_export.cpp.

Member Data Documentation

std::shared_ptr< IntegratorExport > OCPexport::integrator
protected

Shared pointer to a tailored integrator.

Definition at line 162 of file ocp_export.hpp.

OCP OCPexport::ocp
protected

Internal copy of the OCP object.

Definition at line 168 of file ocp_export.hpp.

std::shared_ptr< ExportNLPSolver > OCPexport::solver
protected

Shared pointer to an NLP solver.

Definition at line 165 of file ocp_export.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:25