sim_export.hpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00027 
00035 #ifndef ACADO_TOOLKIT_SIM_EXPORT_HPP
00036 #define ACADO_TOOLKIT_SIM_EXPORT_HPP
00037 
00038 #include <acado/code_generation/export_module.hpp>
00039 #include <acado/ocp/model_container.hpp>
00040 
00041 BEGIN_NAMESPACE_ACADO
00042 
00043 class IntegratorExport;
00044 
00060 class SIMexport : public ExportModule, public ModelContainer
00061 {
00062     //
00063     // PUBLIC MEMBER FUNCTIONS:
00064     //
00065     public:
00066 
00072                 SIMexport(      const uint simIntervals = 1,
00073                                         const double totalTime = 1.0 );
00074 
00079                 SIMexport(      const SIMexport& arg
00080                                         );
00081 
00084                 virtual ~SIMexport( );
00085 
00090         SIMexport& operator=(   const SIMexport& arg
00091                                                                 );
00092 
00093 
00103         virtual returnValue exportCode( const std::string& dirName,
00104                                                                                 const std::string& _realString = "real_t",
00105                                                                                 const std::string& _intString = "int",
00106                                                                                 int _precision = 16
00107                                                                                 );
00108 
00109 
00120                 returnValue exportAcadoHeader(  const std::string& _dirName,
00121                                                                                 const std::string& _fileName,
00122                                                                                 const std::string& _realString = "real_t",
00123                                                                                 const std::string& _intString = "int",
00124                                                                                 int _precision = 16
00125                                                                                 ) const;
00126 
00127 
00140         virtual returnValue exportAndRun(       const std::string& dirName,
00141 //                                                                                      const std::string& initStates = std::string( "initStates.txt" ),
00142                                                                                         const std::string& initStates,
00143 //                                                                                      const std::string& controls = std::string( "controls.txt" ),
00144                                                                                         const std::string& controls,
00145                                                                                         const std::string& results = std::string( "results.txt" ),
00146                                                                                         const std::string& ref = std::string( "ref.txt" )
00147                                                                                 );
00148                         
00149                         
00158                 virtual returnValue setReference(       const std::string& reference, const std::vector<std::string>& outputReference = *(new std::vector<std::string>())
00159                                                                                 );
00160                         
00161                         
00168                 virtual returnValue setTimingSteps( uint _timingSteps
00169                                                                                 );
00170                                                                                 
00171                         
00179                 virtual returnValue printDetails( bool details );
00180 
00181 
00182 
00183     protected:
00184 
00191                 returnValue copy(       const SIMexport& arg
00192                                                         );
00193 
00198                 returnValue clear( );
00199 
00200 
00213                 returnValue setup( );
00214 
00215 
00226                 returnValue checkConsistency( ) const;
00227 
00228 
00237                 returnValue collectDataDeclarations(    ExportStatementBlock& declarations,
00238                                                                                                 ExportStruct dataStruct = ACADO_ANY
00239                                                                                                 ) const;
00240 
00249                 returnValue collectFunctionDeclarations(        ExportStatementBlock& declarations
00250                                                                                                         ) const;
00251 
00252 
00265                 returnValue exportTest( const std::string& _dirName,
00266                                                                 const std::string& _fileName,
00267                                                                 const std::string& _resultsFile,
00268                                                                 const std::vector<std::string>& _outputFiles,
00269                                                                 const bool& TIMING = false,
00270                                                                 const uint jumpReference = 1
00271                                                                                 ) const;
00272 
00281                 returnValue exportEvaluation(   const std::string& _dirName,
00282                                                                                 const std::string& _fileName
00283                                                                                 ) const;
00284 
00295                 returnValue exportMakefile(     const std::string& _dirName,
00296                                                                         const std::string& _fileName,
00297                                                                         const std::string& _realString = "real_t",
00298                                                                         const std::string& _intString = "int",
00299                                                                         int _precision = 16
00300                                                                         ) const;
00301 
00308         returnValue executeTest( const std::string& _dirName );
00309 
00316         virtual returnValue setTimingCalls( uint _timingCalls
00317                                                                                 );
00318 
00319     protected:
00320 
00321         uint timingCalls;                                               
00323         double T;                                                               
00324                 IntegratorExport*  integrator;                  
00326                 bool referenceProvided;                 
00327                 bool PRINT_DETAILS;                             
00329                 static const uint factorRef = 10;               
00330                 uint timingSteps;                                               
00332                 std::string _initStates;                                                
00333                 std::string _controls;                                          
00334                 std::string _results;                                           
00335                 std::string _ref;                                                       
00337                 std::vector<std::string> _refOutputFiles;       
00338                 std::vector<std::string> _outputFiles;          
00340 };
00341 
00342 
00343 CLOSE_NAMESPACE_ACADO
00344 
00345 
00346 #endif  // ACADO_TOOLKIT_SIM_EXPORT_HPP
00347 
00348 // end of file.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 12:00:00