Base class for all algorithmic modules within the ACADO Toolkit providing some basic functionality. More...
#include <algorithmic_base.hpp>
Protected Attributes | |
int | outputLoggingIdx |
BooleanType | useModuleStandalone |
UserInteraction * | userInteraction |
Base class for all algorithmic modules within the ACADO Toolkit providing some basic functionality.
The class AlgorithmicBase is a base class for all algorithmic modules within the ACADO Toolkit. It provides a number of basic functionality such as routines to cope with options, logging and plotting objects.
The class AlgorithmicBase only tunnels this functionality to a pointer of the UserInteraction class. There are two different possibilities for using this class:
(i) Using this class stand-alone: if no pointer to an instance of the UserInteraction class is provided, an object of this class is automatically allocated (with default options and logging information as specified within each algorithmic module).
(ii) Using this class as (possibly nested) member of a top-level user interface: Usually an user interacts with a top-level user interface derived from the class UserInteraction. This interface does always have algorithmic modules as members for doing the actual computations. For ensuring that options, logging and plotting information specified by the user is actually handled by the algorithmic modules, they are provided with a pointer to this top-level user interface.
Definition at line 78 of file algorithmic_base.hpp.
BEGIN_NAMESPACE_ACADO AlgorithmicBase::AlgorithmicBase | ( | ) |
Default constructor for using the algorithmic module stand-alone.
Definition at line 44 of file algorithmic_base.cpp.
AlgorithmicBase::AlgorithmicBase | ( | UserInteraction * | _userInteraction | ) |
Constructor which takes a pointer to an instance of the UserInterface class. If this pointer is NULL, this constructor is equivalent to the default constructor.
[in] | _userInteraction | Pointer to top-level user interface. |
Definition at line 53 of file algorithmic_base.cpp.
AlgorithmicBase::AlgorithmicBase | ( | const AlgorithmicBase & | rhs | ) |
Copy constructor (deep copy).
@param[in] rhs Right-hand side object.
Definition at line 71 of file algorithmic_base.cpp.
|
virtual |
Destructor.
Definition at line 88 of file algorithmic_base.cpp.
|
inline |
Adds a record to the log collection.
@param[in] record Record to be added.
|
inline |
Add an option item with a given integer default value to the all option lists.
@param[in] name Name of new option item. @param[in] value Default value of new option.
|
inline |
Add an option item with a given double default value to the all option lists.
@param[in] name Name of new option item. @param[in] value Default value of new option.
|
inline |
Add an option item with a given integer default value to option list with given index.
@param[in] idx Index of option list. @param[in] name Name of new option item. @param[in] value Default value of new option.
|
inline |
Add an option item with a given double default value to option list with given index.
@param[in] idx Index of option list. @param[in] name Name of new option item. @param[in] value Default value of new option.
returnValue AlgorithmicBase::addOptionsList | ( | ) |
Adds an additional OptionsList to internal array.
Definition at line 120 of file algorithmic_base.cpp.
|
inline |
Returns value of an existing option item of integer type.
@param[in] name Name of option item. @param[out] value Value of option.
|
inline |
Returns value of an existing option item of double type.
@param[in] name Name of option item. @param[out] value Value of option.
|
inline |
Returns value of an existing option item of string type.
@param[in] name Name of option item. @param[out] value Value of option.
|
inline |
Returns value of an existing option item of integer type within the option list of given index.
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[out] | value | Value of option. |
|
inline |
Returns value of an existing option item of double type within the option list of given index.
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[out] | value | Value of option. |
|
inline |
Gets all numerical values at all time instants of the item with given name. 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. |
|
inline |
Gets numerical value at first time instant of the item with given name. 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. |
|
inline |
Gets numerical value at first time instant of the item with given name (converts internally used DMatrix into VariablesGrid). 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. |
|
inline |
Gets numerical value at last time instant of the item with given name. 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. |
|
inline |
Gets numerical value at last time instant of the item with given name (converts internally used DMatrix into VariablesGrid). 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. |
Returns an Options object containing exactly the option list with given index.
@param[in] idx Index of option list.
Definition at line 181 of file algorithmic_base.cpp.
|
inline |
Determines whether options of at least one option list have been modified.
\return BT_TRUE iff options have been modified, \n BT_FALSE otherwise
|
inline |
Determines whether options of option list with given index have been modified.
@param[in] idx Index of option list. \return BT_TRUE iff options have been modified, \n BT_FALSE otherwise
AlgorithmicBase & AlgorithmicBase::operator= | ( | const AlgorithmicBase & | rhs | ) |
Assignment operator (deep copy).
@param[in] rhs Right-hand side object.
Definition at line 98 of file algorithmic_base.cpp.
|
inline |
Plots all windows of the plot collection, each one into a new figure.
@param[in] _frequency Frequency determining at which time instants the window is to be plotted. \return SUCCESSFUL_RETURN
|
inline |
Prints whole record with specified index; all items are printed according to the output format settings.
[in] | idx | Index of record to be printed. |
[in] | _mode | Print mode: see documentation of LogPrintMode of details. |
|
inline |
Plots all windows of the plot collection, each one into the corresponding existing figure, if possible.
[in] | _frequency | Frequency determining at which time instants the window is to be plotted. |
returnValue AlgorithmicBase::set | ( | OptionsName | name, |
int | value | ||
) |
Sets value of an existing option item of integer type to a given value.
@param[in] name Name of option item. @param[in] value New value of option.
Definition at line 126 of file algorithmic_base.cpp.
returnValue AlgorithmicBase::set | ( | OptionsName | name, |
double | value | ||
) |
Sets value of an existing option item of double type to a given value.
@param[in] name Name of option item. @param[in] value New value of option.
Definition at line 134 of file algorithmic_base.cpp.
returnValue AlgorithmicBase::set | ( | OptionsName | name, |
const std::string & | value | ||
) |
Sets value of an existing option item of double type to a string value.
@param[in] name Name of option item. @param[in] value New value of option.
Definition at line 141 of file algorithmic_base.cpp.
returnValue AlgorithmicBase::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.
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[in] | value | New value of option. |
Definition at line 149 of file algorithmic_base.cpp.
returnValue AlgorithmicBase::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.
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[in] | value | New value of option. |
Definition at line 158 of file algorithmic_base.cpp.
|
inline |
Sets all numerical values at all time instants of all items with given name within all records.
[in] | _name | Internal name of item. |
[in] | values | All numerical values at all time instants of given item. |
|
inline |
Sets numerical value at last time instant of all items with given name within all records.
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
|
inline |
Sets numerical value at last time instant of all items with given name within all records.
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
|
inline |
Sets numerical value at last time instant of all items with given name within all records.
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
|
inline |
Sets numerical value at last time instant of all items with given name within all records.
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
|
inline |
Sets numerical value at last time instant of all items with given name within all records.
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
returnValue AlgorithmicBase::setOptions | ( | const Options & | arg | ) |
Assigns a given Options object to this object.
@param[in] arg New Options object to be assigned. \note This routine is introduced only for convenience and is equivalent to the assignment operator.
Definition at line 167 of file algorithmic_base.cpp.
returnValue AlgorithmicBase::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.
[in] | idx | Index of option list. |
[in] | arg | Options object containing the option list to be assigned. |
Definition at line 173 of file algorithmic_base.cpp.
|
protected |
Index of log record for algorithmic standard output to be optionally used within derived classes.
Definition at line 600 of file algorithmic_base.hpp.
|
protected |
Flag indicating whether algorithmic module is used stand-alone.
Definition at line 598 of file algorithmic_base.hpp.
|
protected |
Pointer to top-level user interface..
Definition at line 597 of file algorithmic_base.hpp.