ACADO Toolkit
1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
|
User-interface to automatically generate simulation algorithms for fast optimal control. More...
#include <sim_export.hpp>
Public Member Functions | |
SIMexport (const uint simIntervals=1, const double totalTime=1.0) | |
Default constructor. | |
SIMexport (const SIMexport &arg) | |
Copy constructor (deep copy). | |
virtual | ~SIMexport () |
Destructor. | |
SIMexport & | operator= (const SIMexport &arg) |
Assignment operator (deep copy). | |
virtual returnValue | exportCode (const String &dirName, const String &_realString="real_t", const String &_intString="int", int _precision=16) |
Exports all files of the auto-generated code into the given directory. | |
returnValue | exportAcadoHeader (const String &_dirName, const String &_fileName, const String &_realString="real_t", const String &_intString="int", int _precision=16) const |
Exports main header file for using the exported algorithm. | |
virtual returnValue | exportAndRun (const String &dirName, const String &initStates, const String &controls, const String &results=String("results.txt"), const String &ref=String("ref.txt")) |
Exports all files of the auto-generated code into the given directory and runs the test to evaluate the performance of the exported integrator. | |
virtual returnValue | setReference (const String &reference, const std::vector< String > &outputReference=*(new std::vector< String >())) |
This function should be used if the user wants to provide the file containing the reference solution, to which the results of the integrator are compared. | |
virtual returnValue | setTimingSteps (uint _timingSteps) |
This function sets the number of integration steps performed for the timing results. | |
virtual returnValue | printDetails (BooleanType details) |
This function sets a boolean if the exported simulation code should print all the details about the results or not. | |
virtual returnValue | setTimingCalls (uint _timingCalls) |
This function sets the number of calls performed for the timing results. | |
String | getCommonHeaderName () const |
Returns the name of common header file. | |
virtual int | operator<< (PlotWindow &_window) |
Adds a window to the plot collection. | |
virtual int | operator<< (LogRecord &_record) |
Adds a record to the log collection. | |
virtual int | addPlotWindow (PlotWindow &_window) |
Adds a window to the plot collection. | |
returnValue | addOptionsList () |
Adds an additional OptionsList to internal array. | |
returnValue | get (OptionsName name, int &value) const |
Returns value of an existing option item of integer type. | |
returnValue | get (OptionsName name, double &value) const |
Returns value of an existing option item of double type. | |
returnValue | get (uint idx, OptionsName name, int &value) const |
Returns value of an existing option item of integer type within the option list of given index. | |
returnValue | get (uint idx, OptionsName name, double &value) const |
Returns value of an existing option item of double type within the option list of given index. | |
returnValue | set (OptionsName name, int value) |
Sets value of an existing option item of integer type to a given value. | |
returnValue | set (OptionsName name, double value) |
Sets value of an existing option item of double type to a given value. | |
returnValue | set (uint idx, OptionsName name, int value) |
Sets value of an existing option item of integer type within the option list of given index to a given value. | |
returnValue | set (uint idx, OptionsName name, double value) |
Sets value of an existing option item of double type within the option list of given index to a given value. | |
returnValue | setOptions (const Options &arg) |
Assigns a given Options object to this object. | |
returnValue | setOptions (uint idx, const Options &arg) |
Assigns the option list with given index of a given Options object to option list with given index of this object. | |
Options | getOptions (uint idx) const |
Returns an Options object containing exactly the option list with given index. | |
uint | getNumOptionsLists () const |
Returns total number of option lists. | |
returnValue | printOptionsList () const |
Prints a list of all available options of all option lists. | |
returnValue | printOptionsList (uint idx) const |
Prints a list of all available options of option list with given index. | |
int | addLogRecord (LogRecord &record) |
Adds a record to the log collection. | |
returnValue | getLogRecord (uint idx, LogRecord &_record) const |
Returns the record with given index from the log collection. | |
returnValue | getLogRecord (LogRecord &_record) const |
Returns the record with certain index from the log collection. | |
returnValue | updateLogRecord (LogRecord &_record) const |
Updates all items with the record given as argument. | |
returnValue | getAll (LogName _name, MatrixVariablesGrid &values) const |
Gets all numerical values at all time instants of the item with given name. | |
returnValue | getFirst (LogName _name, Matrix &firstValue) const |
Gets numerical value at first time instant of the item with given name. | |
returnValue | getFirst (LogName _name, VariablesGrid &firstValue) const |
Gets numerical value at first time instant of the item with given name (converts internally used Matrix into VariablesGrid). | |
returnValue | getLast (LogName _name, Matrix &lastValue) const |
Gets numerical value at last time instant of the item with given name. | |
returnValue | getLast (LogName _name, VariablesGrid &lastValue) const |
Gets numerical value at last time instant of the item with given name (converts internally used Matrix into VariablesGrid). | |
uint | getNumLogRecords () const |
Returns number of records contained in the log collection. | |
returnValue | printLoggingInfo () const |
Prints information on all records and their items on screen. | |
returnValue | printNumDoubles () const |
returnValue | getPlotWindow (uint idx, PlotWindow &_window) const |
Returns the window with given index from the plot collection. | |
returnValue | getPlotWindow (PlotWindow &_window) const |
Returns the window with certain index from the plot collection. | |
virtual returnValue | plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE) |
Plots all windows of the plot collection, each one into a new figure. | |
virtual returnValue | replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE) |
Plots all windows of the plot collection, each one into the corresponding existing figure, if possible. | |
uint | getNumPlotWindows () const |
Returns number of windows contained in the plot collection. | |
returnValue | setDimensions (uint _NX1, uint _NX2, uint _NX3, uint _NDX, uint _NDX3, uint _NXA, uint _NXA3, uint _NU, uint _NP) |
Assigns the model dimensions to be used by the integrator. | |
returnValue | setDimensions (uint _NX1, uint _NX2, uint _NX3, uint _NDX, uint _NDX3, uint _NXA, uint _NXA3, uint _NU) |
returnValue | setDimensions (uint _NX1, uint _NX2, uint _NX3, uint _NDX, uint _NXA, uint _NU, uint _NP) |
Assigns the model dimensions to be used by the integrator. | |
returnValue | setDimensions (uint _NX1, uint _NX2, uint _NX3, uint _NDX, uint _NXA, uint _NU) |
returnValue | setDimensions (uint _NX, uint _NDX, uint _NXA, uint _NU, uint _NP) |
Assigns the model dimensions to be used by the integrator. | |
returnValue | setDimensions (uint _NX, uint _NDX, uint _NXA, uint _NU) |
returnValue | setDimensions (uint _NX, uint _NU, uint _NP) |
Assigns the model dimensions to be used by the integrator. | |
returnValue | setDimensions (uint _NX, uint _NU) |
returnValue | setModel (const DifferentialEquation &_f) |
Assigns Differential Equation to be used by the integrator. | |
returnValue | setModel (const String &fileName, const String &_rhs_ODE, const String &_diffs_rhs_ODE) |
Assigns the model to be used by the integrator. | |
returnValue | setNARXmodel (const uint _delay, const Matrix &_parms) |
Assigns a polynomial NARX model to be used by the integrator. | |
returnValue | setLinearInput (const Matrix &A1_, const Matrix &B1_) |
| |
returnValue | setLinearInput (const Matrix &M1_, const Matrix &A1_, const Matrix &B1_) |
| |
returnValue | setLinearOutput (const Matrix &A3_, const OutputFcn &rhs_) |
| |
returnValue | setLinearOutput (const Matrix &M3_, const Matrix &A3_, const OutputFcn &rhs_) |
| |
returnValue | setLinearOutput (const Matrix &A3_, const String &_rhs3, const String &_diffs_rhs3) |
| |
returnValue | setLinearOutput (const Matrix &M3_, const Matrix &A3_, const String &_rhs3, const String &_diffs_rhs3) |
| |
uint | addOutput (const OutputFcn &outputEquation_, const Vector &measurements) |
Adds an output function. | |
uint | addOutput (const OutputFcn &outputEquation_, const uint numberMeasurements) |
Adds an output function. | |
uint | addOutput (const String &output, const String &diffs_output, const uint dim, const Vector &measurements) |
Adds an output function. | |
uint | addOutput (const String &output, const String &diffs_output, const uint dim, const uint numberMeasurements) |
Adds an output function. | |
uint | addOutput (const String &output, const String &diffs_output, const uint dim, const Vector &measurements, const String &colInd, const String &rowPtr) |
Adds an output function. | |
uint | addOutput (const String &output, const String &diffs_output, const uint dim, const uint numberMeasurements, const String &colInd, const String &rowPtr) |
Adds an output function. | |
returnValue | setIntegrationGrid (const Grid &_ocpGrid, const uint _numSteps) |
Sets integration grid. | |
returnValue | setupOutput (const Vector &numberMeasurements) |
Sets up the output functions. | |
returnValue | getModel (DifferentialEquation &_f) const |
Returns the differential equations in the model. | |
BooleanType | hasOutputs () const |
BooleanType | hasDifferentialEquation () const |
BooleanType | modelDimensionsSet () const |
BooleanType | hasEquidistantControlGrid () const |
BooleanType | exportRhs () const |
uint | getNX () const |
Returns number of differential states. | |
uint | getNDX () const |
Returns number of differential state derivatives. | |
uint | getNXA () const |
Returns number of algebraic states. | |
uint | getNU () const |
Returns number of control inputs. | |
uint | getNP () const |
Returns number of parameters. | |
uint | getN () const |
Returns number of control intervals. | |
returnValue | setN (const uint N_) |
Sets the number of shooting intervals. | |
Vector | getDimOutputs () const |
Returns the dimensions of the different output functions. | |
Vector | getNumMeas () const |
Returns the number of measurements for the different output functions. | |
ModelData & | getModelData () |
Returns the model data object. | |
returnValue | setModelData (const ModelData &data) |
Sets the model data object. | |
const String | getFileNameModel () const |
Get/set module name. | |
| |
String | getName () const |
Get module name. | |
returnValue | setName (const String &_name) |
Set module name. | |
Get/set export folder name. | |
const String & | getExportFolderName () const |
Get export folder name. | |
void | setExportFolderName (const String &_name) |
Set export folder name. | |
Protected Member Functions | |
returnValue | copy (const SIMexport &arg) |
Copies all class members from given object. | |
returnValue | clear () |
Frees internal dynamic memory to yield an empty function. | |
returnValue | setup () |
Sets-up code export and initializes underlying export modules. | |
returnValue | checkConsistency () const |
Checks whether OCP formulation is compatible with code export capabilities. | |
returnValue | collectDataDeclarations (ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const |
Collects all data declarations of the auto-generated sub-modules to given list of declarations. | |
returnValue | collectFunctionDeclarations (ExportStatementBlock &declarations) const |
Collects all function (forward) declarations of the auto-generated sub-modules to given list of declarations. | |
returnValue | exportTest (const String &_dirName, const String &_fileName, const String &_resultsFile, const std::vector< String > &_outputFiles, const BooleanType &TIMING=BT_FALSE, const uint jumpReference=1) const |
Exports test file with template main function for using the exported simulation algorithm. | |
returnValue | exportEvaluation (const String &_dirName, const String &_fileName) const |
Exports the file evaluating the performance of the exported integrator, based on its results from the test and the corresponding reference results. | |
returnValue | exportMakefile (const String &_dirName, const String &_fileName, const String &_realString="real_t", const String &_intString="int", int _precision=16) const |
Exports GNU Makefile for compiling the exported MPC algorithm. | |
returnValue | executeTest (const String &_dirName) |
Compiles the exported source files and runs the corresponding test. | |
returnValue | copy (const ExportModule &arg) |
Copies all class members from given object. | |
returnValue | setupOptions () |
Sets-up default options. | |
virtual returnValue | getPlotDataFromMemberLoggings (PlotWindow &_window) const |
Copies all collected logging information required to plot a given window. | |
BlockStatus | getStatus () const |
Gets current status of user interface. | |
returnValue | setStatus (BlockStatus _status) |
Sets status of user interface. | |
returnValue | clearOptionsList () |
Clears all option lists from array. | |
BooleanType | haveOptionsChanged () const |
Determines whether options of at least one option list have been modified. | |
BooleanType | haveOptionsChanged (uint idx) const |
Determines whether options of option list with given index have been modified. | |
returnValue | declareOptionsUnchanged () |
Declares all options of all option lists to be unchanged. | |
returnValue | declareOptionsUnchanged (uint idx) |
Declares all options of option list with given index to be unchanged. | |
returnValue | addOption (OptionsName name, int value) |
Add an option item with a given integer default value to the all option lists. | |
returnValue | addOption (OptionsName name, double value) |
Add an option item with a given double default value to the all option lists. | |
returnValue | addOption (uint idx, OptionsName name, int value) |
Add an option item with a given integer default value to option list with given index. | |
returnValue | addOption (uint idx, OptionsName name, double value) |
Add an option item with a given double default value to option list with given index. | |
virtual returnValue | setupLogging () |
Prototype member function for setting-up the logging information at initialization of derived classes. | |
Protected Attributes | |
double | T |
The total simulation time. | |
IntegratorExport * | integrator |
Module for exporting a tailored integrator. | |
BooleanType | referenceProvided |
True if the user provided a file with the reference solution. | |
BooleanType | PRINT_DETAILS |
True if the user wants all the details about the results being printed. | |
uint | timingSteps |
The number of integration steps performed for the timing results. | |
String | _initStates |
Name of the file containing the initial values of all the states. | |
String | _controls |
Name of the file containing the control values over the OCP grid. | |
String | _results |
Name of the file in which the integration results will be written. | |
String | _ref |
Name of the file in which the reference will be written, to which the results of the integrator will be compared. | |
std::vector< String > | _refOutputFiles |
Names of the files in which the outputs will be written for the reference. | |
std::vector< String > | _outputFiles |
Names of the files in which the outputs will be written for the integrator. | |
String | commonHeaderName |
Name of common header file. | |
uint | timingCalls |
The number of calls to the exported function for the timing results. | |
BlockStatus | status |
Current status of the user interface, see documentation of BlockStatus for details. | |
OptionsList ** | optionsList |
Array consisting of OptionsLists. | |
uint | nOptionsList |
Total number of OptionsLists. | |
LogCollection | logCollection |
Log collection containing a singly-linked list of log records. | |
int | logIdx |
Index of a certain log record to be optionally used within derived classes. | |
PlotCollection | plotCollection |
Plot collection containing a singly-linked list of plot windows. | |
ModelData | modelData |
The model data. | |
Static Protected Attributes | |
static const uint | factorRef = 10 |
The used factor in the number of integration steps to get the reference. |
The class SIMexport is a user-interface to automatically generate tailored simulation algorithms for fast optimal control. It takes an optimal control problem (OCP) formulation and generates code based on given user options, e.g specifying the integrator and the number of integration steps. In addition to the export of such a simulation algorithm, the performance of this integrator will be evaluated on accuracy of the results and the time complexity.
BEGIN_NAMESPACE_ACADO SIMexport::SIMexport | ( | const uint | simIntervals = 1 , |
const double | totalTime = 1.0 |
||
) |
[in] | simIntervals | The number of simulation intervals. |
[in] | totalTime | The total simulation time. |
References _controls, _initStates, _ref, _results, BS_NOT_INITIALIZED, BT_FALSE, BT_TRUE, integrator, PRINT_DETAILS, referenceProvided, ModelContainer::setN(), UserInteraction::setStatus(), T, and timingSteps.
SIMexport::SIMexport | ( | const SIMexport & | arg | ) |
[in] | arg | Right-hand side object. |
References copy().
SIMexport::~SIMexport | ( | ) | [virtual] |
References clear().
int Logging::addLogRecord | ( | LogRecord & | record | ) | [inherited] |
[in] | record | Record to be added. |
References LogCollection::addLogRecord(), and Logging::logCollection.
Referenced by AlgorithmicBase::addLogRecord(), UserInteraction::addPlotWindow(), Logging::operator<<(), IntegrationAlgorithm::setupLogging(), Controller::setupLogging(), and Process::setupLogging().
returnValue Options::addOption | ( | OptionsName | name, |
int | value | ||
) | [protected, inherited] |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
References OptionsList::add(), Options::getNumOptionsLists(), Options::optionsList, SUCCESSFUL_RETURN, and uint.
Referenced by AlgorithmicBase::addOption(), OptimizationAlgorithm::setupOptions(), ExportModule::setupOptions(), MultiObjectiveAlgorithm::setupOptions(), RealTimeAlgorithm::setupOptions(), SimulationEnvironment::setupOptions(), IntegrationAlgorithm::setupOptions(), Controller::setupOptions(), and Process::setupOptions().
returnValue Options::addOption | ( | OptionsName | name, |
double | value | ||
) | [protected, inherited] |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
References OptionsList::add(), Options::getNumOptionsLists(), Options::optionsList, SUCCESSFUL_RETURN, and uint.
returnValue Options::addOption | ( | uint | idx, |
OptionsName | name, | ||
int | value | ||
) | [protected, inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
References ACADOERROR, OptionsList::add(), Options::getNumOptionsLists(), Options::optionsList, and RET_INDEX_OUT_OF_BOUNDS.
returnValue Options::addOption | ( | uint | idx, |
OptionsName | name, | ||
double | value | ||
) | [protected, inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
References ACADOERROR, OptionsList::add(), Options::getNumOptionsLists(), Options::optionsList, and RET_INDEX_OUT_OF_BOUNDS.
returnValue Options::addOptionsList | ( | ) | [inherited] |
References Options::nOptionsList, Options::optionsList, and SUCCESSFUL_RETURN.
Referenced by AlgorithmicBase::addOptionsList().
uint ModelContainer::addOutput | ( | const OutputFcn & | outputEquation_, |
const Vector & | measurements | ||
) | [inherited] |
outputEquation_ | an output function to be added |
measurements | the measurement points per interval |
References ModelData::addOutput(), Vector::append(), and ModelContainer::modelData.
uint ModelContainer::addOutput | ( | const OutputFcn & | outputEquation_, |
const uint | numberMeasurements | ||
) | [inherited] |
outputEquation_ | an output function to be added |
numberMeasurements | the number of measurements per interval |
References ModelData::addOutput(), and ModelContainer::modelData.
uint ModelContainer::addOutput | ( | const String & | output, |
const String & | diffs_output, | ||
const uint | dim, | ||
const Vector & | measurements | ||
) | [inherited] |
output | The output function to be added. |
diffs_output | The derivatives of the output function to be added. |
dim | The dimension of the output function. |
measurements | The measurement points per interval |
References ModelData::addOutput(), Vector::append(), and ModelContainer::modelData.
uint ModelContainer::addOutput | ( | const String & | output, |
const String & | diffs_output, | ||
const uint | dim, | ||
const uint | numberMeasurements | ||
) | [inherited] |
output | The output function to be added. |
diffs_output | The derivatives of the output function to be added. |
dim | The dimension of the output function. |
numberMeasurements | The number of measurements per interval |
References ModelData::addOutput(), and ModelContainer::modelData.
uint ModelContainer::addOutput | ( | const String & | output, |
const String & | diffs_output, | ||
const uint | dim, | ||
const Vector & | measurements, | ||
const String & | colInd, | ||
const String & | rowPtr | ||
) | [inherited] |
output | The output function to be added. |
diffs_output | The derivatives of the output function to be added. |
dim | The dimension of the output function. |
measurements | The measurement points per interval |
colInd | Vector stores the column indices of the elements for Compressed Row Storage (CRS). |
rowPtr | Vector stores the locations that start a row for Compressed Row Storage (CRS). |
References ModelData::addOutput(), Vector::append(), and ModelContainer::modelData.
uint ModelContainer::addOutput | ( | const String & | output, |
const String & | diffs_output, | ||
const uint | dim, | ||
const uint | numberMeasurements, | ||
const String & | colInd, | ||
const String & | rowPtr | ||
) | [inherited] |
output | The output function to be added. |
diffs_output | The derivatives of the output function to be added. |
dim | The dimension of the output function. |
numberMeasurements | The number of measurements per interval |
colInd | Vector stores the column indices of the elements for Compressed Row Storage (CRS). |
rowPtr | Vector stores the locations that start a row for Compressed Row Storage (CRS). |
References ModelData::addOutput(), and ModelContainer::modelData.
int UserInteraction::addPlotWindow | ( | PlotWindow & | _window | ) | [virtual, inherited] |
This function is overloaded here in order to add the plotDataRecord required to plot the window to the log collection.
[in] | _window | Window to be added. |
Reimplemented from Plotting.
References Logging::addLogRecord(), PlotWindow::getPlotDataRecord(), and PlotWindow::setPlotDataRecord().
Referenced by UserInteraction::operator<<().
returnValue SIMexport::checkConsistency | ( | ) | const [protected] |
References ACADOERROR, BT_TRUE, ModelData::checkConsistency(), ModelData::getModel(), Function::getNPI(), Function::getNUI(), Function::getNW(), DifferentialEquation::isDiscretized(), ModelContainer::modelData, RET_INVALID_OPTION, RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT, RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT, and SUCCESSFUL_RETURN.
Referenced by setup().
returnValue SIMexport::clear | ( | ) | [protected] |
References integrator, and SUCCESSFUL_RETURN.
Referenced by operator=(), and ~SIMexport().
returnValue Options::clearOptionsList | ( | ) | [protected, inherited] |
References Options::getNumOptionsLists(), Options::optionsList, SUCCESSFUL_RETURN, and uint.
Referenced by Options::operator=(), and Options::~Options().
returnValue SIMexport::collectDataDeclarations | ( | ExportStatementBlock & | declarations, |
ExportStruct | dataStruct = ACADO_ANY |
||
) | const [protected, virtual] |
[in] | declarations | List of declarations. |
Implements ExportModule.
References IntegratorExport::getDataDeclarations(), integrator, RET_UNABLE_TO_EXPORT_CODE, and SUCCESSFUL_RETURN.
Referenced by exportAcadoHeader().
returnValue SIMexport::collectFunctionDeclarations | ( | ExportStatementBlock & | declarations | ) | const [protected, virtual] |
[in] | declarations | List of declarations. |
Implements ExportModule.
References IntegratorExport::getFunctionDeclarations(), integrator, RET_UNABLE_TO_EXPORT_CODE, and SUCCESSFUL_RETURN.
Referenced by exportAcadoHeader().
returnValue SIMexport::copy | ( | const SIMexport & | arg | ) | [protected] |
[in] | arg | Right-hand side object. |
References _controls, _initStates, _ref, _refOutputFiles, _results, integrator, PRINT_DETAILS, referenceProvided, SUCCESSFUL_RETURN, and timingSteps.
Referenced by operator=(), and SIMexport().
returnValue ExportModule::copy | ( | const ExportModule & | arg | ) | [protected, inherited] |
[in] | arg | Right-hand side object. |
References ExportModule::commonHeaderName, SUCCESSFUL_RETURN, and ExportModule::timingCalls.
Referenced by ExportModule::ExportModule(), and ExportModule::operator=().
returnValue Options::declareOptionsUnchanged | ( | ) | [protected, inherited] |
References OptionsList::declareOptionsUnchanged(), Options::getNumOptionsLists(), Options::optionsList, SUCCESSFUL_RETURN, and uint.
Referenced by OptimizationAlgorithm::init(), and RealTimeAlgorithm::init().
returnValue Options::declareOptionsUnchanged | ( | uint | idx | ) | [protected, inherited] |
[in] | idx | Index of option list. |
References ACADOERROR, OptionsList::declareOptionsUnchanged(), Options::getNumOptionsLists(), Options::optionsList, and RET_INDEX_OUT_OF_BOUNDS.
returnValue SIMexport::executeTest | ( | const String & | _dirName | ) | [protected] |
[in] | _dirName | Name of directory in which the files are exported. |
References ExportModule::getName(), and SUCCESSFUL_RETURN.
Referenced by exportAndRun().
returnValue SIMexport::exportAcadoHeader | ( | const String & | _dirName, |
const String & | _fileName, | ||
const String & | _realString = "real_t" , |
||
const String & | _intString = "int" , |
||
int | _precision = 16 |
||
) | const [virtual] |
[in] | _dirName | Name of directory to be used to export file. |
[in] | _fileName | Name of file to be exported. |
[in] | _realString | String to be used to declare real variables. |
[in] | _intString | String to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
Implements ExportModule.
References ACADO_VARIABLES, ACADO_WORKSPACE, ACADOERROR, ExportStatementBlock::addComment(), ExportStatementBlock::addDeclaration(), ExportStatementBlock::addLinebreak(), ExportStatementBlock::addStatement(), BT_TRUE, collectDataDeclarations(), collectFunctionDeclarations(), ExportFile::exportCode(), FIX_INITIAL_STATE, VectorspaceElement::getDim(), ModelContainer::getDimOutputs(), ModelContainer::getN(), ModelContainer::getNDX(), ModelContainer::getNP(), ModelContainer::getNU(), ModelContainer::getNumMeas(), ExportStatementBlock::getNumStatements(), ModelContainer::getNX(), ModelContainer::getNXA(), QP_NONE, QP_QPOASES, QP_QPOASES3, QP_SOLVER, RET_INVALID_OPTION, RET_UNABLE_TO_EXPORT_CODE, STATIC_CONST_INT, SUCCESSFUL_RETURN, uint, and USE_SINGLE_PRECISION.
Referenced by exportCode().
returnValue SIMexport::exportAndRun | ( | const String & | dirName, |
const String & | initStates, | ||
const String & | controls, | ||
const String & | results = String( "results.txt" ) , |
||
const String & | ref = String( "ref.txt" ) |
||
) | [virtual] |
[in] | dirName | Name of directory to be used to export files. |
[in] | initStates | Name of the file containing the initial values of all the states. |
[in] | controls | Name of the file containing the control values over the OCP grid. |
[in] | results | Name of the file in which the integration results will be written. |
[in] | ref | Name of the file in which the reference will be written, to which the results of the integrator will be compared. |
References _controls, _initStates, _outputFiles, _ref, _refOutputFiles, _results, ACADOERROR, BT_FALSE, BT_TRUE, ModelData::clearIntegrationGrid(), EPS, executeTest(), exportCode(), exportTest(), factorRef, GENERATE_TEST_FILE, ModelData::getIntegrationGrid(), ModelData::getN(), ExportModule::getName(), ModelData::getOutputGrids(), MEASUREMENT_GRID, ModelContainer::modelData, NUM_INTEGRATOR_STEPS, ONLINE_GRID, referenceProvided, RET_INVALID_OPTION, SUCCESSFUL_RETURN, ExportModule::timingCalls, timingSteps, and uint.
returnValue SIMexport::exportCode | ( | const String & | dirName, |
const String & | _realString = "real_t" , |
||
const String & | _intString = "int" , |
||
int | _precision = 16 |
||
) | [virtual] |
[in] | dirName | Name of directory to be used to export files. |
[in] | _realString | String to be used to declare real variables. |
[in] | _intString | String to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
Implements ExportModule.
References acadoCopyTempateFile(), acadoCreateFolder(), ACADOERROR, ACADOINFO, acadoPrintf(), BT_TRUE, ExportModule::commonHeaderName, ExportMatlabIntegrator::configure(), ExportMatlabRhs::configure(), DYNAMIC_SENSITIVITY, exportAcadoHeader(), ExportFile::exportCode(), exportEvaluation(), exportMakefile(), GENERATE_MAKE_FILE, GENERATE_MATLAB_INTERFACE, GENERATE_TEST_FILE, IntegratorExport::getCode(), String::getName(), IntegratorExport::getNameFullRHS(), HIGH, integrator, INTEGRATOR_DEBUG_MODE, MEASUREMENT_GRID, ModelContainer::modelDimensionsSet(), NO_SENSITIVITY, NONE, ONLINE_GRID, PRINTLEVEL, QP_NONE, QP_SOLVER, RET_CODE_EXPORT_SUCCESSFUL, RET_UNABLE_TO_EXPORT_CODE, ExportModule::setExportFolderName(), setup(), SUCCESSFUL_RETURN, and ExportModule::timingCalls.
Referenced by exportAndRun().
returnValue SIMexport::exportEvaluation | ( | const String & | _dirName, |
const String & | _fileName | ||
) | const [protected] |
[in] | _dirName | Name of directory to be used to export file. |
[in] | _fileName | Name of file to be exported. |
References _outputFiles, _ref, _refOutputFiles, _results, ExportStatementBlock::addComment(), ExportStatementBlock::addLinebreak(), ExportStatementBlock::addStatement(), DYNAMIC_SENSITIVITY, ExportFile::exportCode(), ModelData::getDimOutputs(), ModelData::getN(), ModelData::getNumMeas(), ModelData::getNXA(), ModelData::getOutputGrids(), ModelContainer::modelData, NO_SENSITIVITY, PRINT_DETAILS, and T.
Referenced by exportCode().
returnValue SIMexport::exportMakefile | ( | const String & | _dirName, |
const String & | _fileName, | ||
const String & | _realString = "real_t" , |
||
const String & | _intString = "int" , |
||
int | _precision = 16 |
||
) | const [protected] |
[in] | _dirName | Name of directory to be used to export file. |
[in] | _fileName | Name of file to be exported. |
[in] | _realString | String to be used to declare real variables. |
[in] | _intString | String to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
References ExportStatementBlock::addLinebreak(), ExportStatementBlock::addStatement(), ExportFile::exportCode(), ModelData::exportRhs(), ModelData::getFileNameModel(), and ModelContainer::modelData.
Referenced by exportCode().
BooleanType ModelContainer::exportRhs | ( | ) | const [inherited] |
References ModelData::exportRhs(), and ModelContainer::modelData.
returnValue SIMexport::exportTest | ( | const String & | _dirName, |
const String & | _fileName, | ||
const String & | _resultsFile, | ||
const std::vector< String > & | _outputFiles, | ||
const BooleanType & | TIMING = BT_FALSE , |
||
const uint | jumpReference = 1 |
||
) | const [protected] |
[in] | _dirName | Name of directory to be used to export file. |
[in] | _fileName | Name of file to be exported. |
[in] | _resultsFile | Name of the file in which the integration results will be written. |
[in] | _outputFiles | Names of the files in which the output results will be written. |
[in] | TIMING | A boolean that is true when timing results are desired. |
[in] | jumpReference | The reference factor if the reference output results are computed. |
References _controls, _initStates, ACADOERROR, ExportStatementBlock::addComment(), ExportStatementBlock::addLinebreak(), ExportStatementBlock::addStatement(), BT_TRUE, DYNAMIC_SENSITIVITY, ExportFile::exportCode(), ModelData::getN(), ModelData::getNameOutputs(), ModelData::getNXA(), ModelData::getOutputExpressions(), ModelData::getOutputGrids(), ModelContainer::modelData, NO_SENSITIVITY, RET_INVALID_OPTION, T, ExportModule::timingCalls, and timingSteps.
Referenced by exportAndRun().
returnValue Options::get | ( | OptionsName | name, |
int & | value | ||
) | const [inherited] |
[in] | name | Name of option item. |
[out] | value | Value of option. |
References OptionsList::get(), and Options::optionsList.
Referenced by createDiagonallyImplicitRKExport(), createImplicitRungeKuttaExport(), AlgorithmicBase::get(), ExplicitRungeKuttaExport::getCode(), ExplicitRungeKuttaExport::getFunctionDeclarations(), ExplicitRungeKuttaExport::setDifferentialEquation(), ExportHouseholderQR::setup(), ExportGaussElim::setup(), ImplicitRungeKuttaExport::setup(), and OptimizationAlgorithmBase::setupDynamicDiscretization().
returnValue Options::get | ( | OptionsName | name, |
double & | value | ||
) | const [inherited] |
[in] | name | Name of option item. |
[out] | value | Value of option. |
References OptionsList::get(), and Options::optionsList.
returnValue Options::get | ( | uint | idx, |
OptionsName | name, | ||
int & | value | ||
) | const [inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[out] | value | Value of option. |
References ACADOERROR, OptionsList::get(), Options::getNumOptionsLists(), Options::optionsList, and RET_INDEX_OUT_OF_BOUNDS.
returnValue Options::get | ( | uint | idx, |
OptionsName | name, | ||
double & | value | ||
) | const [inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[out] | value | Value of option. |
References ACADOERROR, OptionsList::get(), Options::getNumOptionsLists(), Options::optionsList, and RET_INDEX_OUT_OF_BOUNDS.
BEGIN_NAMESPACE_ACADO returnValue Logging::getAll | ( | LogName | _name, |
MatrixVariablesGrid & | values | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | values | All numerical values at all time instants of given item. |
References ACADOERROR, BT_TRUE, LogCollection::getAll(), LogCollection::hasNonEmptyItem(), Logging::logCollection, and RET_LOG_ENTRY_DOESNT_EXIST.
Referenced by AlgorithmicBase::getAll(), SimulationEnvironment::getProcessAlgebraicStates(), SimulationEnvironment::getProcessDifferentialStates(), and SimulationEnvironment::getProcessIntermediateStates().
String ExportModule::getCommonHeaderName | ( | ) | const [inherited] |
References ExportModule::commonHeaderName.
Referenced by OCPexport::exportCode(), and OCPexport::setup().
Vector ModelContainer::getDimOutputs | ( | ) | const [inherited] |
References ModelData::getDimOutputs(), and ModelContainer::modelData.
Referenced by exportAcadoHeader().
const String & ExportModule::getExportFolderName | ( | ) | const [inherited] |
const String ModelContainer::getFileNameModel | ( | ) | const [inherited] |
References ModelData::getFileNameModel(), and ModelContainer::modelData.
returnValue Logging::getFirst | ( | LogName | _name, |
Matrix & | firstValue | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | firstValue | Numerical value at first time instant of given item. |
References ACADOERROR, BT_TRUE, LogCollection::getFirst(), LogCollection::hasNonEmptyItem(), Logging::logCollection, and RET_LOG_ENTRY_DOESNT_EXIST.
Referenced by AlgorithmicBase::getFirst().
returnValue Logging::getFirst | ( | LogName | _name, |
VariablesGrid & | firstValue | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | firstValue | Numerical value at first time instant of given item. |
References ACADOERROR, BT_TRUE, LogCollection::getFirst(), LogCollection::hasNonEmptyItem(), Logging::logCollection, and RET_LOG_ENTRY_DOESNT_EXIST.
returnValue Logging::getLast | ( | LogName | _name, |
Matrix & | lastValue | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | lastValue | Numerical value at last time instant of given item. |
References ACADOERROR, BT_TRUE, LogCollection::getLast(), LogCollection::hasNonEmptyItem(), Logging::logCollection, and RET_LOG_ENTRY_DOESNT_EXIST.
Referenced by AlgorithmicBase::getLast().
returnValue Logging::getLast | ( | LogName | _name, |
VariablesGrid & | lastValue | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | lastValue | Numerical value at last time instant of given item. |
References ACADOERROR, BT_TRUE, LogCollection::getLast(), LogCollection::hasNonEmptyItem(), Logging::logCollection, and RET_LOG_ENTRY_DOESNT_EXIST.
returnValue Logging::getLogRecord | ( | uint | idx, |
LogRecord & | _record | ||
) | const [inherited] |
[in] | idx | Index of desired record. |
[out] | _record | Desired record. |
References ACADOERROR, Logging::getNumLogRecords(), Logging::logCollection, RET_INDEX_OUT_OF_BOUNDS, and SUCCESSFUL_RETURN.
Referenced by Logging::getLogRecord().
returnValue Logging::getLogRecord | ( | LogRecord & | _record | ) | const [inherited] |
This index is not provided when calling the function, but rather obtained by using the alias index of the record. If the record is no alias record, the error RET_INDEX_OUT_OF_BOUNDS is thrown.
[out] | _record | Desired record. |
References LogRecord::getAliasIdx(), and Logging::getLogRecord().
returnValue ModelContainer::getModel | ( | DifferentialEquation & | _f | ) | const [inherited] |
References ModelData::getModel(), ModelContainer::modelData, and SUCCESSFUL_RETURN.
Referenced by OCPexport::checkConsistency(), and OptimizationAlgorithmBase::extractOCPdata().
ModelData & ModelContainer::getModelData | ( | ) | [inherited] |
References ModelContainer::modelData.
Referenced by OCPexport::setup().
uint ModelContainer::getN | ( | ) | const [inherited] |
References ModelData::getN(), and ModelContainer::modelData.
Referenced by exportAcadoHeader(), OCPexport::exportAcadoHeader(), OCPexport::exportCode(), and OCPexport::setup().
String ExportModule::getName | ( | ) | const [inherited] |
Referenced by executeTest(), OCPexport::exportAcadoHeader(), exportAndRun(), OCPexport::exportCode(), and OCPexport::setup().
uint ModelContainer::getNDX | ( | ) | const [inherited] |
References ModelData::getNDX(), and ModelContainer::modelData.
Referenced by exportAcadoHeader(), OCPexport::exportAcadoHeader(), OCPexport::exportCode(), and OCPexport::setup().
uint ModelContainer::getNP | ( | ) | const [inherited] |
References ModelData::getNP(), and ModelContainer::modelData.
Referenced by exportAcadoHeader(), OCPexport::exportAcadoHeader(), OCPexport::exportCode(), and OCPexport::setup().
uint ModelContainer::getNU | ( | ) | const [inherited] |
References ModelData::getNU(), and ModelContainer::modelData.
Referenced by exportAcadoHeader(), OCPexport::exportAcadoHeader(), OCPexport::exportCode(), and OCPexport::setup().
uint Logging::getNumLogRecords | ( | ) | const [inherited] |
References LogCollection::getNumLogRecords(), and Logging::logCollection.
Referenced by Logging::getLogRecord().
Vector ModelContainer::getNumMeas | ( | ) | const [inherited] |
References ModelData::getNumMeas(), and ModelContainer::modelData.
Referenced by exportAcadoHeader().
BEGIN_NAMESPACE_ACADO uint Options::getNumOptionsLists | ( | ) | const [inline, inherited] |
References Options::nOptionsList.
Referenced by Options::addOption(), Options::clearOptionsList(), Options::declareOptionsUnchanged(), Options::get(), Options::getOptions(), Options::haveOptionsChanged(), Options::printOptionsList(), Options::set(), and Options::setOptions().
uint Plotting::getNumPlotWindows | ( | ) | const [inline, inherited] |
References PlotCollection::getNumPlotWindows(), and Plotting::plotCollection.
Referenced by Plotting::getPlotWindow().
uint ModelContainer::getNX | ( | ) | const [inherited] |
References ModelData::getNX(), and ModelContainer::modelData.
Referenced by exportAcadoHeader(), OCPexport::exportAcadoHeader(), OCPexport::exportCode(), and OCPexport::setup().
uint ModelContainer::getNXA | ( | ) | const [inherited] |
References ModelData::getNXA(), and ModelContainer::modelData.
Referenced by exportAcadoHeader(), OCPexport::exportAcadoHeader(), OCPexport::exportCode(), and OCPexport::setup().
Options Options::getOptions | ( | uint | idx | ) | const [inherited] |
[in] | idx | Index of option list. |
References ACADOERROR, Options::getNumOptionsLists(), Options::Options(), Options::optionsList, and RET_INDEX_OUT_OF_BOUNDS.
Referenced by AlgorithmicBase::getOptions().
returnValue UserInteraction::getPlotDataFromMemberLoggings | ( | PlotWindow & | _window | ) | const [protected, virtual, inherited] |
This function is overloaded within the UserInterface class to syncronize the logging information collected elsewhere within the algorithm with the one stored within the given window for plotting.
[in] | _window | Window to be plotted. |
Reimplemented from Plotting.
References PlotWindow::getPlotDataRecord(), PlotWindow::setPlotDataRecord(), SUCCESSFUL_RETURN, and Logging::updateLogRecord().
returnValue Plotting::getPlotWindow | ( | uint | idx, |
PlotWindow & | _window | ||
) | const [inline, inherited] |
[in] | idx | Index of desired window. |
[out] | _window | Desired window. |
References ACADOERROR, Plotting::getNumPlotWindows(), Plotting::getPlotDataFromMemberLoggings(), Plotting::plotCollection, and RET_INDEX_OUT_OF_BOUNDS.
Referenced by Plotting::getPlotWindow(), Plotting::plot(), and Plotting::replot().
returnValue Plotting::getPlotWindow | ( | PlotWindow & | _window | ) | const [inline, inherited] |
This index is not provided when calling the function, but rather obtained by using the alias index of the window. If the window is no alias window, the error RET_INDEX_OUT_OF_BOUNDS is thrown.
[out] | _window | Desired window. |
References PlotWindow::getAliasIdx(), and Plotting::getPlotWindow().
BlockStatus UserInteraction::getStatus | ( | ) | const [protected, inherited] |
References UserInteraction::status.
Referenced by RealTimeAlgorithm::feedbackStep(), OptimizationAlgorithm::init(), RealTimeAlgorithm::init(), RealTimeAlgorithm::performFeedbackStep(), RealTimeAlgorithm::performPreparationStep(), OCPexport::printDimensionsQP(), Process::run(), SimulationEnvironment::setController(), Controller::setEstimator(), RealTimeAlgorithm::setReference(), Controller::setReferenceTrajectory(), OCPexport::setup(), OptimizationAlgorithm::solve(), RealTimeAlgorithm::solve(), LinearStateFeedback::step(), FeedforwardLaw::step(), PIDcontroller::step(), Sensor::step(), SimulationEnvironment::step(), Controller::step(), Process::step(), and Actuator::step().
BooleanType ModelContainer::hasDifferentialEquation | ( | ) | const [inherited] |
References BT_FALSE, BT_TRUE, Function::getDim(), ModelData::getModel(), and ModelContainer::modelData.
Referenced by OptimizationAlgorithmBase::extractOCPdata().
BooleanType ModelContainer::hasEquidistantControlGrid | ( | ) | const [inherited] |
References ModelData::hasEquidistantControlGrid(), and ModelContainer::modelData.
Referenced by OCP::setNumberIntegrationSteps().
BooleanType ModelContainer::hasOutputs | ( | ) | const [inherited] |
References BT_FALSE, BT_TRUE, ModelData::getOutputExpressions(), and ModelContainer::modelData.
Referenced by setReference().
BooleanType Options::haveOptionsChanged | ( | ) | const [protected, inherited] |
References BT_FALSE, BT_TRUE, Options::getNumOptionsLists(), Options::optionsList, and uint.
Referenced by AlgorithmicBase::haveOptionsChanged(), OptimizationAlgorithm::init(), RealTimeAlgorithm::init(), and OptimizationAlgorithm::solve().
BooleanType Options::haveOptionsChanged | ( | uint | idx | ) | const [protected, inherited] |
[in] | idx | Index of option list. |
References ACADOERROR, BT_FALSE, Options::getNumOptionsLists(), OptionsList::haveOptionsChanged(), Options::optionsList, and RET_INDEX_OUT_OF_BOUNDS.
BooleanType ModelContainer::modelDimensionsSet | ( | ) | const [inherited] |
References ModelContainer::modelData, and ModelData::modelDimensionsSet().
Referenced by exportCode().
int UserInteraction::operator<< | ( | PlotWindow & | _window | ) | [virtual, inherited] |
This function is overloaded here in order to add the plotDataRecord required to plot the window to the log collection.
[in] | _window | Window to be added. |
Reimplemented from Plotting.
References UserInteraction::addPlotWindow().
Referenced by UserInteraction::operator<<().
int UserInteraction::operator<< | ( | LogRecord & | _record | ) | [virtual, inherited] |
[in] | record | Record to be added. |
Reimplemented from Logging.
References UserInteraction::operator<<().
returnValue Plotting::plot | ( | PlotFrequency | _frequency = PLOT_IN_ANY_CASE | ) | [virtual, inherited] |
[in] | _frequency | Frequency determining at which time instants the window is to be plotted. |
References ACADOERROR, PlotCollection::first, PlotWindow::getNext(), Plotting::getPlotWindow(), PlotWindow::plot(), PLOT_NEVER, Plotting::plotCollection, RET_PLOTTING_FAILED, and SUCCESSFUL_RETURN.
Referenced by IntegrationAlgorithm::evaluate(), and AlgorithmicBase::plot().
returnValue SIMexport::printDetails | ( | BooleanType | details | ) | [virtual] |
[in] | details | true if the exported simulation code should print all the details, otherwise false |
References PRINT_DETAILS, and SUCCESSFUL_RETURN.
returnValue Logging::printLoggingInfo | ( | ) | const [inherited] |
References LogCollection::getNumLogRecords(), Logging::logCollection, SUCCESSFUL_RETURN, and uint.
returnValue Logging::printNumDoubles | ( | ) | const [inherited] |
References LogCollection::getNumDoubles(), Logging::logCollection, and SUCCESSFUL_RETURN.
returnValue Options::printOptionsList | ( | ) | const [inherited] |
References Options::getNumOptionsLists(), Options::optionsList, OptionsList::printOptionsList(), SUCCESSFUL_RETURN, and uint.
returnValue Options::printOptionsList | ( | uint | idx | ) | const [inherited] |
[in] | idx | Index of option list. |
References ACADOERROR, Options::getNumOptionsLists(), Options::optionsList, OptionsList::printOptionsList(), and RET_INDEX_OUT_OF_BOUNDS.
returnValue Plotting::replot | ( | PlotFrequency | _frequency = PLOT_IN_ANY_CASE | ) | [virtual, inherited] |
[in] | _frequency | Frequency determining at which time instants the window is to be plotted. |
Reimplemented in Process.
References ACADOERROR, PlotCollection::first, PlotWindow::getNext(), Plotting::getPlotWindow(), PLOT_NEVER, Plotting::plotCollection, PlotWindow::replot(), RET_PLOTTING_FAILED, and SUCCESSFUL_RETURN.
Referenced by AlgorithmicBase::replot(), and RealTimeAlgorithm::solve().
returnValue Options::set | ( | OptionsName | name, |
int | value | ||
) | [inherited] |
[in] | name | Name of option item. |
[in] | value | New value of option. |
References Options::optionsList, and OptionsList::set().
Referenced by AlgorithmicBase::set().
returnValue Options::set | ( | OptionsName | name, |
double | value | ||
) | [inherited] |
[in] | name | Name of option item. |
[in] | value | New value of option. |
References Options::optionsList, and OptionsList::set().
returnValue Options::set | ( | uint | idx, |
OptionsName | name, | ||
int | value | ||
) | [inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[in] | value | New value of option. |
References ACADOERROR, Options::getNumOptionsLists(), Options::optionsList, RET_INDEX_OUT_OF_BOUNDS, and OptionsList::set().
returnValue Options::set | ( | uint | idx, |
OptionsName | name, | ||
double | value | ||
) | [inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[in] | value | New value of option. |
References ACADOERROR, Options::getNumOptionsLists(), Options::optionsList, RET_INDEX_OUT_OF_BOUNDS, and OptionsList::set().
returnValue ModelContainer::setDimensions | ( | uint | _NX1, |
uint | _NX2, | ||
uint | _NX3, | ||
uint | _NDX, | ||
uint | _NDX3, | ||
uint | _NXA, | ||
uint | _NXA3, | ||
uint | _NU, | ||
uint | _NP | ||
) | [inherited] |
[in] | _NX1 | Number of differential states in linear input subsystem. |
[in] | _NX2 | Number of differential states in nonlinear subsystem. |
[in] | _NX3 | Number of differential states in linear output subsystem. |
[in] | _NDX | Number of differential states derivatives. |
[in] | _NDX3 | Number of differential states derivatives in the linear output subsystem. |
[in] | _NXA | Number of algebraic states. |
[in] | _NXA3 | Number of algebraic states in the linear output subsystem. |
[in] | _NU | Number of control inputs |
[in] | _NP | Number of parameters |
References ModelContainer::modelData, and ModelData::setDimensions().
Referenced by ModelContainer::setDimensions().
returnValue ModelContainer::setDimensions | ( | uint | _NX1, |
uint | _NX2, | ||
uint | _NX3, | ||
uint | _NDX, | ||
uint | _NDX3, | ||
uint | _NXA, | ||
uint | _NXA3, | ||
uint | _NU | ||
) | [inherited] |
References ModelContainer::setDimensions().
returnValue ModelContainer::setDimensions | ( | uint | _NX1, |
uint | _NX2, | ||
uint | _NX3, | ||
uint | _NDX, | ||
uint | _NXA, | ||
uint | _NU, | ||
uint | _NP | ||
) | [inherited] |
[in] | _NX1 | Number of differential states in linear input subsystem. |
[in] | _NX2 | Number of differential states in nonlinear subsystem. |
[in] | _NX3 | Number of differential states in linear output subsystem. |
[in] | _NDX | Number of differential states derivatives. |
[in] | _NXA | Number of algebraic states. |
[in] | _NU | Number of control inputs |
[in] | _NP | Number of parameters |
References ModelContainer::setDimensions().
returnValue ModelContainer::setDimensions | ( | uint | _NX1, |
uint | _NX2, | ||
uint | _NX3, | ||
uint | _NDX, | ||
uint | _NXA, | ||
uint | _NU | ||
) | [inherited] |
References ModelContainer::setDimensions().
returnValue ModelContainer::setDimensions | ( | uint | _NX, |
uint | _NDX, | ||
uint | _NXA, | ||
uint | _NU, | ||
uint | _NP | ||
) | [inherited] |
[in] | _NX | Number of differential states. |
[in] | _NDX | Number of differential states derivatives. |
[in] | _NXA | Number of algebraic states. |
[in] | _NU | Number of control inputs |
[in] | _NP | Number of parameters |
References ModelContainer::setDimensions().
returnValue ModelContainer::setDimensions | ( | uint | _NX, |
uint | _NDX, | ||
uint | _NXA, | ||
uint | _NU | ||
) | [inherited] |
References ModelContainer::setDimensions().
returnValue ModelContainer::setDimensions | ( | uint | _NX, |
uint | _NU, | ||
uint | _NP | ||
) | [inherited] |
[in] | _NX | Number of differential states. |
[in] | _NU | Number of control inputs |
[in] | _NP | Number of parameters |
References ModelContainer::setDimensions().
returnValue ModelContainer::setDimensions | ( | uint | _NX, |
uint | _NU | ||
) | [inherited] |
References ModelContainer::setDimensions().
void ExportModule::setExportFolderName | ( | const String & | _name | ) | [inherited] |
Referenced by OCPexport::exportCode(), and exportCode().
returnValue ModelContainer::setIntegrationGrid | ( | const Grid & | _ocpGrid, |
const uint | _numSteps | ||
) | [inherited] |
[in] | _ocpGrid | Evaluation grid for optimal control. |
[in] | numSteps | The number of integration steps along the horizon. |
References ModelContainer::modelData, and ModelData::setIntegrationGrid().
Referenced by OCP::setNumberIntegrationSteps().
returnValue ModelContainer::setLinearInput | ( | const Matrix & | A1_, |
const Matrix & | B1_ | ||
) | [inherited] |
[in] | . |
References eye(), Matrix::getNumRows(), ModelContainer::modelData, and ModelData::setLinearInput().
returnValue ModelContainer::setLinearInput | ( | const Matrix & | M1_, |
const Matrix & | A1_, | ||
const Matrix & | B1_ | ||
) | [inherited] |
[in] | . |
References ModelContainer::modelData, and ModelData::setLinearInput().
returnValue ModelContainer::setLinearOutput | ( | const Matrix & | A3_, |
const OutputFcn & | rhs_ | ||
) | [inherited] |
[in] | . |
References eye(), Matrix::getNumRows(), ModelContainer::modelData, and ModelData::setLinearOutput().
returnValue ModelContainer::setLinearOutput | ( | const Matrix & | M3_, |
const Matrix & | A3_, | ||
const OutputFcn & | rhs_ | ||
) | [inherited] |
[in] | . |
References ModelContainer::modelData, and ModelData::setLinearOutput().
returnValue ModelContainer::setLinearOutput | ( | const Matrix & | A3_, |
const String & | _rhs3, | ||
const String & | _diffs_rhs3 | ||
) | [inherited] |
[in] | . |
References eye(), Matrix::getNumRows(), ModelContainer::modelData, and ModelData::setLinearOutput().
returnValue ModelContainer::setLinearOutput | ( | const Matrix & | M3_, |
const Matrix & | A3_, | ||
const String & | _rhs3, | ||
const String & | _diffs_rhs3 | ||
) | [inherited] |
[in] | . |
References ModelContainer::modelData, and ModelData::setLinearOutput().
returnValue ModelContainer::setModel | ( | const DifferentialEquation & | _f | ) | [inherited] |
[in] | f | Differential equation. |
References ModelContainer::modelData, and ModelData::setModel().
returnValue ModelContainer::setModel | ( | const String & | fileName, |
const String & | _rhs_ODE, | ||
const String & | _diffs_rhs_ODE | ||
) | [inherited] |
[in] | _rhs_ODE | Name of the function, evaluating the ODE right-hand side. |
[in] | _diffs_rhs_ODE | Name of the function, evaluating the derivatives of the ODE right-hand side. |
References ModelContainer::modelData, and ModelData::setModel().
returnValue ModelContainer::setModelData | ( | const ModelData & | data | ) | [inherited] |
[in] | data | the model data object. |
References ModelContainer::modelData, and SUCCESSFUL_RETURN.
returnValue ModelContainer::setN | ( | const uint | N_ | ) | [inherited] |
[in] | N_ | The number of shooting intervals. |
References ModelContainer::modelData, ModelData::setN(), and SUCCESSFUL_RETURN.
Referenced by OCP::OCP(), OCP::setupGrid(), and SIMexport().
returnValue ExportModule::setName | ( | const String & | _name | ) | [inherited] |
References ACADOERROR, BT_TRUE, String::isEmpty(), RET_INVALID_ARGUMENTS, and SUCCESSFUL_RETURN.
returnValue ModelContainer::setNARXmodel | ( | const uint | _delay, |
const Matrix & | _parms | ||
) | [inherited] |
[in] | delay | The delay for the states in the NARX model. |
[in] | parms | The parameters defining the polynomial NARX model. |
References ModelContainer::modelData, and ModelData::setNARXmodel().
returnValue Options::setOptions | ( | const Options & | arg | ) | [inherited] |
[in] | arg | New Options object to be assigned. |
References Options::operator=(), and SUCCESSFUL_RETURN.
Referenced by AlgorithmicBase::setOptions().
returnValue Options::setOptions | ( | uint | idx, |
const Options & | arg | ||
) | [inherited] |
[in] | idx | Index of option list. |
[in] | arg | Options object containing the option list to be assigned. |
References ACADOERROR, Options::getNumOptionsLists(), Options::optionsList, RET_INDEX_OUT_OF_BOUNDS, and SUCCESSFUL_RETURN.
returnValue SIMexport::setReference | ( | const String & | reference, |
const std::vector< String > & | outputReference = *(new std::vector<String>()) |
||
) | [virtual] |
[in] | reference | Name of the file containing the reference. |
[in] | outputReference | The names of the files containing the reference for the output results if any. |
References _ref, _refOutputFiles, BT_FALSE, BT_TRUE, ModelContainer::hasOutputs(), referenceProvided, RET_UNABLE_TO_EXPORT_CODE, and SUCCESSFUL_RETURN.
returnValue UserInteraction::setStatus | ( | BlockStatus | _status | ) | [protected, inherited] |
[in] | _status | New status of user interface |
References UserInteraction::status, and SUCCESSFUL_RETURN.
Referenced by Controller::Controller(), DynamicEstimator::DynamicEstimator(), Estimator::Estimator(), FeedforwardLaw::FeedforwardLaw(), KalmanFilter::init(), DynamicEstimator::init(), Estimator::init(), OptimizationAlgorithm::init(), LinearStateFeedback::init(), FeedforwardLaw::init(), RealTimeAlgorithm::init(), TransferDevice::init(), PIDcontroller::init(), SimulationEnvironment::init(), Controller::init(), Process::init(), Process::initializeStartValues(), IntegrationAlgorithm::IntegrationAlgorithm(), KalmanFilter::KalmanFilter(), LinearStateFeedback::LinearStateFeedback(), OCPexport::OCPexport(), UserInteraction::operator=(), OptimizationAlgorithm::OptimizationAlgorithm(), RealTimeAlgorithm::performFeedbackStep(), RealTimeAlgorithm::performPreparationStep(), PIDcontroller::PIDcontroller(), Process::Process(), RealTimeAlgorithm::RealTimeAlgorithm(), Process::setActuator(), Controller::setControlLaw(), SimulationEnvironment::setController(), Process::setDynamicSystem(), Controller::setEstimator(), SimulationEnvironment::setProcess(), Process::setProcessDisturbance(), Controller::setReferenceTrajectory(), Process::setSensor(), OCPexport::setup(), setup(), SIMexport(), SimulationEnvironment::SimulationEnvironment(), MultiObjectiveAlgorithm::solve(), MultiObjectiveAlgorithm::solveSingleObjective(), TransferDevice::TransferDevice(), and UserInteraction::UserInteraction().
returnValue ExportModule::setTimingCalls | ( | uint | _timingCalls | ) | [virtual, inherited] |
[in] | _timingCalls | The new number of calls performed for the timing results. |
References SUCCESSFUL_RETURN, and ExportModule::timingCalls.
returnValue SIMexport::setTimingSteps | ( | uint | _timingSteps | ) | [virtual] |
[in] | _timingSteps | The new number of integration steps performed for the timing results. |
References SUCCESSFUL_RETURN, and timingSteps.
returnValue SIMexport::setup | ( | ) | [protected] |
References _outputFiles, _refOutputFiles, ACADOERROR, BS_READY, checkConsistency(), ExportModule::commonHeaderName, ExportAlgorithmFactory< AlgorithmBase, AlgorithmType >::createAlgorithm(), IntegratorExport::equidistantControlGrid(), ModelData::getN(), ModelData::getNumOutputs(), ModelData::hasOutputs(), ExportAlgorithmFactory< AlgorithmBase, AlgorithmType >::instance(), integrator, INTEGRATOR_TYPE, ModelContainer::modelData, NUM_INTEGRATOR_STEPS, referenceProvided, RET_INVALID_OPTION, ModelData::setIntegrationGrid(), IntegratorExport::setModelData(), UserInteraction::setStatus(), SUCCESSFUL_RETURN, T, and uint.
Referenced by exportCode().
returnValue Logging::setupLogging | ( | ) | [protected, virtual, inherited] |
Reimplemented in Process, Controller, IntegrationAlgorithm, SimulationEnvironment, RealTimeAlgorithm, and OptimizationAlgorithm.
References SUCCESSFUL_RETURN.
returnValue ExportModule::setupOptions | ( | ) | [protected, virtual, inherited] |
Reimplemented from Options.
References Options::addOption(), BT_FALSE, BT_TRUE, CG_COMPUTE_COVARIANCE_MATRIX, CG_HARDCODE_CONSTRAINT_VALUES, CG_USE_ARRIVAL_COST, CG_USE_C99, CG_USE_OPENMP, CG_USE_VARIABLE_WEIGHTING_MATRIX, DISCRETIZATION_TYPE, DYNAMIC_SENSITIVITY, FIX_INITIAL_STATE, FORWARD, FULL_CONDENSING, GAUSS_LU, GAUSS_NEWTON, GENERATE_MAKE_FILE, GENERATE_MATLAB_INTERFACE, GENERATE_SIMULINK_INTERFACE, GENERATE_TEST_FILE, HESSIAN_APPROXIMATION, HOTSTART_QP, IFTR, IMPLICIT_INTEGRATOR_MODE, IMPLICIT_INTEGRATOR_NUM_ITS, IMPLICIT_INTEGRATOR_NUM_ITS_INIT, INT_RK4, INTEGRATOR_DEBUG_MODE, INTEGRATOR_TYPE, LEVENBERG_MARQUARDT, LINEAR_ALGEBRA_SOLVER, MAX_NUM_QP_ITERATIONS, MEASUREMENT_GRID, MEDIUM, MEX_ITERATION_STEPS, MEX_VERBOSE, NO, NUM_INTEGRATOR_STEPS, OFFLINE_GRID, OPERATING_SYSTEM, OS_DEFAULT, PRINTLEVEL, QP_QPOASES, QP_SOLVER, SINGLE_SHOOTING, SPARSE_QP_SOLUTION, SUCCESSFUL_RETURN, UNROLL_LINEAR_SOLVER, USE_SINGLE_PRECISION, and YES.
Referenced by ExportModule::ExportModule().
returnValue ModelContainer::setupOutput | ( | const Vector & | numberMeasurements | ) | [inherited] |
numberMeasurements | the number of measurements per horizon for each output function |
returnValue Logging::updateLogRecord | ( | LogRecord & | _record | ) | const [inherited] |
In doing so, it is checked for each item whether it is contained within one of of the records of the collection; and if so, the numerical values are copied into the argument record.
[in,out] | _record | Record to be updated |
References Logging::logCollection, and LogCollection::updateLogRecord().
Referenced by UserInteraction::getPlotDataFromMemberLoggings(), and SimulationEnvironment::getSampledProcessOutput().
String SIMexport::_controls [protected] |
Referenced by copy(), exportAndRun(), exportTest(), and SIMexport().
String SIMexport::_initStates [protected] |
Referenced by copy(), exportAndRun(), exportTest(), and SIMexport().
std::vector<String> SIMexport::_outputFiles [protected] |
Referenced by exportAndRun(), exportEvaluation(), and setup().
String SIMexport::_ref [protected] |
Referenced by copy(), exportAndRun(), exportEvaluation(), setReference(), and SIMexport().
std::vector<String> SIMexport::_refOutputFiles [protected] |
Referenced by copy(), exportAndRun(), exportEvaluation(), setReference(), and setup().
String SIMexport::_results [protected] |
Referenced by copy(), exportAndRun(), exportEvaluation(), and SIMexport().
String ExportModule::commonHeaderName [protected, inherited] |
const uint SIMexport::factorRef = 10 [static, protected] |
Referenced by exportAndRun().
IntegratorExport* SIMexport::integrator [protected] |
Referenced by clear(), collectDataDeclarations(), collectFunctionDeclarations(), copy(), exportCode(), setup(), and SIMexport().
LogCollection Logging::logCollection [protected, inherited] |
Referenced by Logging::addLogRecord(), Logging::getAll(), Logging::getFirst(), Logging::getLast(), Logging::getLogRecord(), Logging::getNumLogRecords(), Logging::Logging(), Controller::obtainEstimates(), Logging::operator=(), Controller::preparationStep(), Logging::printLoggingInfo(), AlgorithmicBase::printLogRecord(), Logging::printNumDoubles(), AlgorithmicBase::setAll(), AlgorithmicBase::setLast(), Process::simulate(), Controller::step(), Process::step(), and Logging::updateLogRecord().
int Logging::logIdx [protected, inherited] |
Referenced by Logging::Logging(), Logging::operator=(), and IntegrationAlgorithm::setupLogging().
ModelData ModelContainer::modelData [protected, inherited] |
Referenced by ModelContainer::addOutput(), checkConsistency(), OCP::copy(), exportAndRun(), exportEvaluation(), exportMakefile(), ModelContainer::exportRhs(), exportTest(), ModelContainer::getDimOutputs(), ModelContainer::getFileNameModel(), ModelContainer::getModel(), ModelContainer::getModelData(), ModelContainer::getN(), ModelContainer::getNDX(), ModelContainer::getNP(), ModelContainer::getNU(), ModelContainer::getNumMeas(), ModelContainer::getNX(), ModelContainer::getNXA(), ModelContainer::hasDifferentialEquation(), ModelContainer::hasEquidistantControlGrid(), OCP::hasEquidistantGrid(), ModelContainer::hasOutputs(), ModelContainer::modelDimensionsSet(), OCP::OCP(), ModelContainer::setDimensions(), ModelContainer::setIntegrationGrid(), ModelContainer::setLinearInput(), ModelContainer::setLinearOutput(), ModelContainer::setModel(), ModelContainer::setModelData(), ModelContainer::setN(), ModelContainer::setNARXmodel(), setup(), and OCP::subjectTo().
uint Options::nOptionsList [protected, inherited] |
Referenced by Options::addOptionsList(), Options::getNumOptionsLists(), Options::operator=(), and Options::Options().
OptionsList** Options::optionsList [protected, inherited] |
Referenced by Options::addOption(), Options::addOptionsList(), Options::clearOptionsList(), Options::declareOptionsUnchanged(), Options::get(), Options::getOptions(), Options::haveOptionsChanged(), Options::operator=(), Options::Options(), Options::printOptionsList(), Options::set(), and Options::setOptions().
PlotCollection Plotting::plotCollection [protected, inherited] |
BooleanType SIMexport::PRINT_DETAILS [protected] |
Referenced by copy(), exportEvaluation(), printDetails(), and SIMexport().
BooleanType SIMexport::referenceProvided [protected] |
Referenced by copy(), exportAndRun(), setReference(), setup(), and SIMexport().
BlockStatus UserInteraction::status [protected, inherited] |
double SIMexport::T [protected] |
Referenced by exportEvaluation(), exportTest(), setup(), and SIMexport().
uint ExportModule::timingCalls [protected, inherited] |
Referenced by ExportModule::copy(), exportAndRun(), exportCode(), ExportModule::ExportModule(), exportTest(), and ExportModule::setTimingCalls().
uint SIMexport::timingSteps [protected] |
Referenced by copy(), exportAndRun(), exportTest(), setTimingSteps(), and SIMexport().