control_law.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 
00033 #ifndef ACADO_TOOLKIT_CONTROL_LAW_HPP
00034 #define ACADO_TOOLKIT_CONTROL_LAW_HPP
00035 
00036 
00037 #include <acado/utils/acado_utils.hpp>
00038 #include <acado/simulation_environment/simulation_block.hpp>
00039 
00040 
00041 BEGIN_NAMESPACE_ACADO
00042 
00043 
00064 class ControlLaw : public SimulationBlock
00065 {
00066         //
00067         // PUBLIC MEMBER FUNCTIONS:
00068         //
00069         public:
00070 
00073                 ControlLaw( );
00074 
00079                 ControlLaw(     double _samplingTime
00080                                         );
00081 
00086                 ControlLaw(     const ControlLaw& rhs
00087                                         );
00088 
00091                 virtual ~ControlLaw( );
00092 
00097                 ControlLaw& operator=(  const ControlLaw& rhs
00098                                                                 );
00099 
00104                 virtual ControlLaw* clone( ) const = 0;
00105 
00106 
00113                 virtual returnValue initializeAlgebraicStates(  const VariablesGrid& _xa_init
00114                                                                                                                 );
00115 
00123                 virtual returnValue initializeAlgebraicStates(  const char* fileName
00124                                                                                                                 );
00125 
00126 
00133                 virtual returnValue initializeControls( const VariablesGrid& _u_init
00134                                                                                                 );
00135 
00143                 virtual returnValue initializeControls( const char* fileName
00144                                                                                                 );
00145 
00146 
00158                 virtual returnValue init(       double startTime = 0.0,
00159                                                                         const DVector& _x = emptyConstVector,
00160                                                                         const DVector& _p = emptyConstVector,
00161                                                                         const VariablesGrid& _yRef = emptyConstVariablesGrid
00162                                                                         ) = 0;
00163 
00164 
00177                 virtual returnValue step(       double currentTime,
00178                                                                         const DVector& _x,
00179                                                                         const DVector& _p = emptyConstVector,
00180                                                                         const VariablesGrid& _yRef = emptyConstVariablesGrid
00181                                                                         ) = 0;
00182                                                                         
00194                 virtual returnValue step(       const DVector& _x,
00195                                                                         const DVector& _p = emptyConstVector,
00196                                                                         const VariablesGrid& _yRef = emptyConstVariablesGrid
00197                                                                         );
00198 
00211                 virtual returnValue feedbackStep(       double currentTime,
00212                                                                                         const DVector& _x,
00213                                                                                         const DVector& _p = emptyConstVector,
00214                                                                                         const VariablesGrid& _yRef = emptyConstVariablesGrid
00215                                                                                         );
00216 
00224                 virtual returnValue preparationStep(    double nextTime = 0.0,
00225                                                                                                 const VariablesGrid& _yRef = emptyConstVariablesGrid
00226                                                                                                 );
00227 
00228 
00233                 virtual returnValue shift(      double timeShift = -1.0
00234                                                                         );
00235 
00236                                                                         
00243                 inline returnValue getU(        DVector& _u
00244                                                                         ) const;
00245 
00252                 inline returnValue getP(        DVector& _p
00253                                                                         ) const;
00254 
00255 
00260                 virtual uint getNX( ) const;
00261 
00266                 virtual uint getNXA( ) const;
00267 
00272                 virtual uint getNU( ) const;
00273 
00278                 virtual uint getNP( ) const;
00279 
00284                 virtual uint getNW( ) const;
00285 
00290                 virtual uint getNY( ) const;
00291 
00292 
00297                 virtual double getLengthPredictionHorizon( ) const;
00298 
00303                 virtual double getLengthControlHorizon( ) const;
00304 
00305 
00312                 virtual BooleanType isDynamic( ) const = 0;
00313 
00319                 virtual BooleanType isStatic( ) const = 0;
00320 
00326                 virtual BooleanType isInRealTimeMode( ) const;
00327 
00328 
00329         //
00330         // PROTECTED MEMBER FUNCTIONS:
00331         //
00332         protected:
00333 
00334 
00335 
00336         //
00337         // DATA MEMBERS:
00338         //
00339         protected:
00340 
00341                 DVector u;                                                      
00342                 DVector p;                                                      
00343 };
00344 
00345 
00346 CLOSE_NAMESPACE_ACADO
00347 
00348 
00349 #include <acado/control_law/control_law.ipp>
00350 
00351 
00352 #endif  // ACADO_TOOLKIT_CONTROL_LAW_HPP
00353 
00354 /*
00355  *      end of file
00356  */


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