Provides a generic way to store algorithmic information during runtime. More...
#include <logging.hpp>
Public Member Functions | |
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 () |
Protected Member Functions | |
virtual returnValue | setupLogging () |
Protected Attributes | |
std::vector< LogRecord > | logCollection |
int | logIdx |
Friends | |
class | AlgorithmicBase |
Provides a generic way to store algorithmic information during runtime.
The class Logging provides a generic way to store algorithmic information during runtime. This class is part of the UserInterface class, i.e. all classes that are intended to interact with the user inherit the public functionality of the Logging class.
Definition at line 55 of file logging.hpp.
BEGIN_NAMESPACE_ACADO Logging::Logging | ( | ) |
Default constructor.
Definition at line 44 of file logging.cpp.
|
virtual |
Destructor.
Definition at line 49 of file logging.cpp.
int Logging::addLogRecord | ( | LogRecord & | record | ) |
Adds a record to the log collection.
@param[in] record Record to be added.
Definition at line 58 of file logging.cpp.
|
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. |
returnValue Logging::getLogRecord | ( | LogRecord & | _record | ) | const |
Returns the record with certain index from the log collection. 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. |
Definition at line 77 of file logging.cpp.
uint Logging::getNumLogRecords | ( | ) | const |
Returns number of records contained in the log collection.
Definition at line 103 of file logging.cpp.
int Logging::operator<< | ( | LogRecord & | record | ) |
Adds a record to the log collection.
@param[in] record Record to be added. \note This function is doing the same as the corresponding addLogRecord member function and is introduced for syntax reasons only.
Definition at line 52 of file logging.cpp.
returnValue Logging::printLoggingInfo | ( | ) | const |
Prints information on all records and their items on screen.
Definition at line 108 of file logging.cpp.
returnValue Logging::printNumDoubles | ( | ) | const |
Definition at line 117 of file logging.cpp.
|
inline |
Sets all numerical values at all time instants of the item with given name.
[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 the item with given name.
[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 the item with given name.
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
|
protectedvirtual |
Prototype member function for setting-up the logging information at initialization of derived classes.
Reimplemented in Process, Controller, IntegrationAlgorithm, SimulationEnvironment, RealTimeAlgorithm, and OptimizationAlgorithm.
Definition at line 134 of file logging.cpp.
returnValue Logging::updateLogRecord | ( | LogRecord & | _record | ) | const |
Updates all items with the record given as argument. 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 |
Definition at line 89 of file logging.cpp.
|
friend |
Definition at line 57 of file logging.hpp.
|
protected |
Log collection containing a singly-linked list of log records.
Definition at line 275 of file logging.hpp.
|
protected |
Index of a certain log record to be optionally used within derived classes.
Definition at line 277 of file logging.hpp.