Public Member Functions | Protected Member Functions | Protected Attributes | Friends

Provides a generic way to store algorithmic information during runtime. More...

#include <logging.hpp>

Inheritance diagram for Logging:
Inheritance graph
[legend]

List of all members.

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< LogRecordlogCollection
int logIdx

Friends

class AlgorithmicBase

Detailed Description

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.

Author:
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Definition at line 55 of file logging.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 44 of file logging.cpp.

Logging::~Logging ( ) [virtual]

Destructor.

Definition at line 49 of file logging.cpp.


Member Function Documentation

int Logging::addLogRecord ( LogRecord record)

Adds a record to the log collection.

Parameters:
[in]recordRecord to be added.
Returns:
>= 0: index of added record,
-RET_LOG_COLLECTION_CORRUPTED

Definition at line 58 of file logging.cpp.

returnValue Logging::getAll ( LogName  _name,
MatrixVariablesGrid values 
) const [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.

Parameters:
[in]_nameInternal name of item.
[out]valuesAll numerical values at all time instants of given item.
Returns:
SUCCESSFUL_RETURN,
RET_LOG_ENTRY_DOESNT_EXIST
returnValue Logging::getFirst ( LogName  _name,
DMatrix firstValue 
) const [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.

Parameters:
[in]_nameInternal name of item.
[out]firstValueNumerical value at first time instant of given item.
Returns:
SUCCESSFUL_RETURN,
RET_LOG_ENTRY_DOESNT_EXIST
returnValue Logging::getFirst ( LogName  _name,
VariablesGrid firstValue 
) const [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.

Parameters:
[in]_nameInternal name of item.
[out]firstValueNumerical value at first time instant of given item.
Returns:
SUCCESSFUL_RETURN,
RET_LOG_ENTRY_DOESNT_EXIST
returnValue Logging::getLast ( LogName  _name,
DMatrix lastValue 
) const [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.

Parameters:
[in]_nameInternal name of item.
[out]lastValueNumerical value at last time instant of given item.
Returns:
SUCCESSFUL_RETURN,
RET_LOG_ENTRY_DOESNT_EXIST
returnValue Logging::getLast ( LogName  _name,
VariablesGrid lastValue 
) const [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.

Parameters:
[in]_nameInternal name of item.
[out]lastValueNumerical value at last time instant of given item.
Returns:
SUCCESSFUL_RETURN,
RET_LOG_ENTRY_DOESNT_EXIST

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.

Parameters:
[out]_recordDesired record.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

Definition at line 77 of file logging.cpp.

Returns number of records contained in the log collection.

Returns:
Number of records

Definition at line 103 of file logging.cpp.

int Logging::operator<< ( LogRecord record)

Adds a record to the log collection.

Parameters:
[in]recordRecord to be added.
Note:
This function is doing the same as the corresponding addLogRecord member function and is introduced for syntax reasons only.
Returns:
>= 0: index of added record,
-RET_LOG_COLLECTION_CORRUPTED

Reimplemented in UserInteraction.

Definition at line 52 of file logging.cpp.

Prints information on all records and their items on screen.

Returns:
SUCCESSFUL_RETURN

Definition at line 108 of file logging.cpp.

Definition at line 117 of file logging.cpp.

returnValue Logging::setAll ( LogName  _name,
const MatrixVariablesGrid values 
) [inline]

Sets all numerical values at all time instants of the item with given name.

Parameters:
[in]_nameInternal name of item.
[in]valuesAll numerical values at all time instants of given item.
Note:
All public setAll member functions make use of the protected setAll function.
Returns:
SUCCESSFUL_RETURN,
RET_LOG_RECORD_CORRUPTED
returnValue Logging::setLast ( LogName  _name,
const DMatrix value,
double  time = -INFTY 
) [inline]

Sets numerical value at last time instant of the item with given name.

Parameters:
[in]_nameInternal name of item.
[in]lastValueNumerical value at last time instant of given item.
[in]timeTime label of the instant.
Note:
All public setLast member functions make use of the protected setLast function.
Returns:
SUCCESSFUL_RETURN,
RET_LOG_ENTRY_DOESNT_EXIST
returnValue Logging::setLast ( LogName  _name,
VariablesGrid value,
double  time = -INFTY 
) [inline]

Sets numerical value at last time instant of the item with given name.

Parameters:
[in]_nameInternal name of item.
[in]lastValueNumerical value at last time instant of given item.
[in]timeTime label of the instant.
Note:
All public setLast member functions make use of the protected setLast function.
Returns:
SUCCESSFUL_RETURN,
RET_LOG_ENTRY_DOESNT_EXIST
returnValue Logging::setupLogging ( ) [protected, virtual]

Prototype member function for setting-up the logging information at initialization of derived classes.

Returns:
SUCCESSFUL_RETURN

Reimplemented in Process, Controller, IntegrationAlgorithm, SimulationEnvironment, RealTimeAlgorithm, and OptimizationAlgorithm.

Definition at line 134 of file logging.cpp.

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.

Parameters:
[in,out]_recordRecord to be updated
Returns:
SUCCESSFUL_RETURN

Definition at line 89 of file logging.cpp.


Friends And Related Function Documentation

friend class AlgorithmicBase [friend]

Definition at line 57 of file logging.hpp.


Member Data Documentation

std::vector< LogRecord > Logging::logCollection [protected]

Log collection containing a singly-linked list of log records.

Definition at line 275 of file logging.hpp.

int Logging::logIdx [protected]

Index of a certain log record to be optionally used within derived classes.

Definition at line 277 of file logging.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:24