logging.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
33 #ifndef ACADO_TOOLKIT_LOGGING_HPP
34 #define ACADO_TOOLKIT_LOGGING_HPP
35 
38 
40 
42 
55 class Logging
56 {
57  friend class AlgorithmicBase;
58 
59  //
60  // PUBLIC MEMBER FUNCTIONS:
61  //
62  public:
63 
65  Logging( );
66 
68  virtual ~Logging( );
69 
80  int operator<<( LogRecord& record
81  );
82 
90  int addLogRecord( LogRecord& record
91  );
92 
104  ) const;
105 
116  ) const;
117 
129  inline returnValue getAll( LogName _name,
130  MatrixVariablesGrid& values
131  ) const;
132 
144  inline returnValue getFirst( LogName _name,
145  DMatrix& firstValue
146  ) const;
147 
159  inline returnValue getFirst( LogName _name,
160  VariablesGrid& firstValue
161  ) const;
162 
174  inline returnValue getLast( LogName _name,
175  DMatrix& lastValue
176  ) const;
177 
189  inline returnValue getLast( LogName _name,
190  VariablesGrid& lastValue
191  ) const;
192 
204  inline returnValue setAll( LogName _name,
205  const MatrixVariablesGrid& values
206  );
207 
208 
221  inline returnValue setLast( LogName _name,
222  const DMatrix& value,
223  double time = -INFTY
224  );
225 
238  inline returnValue setLast( LogName _name,
239  VariablesGrid& value,
240  double time = -INFTY
241  );
242 
247  uint getNumLogRecords( ) const;
248 
249 
254  returnValue printLoggingInfo( ) const;
255 
256  returnValue printNumDoubles( ) const;
257 
258  //
259  // PROTECTED MEMBER FUNCTIONS:
260  //
261  protected:
262 
268  virtual returnValue setupLogging( );
269 
270  //
271  // DATA MEMBERS:
272  //
273  protected:
275  std::vector< LogRecord > logCollection;
277  int logIdx;
278 };
279 
281 
282 #include <acado/user_interaction/logging.ipp>
283 
284 #endif // ACADO_TOOLKIT_LOGGING_HPP
285 
286 /*
287  * end of file
288  */
returnValue printLoggingInfo() const
Definition: logging.cpp:108
const double INFTY
returnValue getFirst(LogName _name, DMatrix &firstValue) const
Provides a time grid consisting of vector-valued optimization variables at each grid point...
int addLogRecord(LogRecord &record)
Definition: logging.cpp:58
Allows to pass back messages to the calling function.
Base class for all algorithmic modules within the ACADO Toolkit providing some basic functionality...
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
Provides a generic way to store algorithmic information during runtime.
Definition: logging.hpp:55
int operator<<(LogRecord &record)
Definition: logging.cpp:52
#define CLOSE_NAMESPACE_ACADO
int logIdx
Definition: logging.hpp:277
returnValue setLast(LogName _name, const DMatrix &value, double time=-INFTY)
returnValue getAll(LogName _name, MatrixVariablesGrid &values) const
virtual ~Logging()
Definition: logging.cpp:49
Logging()
Definition: logging.cpp:44
returnValue getLast(LogName _name, DMatrix &lastValue) const
Provides a time grid consisting of matrix-valued optimization variables at each grid point...
LogName
returnValue updateLogRecord(LogRecord &_record) const
Definition: logging.cpp:89
virtual returnValue setupLogging()
Definition: logging.cpp:134
returnValue setAll(LogName _name, const MatrixVariablesGrid &values)
uint getNumLogRecords() const
Definition: logging.cpp:103
returnValue getLogRecord(LogRecord &_record) const
Definition: logging.cpp:77
std::vector< LogRecord > logCollection
Definition: logging.hpp:275
returnValue printNumDoubles() const
Definition: logging.cpp:117
Allows to setup and store user-specified log records of algorithmic information.
Definition: log_record.hpp:72
#define BEGIN_NAMESPACE_ACADO
static BEGIN_NAMESPACE_ACADO LogRecord emptyLogRecord
Definition: logging.hpp:41


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