algorithmic_base.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_ALGORITHMIC_BASE_HPP
34 #define ACADO_TOOLKIT_ALGORITHMIC_BASE_HPP
35 
36 
39 
40 
41 
43 
44 
79 {
80  //
81  // PUBLIC MEMBER FUNCTIONS:
82  //
83  public:
84 
87  AlgorithmicBase( );
88 
95  AlgorithmicBase( UserInteraction* _userInteraction
96  );
97 
103  );
104 
106  virtual ~AlgorithmicBase( );
107 
113  );
114 
115 
121 
122 
133  int value
134  );
135 
146  double value
147  );
148 
159  const std::string& value
160  );
161 
174  returnValue set( uint idx,
176  int value
177  );
178 
191  returnValue set( uint idx,
193  double value
194  );
195 
196 
206  returnValue setOptions( const Options &arg
207  );
208 
218  const Options &arg
219  );
220 
227  Options getOptions( uint idx
228  ) const;
229 
230 
242  inline returnValue getAll( LogName _name,
243  MatrixVariablesGrid& values
244  ) const;
245 
246 
258  inline returnValue getFirst( LogName _name,
259  DMatrix& firstValue
260  ) const;
261 
273  inline returnValue getFirst( LogName _name,
274  VariablesGrid& firstValue
275  ) const;
276 
277 
289  inline returnValue getLast( LogName _name,
290  DMatrix& lastValue
291  ) const;
292 
304  inline returnValue getLast( LogName _name,
305  VariablesGrid& lastValue
306  ) const;
307 
308 
317  inline returnValue get( OptionsName name,
318  int& value
319  ) const;
320 
329  inline returnValue get( OptionsName name,
330  double& value
331  ) const;
332 
341  inline returnValue get( OptionsName name,
342  std::string& value
343  ) const;
344 
356  inline returnValue get( uint idx,
358  int& value
359  ) const;
360 
372  inline returnValue get( uint idx,
374  double& value
375  ) const;
376 
377 
387  inline returnValue addOption( OptionsName name,
388  int value
389  );
390 
400  inline returnValue addOption( OptionsName name,
401  double value
402  );
403 
415  inline returnValue addOption( uint idx,
416  OptionsName name,
417  int value
418  );
419 
431  inline returnValue addOption( uint idx,
432  OptionsName name,
433  double value
434  );
435 
436 
442  inline BooleanType haveOptionsChanged( ) const;
443 
452  ) const;
453 
454 
464  inline returnValue setAll( LogName _name,
465  const MatrixVariablesGrid& values
466  );
467 
468 
479  inline returnValue setLast( LogName _name,
480  int lastValue,
481  double time = -INFTY
482  );
483 
494  inline returnValue setLast( LogName _name,
495  double lastValue,
496  double time = -INFTY
497  );
498 
509  inline returnValue setLast( LogName _name,
510  const DVector& lastValue,
511  double time = -INFTY
512  );
513 
524  inline returnValue setLast( LogName _name,
525  const DMatrix& lastValue,
526  double time = -INFTY
527  );
528 
539  inline returnValue setLast( LogName _name,
540  const VariablesGrid& lastValue,
541  double time = -INFTY
542  );
543 
544 
552  inline int addLogRecord( LogRecord& _record
553  );
554 
555 
567  inline returnValue printLogRecord( std::ostream& _stream,
568  int idx,
570  ) const;
571 
572 
579  inline returnValue plot( PlotFrequency _frequency = PLOT_IN_ANY_CASE
580  );
581 
589  inline returnValue replot( PlotFrequency _frequency = PLOT_IN_ANY_CASE
590  );
591 
592 
593  //
594  // DATA MEMBERS:
595  //
596  protected:
601 };
602 
603 
605 
606 
607 #include <acado/user_interaction/algorithmic_base.ipp>
608 
609 
610 #endif // ACADO_TOOLKIT_ALGORITHMIC_BASE_HPP
611 
612 
613 /*
614  * end of file
615  */
returnValue setLast(LogName _name, int lastValue, double time=-INFTY)
returnValue setOptions(const Options &arg)
returnValue getAll(LogName _name, MatrixVariablesGrid &values) const
returnValue getFirst(LogName _name, DMatrix &firstValue) const
const double INFTY
UserInteraction * userInteraction
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
AlgorithmicBase & operator=(const AlgorithmicBase &rhs)
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
#define CLOSE_NAMESPACE_ACADO
returnValue addOptionsList()
PlotFrequency
LogPrintMode
Provides a time grid consisting of matrix-valued optimization variables at each grid point...
Provides a generic way to set and pass user-specified options.
Definition: options.hpp:65
returnValue printLogRecord(std::ostream &_stream, int idx, LogPrintMode _mode=PRINT_ITEM_BY_ITEM) const
virtual ~AlgorithmicBase()
LogName
returnValue replot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
Encapsulates all user interaction for setting options, logging data and plotting results.
void rhs(const real_t *x, real_t *f)
returnValue plot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
Options getOptions(uint idx) const
Allows to setup and store user-specified log records of algorithmic information.
Definition: log_record.hpp:72
#define BEGIN_NAMESPACE_ACADO
int addLogRecord(LogRecord &_record)
BooleanType haveOptionsChanged() const
BooleanType useModuleStandalone
OptionsName
returnValue addOption(OptionsName name, int value)
returnValue setAll(LogName _name, const MatrixVariablesGrid &values)
returnValue getLast(LogName _name, DMatrix &lastValue) const


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