sim_export.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 
27 
35 #ifndef ACADO_TOOLKIT_SIM_EXPORT_HPP
36 #define ACADO_TOOLKIT_SIM_EXPORT_HPP
37 
40 
42 
43 class IntegratorExport;
44 
60 class SIMexport : public ExportModule, public ModelContainer
61 {
62  //
63  // PUBLIC MEMBER FUNCTIONS:
64  //
65  public:
66 
72  SIMexport( const uint simIntervals = 1,
73  const double totalTime = 1.0 );
74 
79  SIMexport( const SIMexport& arg
80  );
81 
84  virtual ~SIMexport( );
85 
90  SIMexport& operator=( const SIMexport& arg
91  );
92 
93 
103  virtual returnValue exportCode( const std::string& dirName,
104  const std::string& _realString = "real_t",
105  const std::string& _intString = "int",
106  int _precision = 16
107  );
108 
109 
120  returnValue exportAcadoHeader( const std::string& _dirName,
121  const std::string& _fileName,
122  const std::string& _realString = "real_t",
123  const std::string& _intString = "int",
124  int _precision = 16
125  ) const;
126 
127 
140  virtual returnValue exportAndRun( const std::string& dirName,
141 // const std::string& initStates = std::string( "initStates.txt" ),
142  const std::string& initStates,
143 // const std::string& controls = std::string( "controls.txt" ),
144  const std::string& controls,
145  const std::string& results = std::string( "results.txt" ),
146  const std::string& ref = std::string( "ref.txt" )
147  );
148 
149 
158  virtual returnValue setReference( const std::string& reference, const std::vector<std::string>& outputReference = *(new std::vector<std::string>())
159  );
160 
161 
168  virtual returnValue setTimingSteps( uint _timingSteps
169  );
170 
171 
179  virtual returnValue printDetails( bool details );
180 
181 
182 
183  protected:
184 
191  returnValue copy( const SIMexport& arg
192  );
193 
198  returnValue clear( );
199 
200 
213  returnValue setup( );
214 
215 
226  returnValue checkConsistency( ) const;
227 
228 
238  ExportStruct dataStruct = ACADO_ANY
239  ) const;
240 
250  ) const;
251 
252 
265  returnValue exportTest( const std::string& _dirName,
266  const std::string& _fileName,
267  const std::string& _resultsFile,
268  const std::vector<std::string>& _outputFiles,
269  const bool& TIMING = false,
270  const uint jumpReference = 1
271  ) const;
272 
281  returnValue exportEvaluation( const std::string& _dirName,
282  const std::string& _fileName
283  ) const;
284 
295  returnValue exportMakefile( const std::string& _dirName,
296  const std::string& _fileName,
297  const std::string& _realString = "real_t",
298  const std::string& _intString = "int",
299  int _precision = 16
300  ) const;
301 
308  returnValue executeTest( const std::string& _dirName );
309 
316  virtual returnValue setTimingCalls( uint _timingCalls
317  );
318 
319  protected:
320 
323  double T;
329  static const uint factorRef = 10;
332  std::string _initStates;
333  std::string _controls;
334  std::string _results;
335  std::string _ref;
337  std::vector<std::string> _refOutputFiles;
338  std::vector<std::string> _outputFiles;
340 };
341 
342 
344 
345 
346 #endif // ACADO_TOOLKIT_SIM_EXPORT_HPP
347 
348 // end of file.
virtual returnValue setTimingCalls(uint _timingCalls)
Definition: sim_export.cpp:946
returnValue executeTest(const std::string &_dirName)
Definition: sim_export.cpp:931
returnValue collectDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
Definition: sim_export.cpp:340
returnValue clear()
Definition: sim_export.cpp:252
double T
Definition: sim_export.hpp:323
virtual ~SIMexport()
Definition: sim_export.cpp:83
virtual returnValue printDetails(bool details)
Definition: sim_export.cpp:924
Allows to pass back messages to the calling function.
virtual returnValue setReference(const std::string &reference, const std::vector< std::string > &outputReference=*(new std::vector< std::string >()))
Definition: sim_export.cpp:904
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
virtual returnValue setTimingSteps(uint _timingSteps)
Definition: sim_export.cpp:917
std::string _initStates
Definition: sim_export.hpp:332
std::string _ref
Definition: sim_export.hpp:335
#define CLOSE_NAMESPACE_ACADO
returnValue collectFunctionDeclarations(ExportStatementBlock &declarations) const
Definition: sim_export.cpp:351
returnValue exportMakefile(const std::string &_dirName, const std::string &_fileName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
Definition: sim_export.cpp:877
uint timingSteps
Definition: sim_export.hpp:330
User-interface to automatically generate simulation algorithms for fast optimal control.
Definition: sim_export.hpp:60
User-interface to automatically generate algorithms for fast model predictive control.
returnValue exportEvaluation(const std::string &_dirName, const std::string &_fileName) const
Definition: sim_export.cpp:572
#define TIMING
Definition: AD_test.c:51
Container class to store and pass data to the ModelData class.
IntegratorExport * integrator
Definition: sim_export.hpp:324
ExportStruct
uint timingCalls
Definition: sim_export.hpp:321
virtual returnValue exportAndRun(const std::string &dirName, const std::string &initStates, const std::string &controls, const std::string &results=std::string("results.txt"), const std::string &ref=std::string("ref.txt"))
Definition: sim_export.cpp:746
virtual returnValue exportCode(const std::string &dirName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16)
Definition: sim_export.cpp:104
returnValue setup()
Definition: sim_export.cpp:262
bool PRINT_DETAILS
Definition: sim_export.hpp:327
std::vector< std::string > _outputFiles
Definition: sim_export.hpp:338
std::string _controls
Definition: sim_export.hpp:333
Allows to export a tailored integrator for fast model predictive control.
bool referenceProvided
Definition: sim_export.hpp:326
returnValue checkConsistency() const
Definition: sim_export.cpp:318
#define BEGIN_NAMESPACE_ACADO
returnValue exportTest(const std::string &_dirName, const std::string &_fileName, const std::string &_resultsFile, const std::vector< std::string > &_outputFiles, const bool &TIMING=false, const uint jumpReference=1) const
Definition: sim_export.cpp:361
std::vector< std::string > _refOutputFiles
Definition: sim_export.hpp:337
returnValue exportAcadoHeader(const std::string &_dirName, const std::string &_fileName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
Definition: sim_export.cpp:803
Allows to export code for a block of statements.
SIMexport(const uint simIntervals=1, const double totalTime=1.0)
Definition: sim_export.cpp:56
std::string _results
Definition: sim_export.hpp:334
SIMexport & operator=(const SIMexport &arg)
Definition: sim_export.cpp:89
returnValue copy(const SIMexport &arg)
Definition: sim_export.cpp:234
static const uint factorRef
Definition: sim_export.hpp:329


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