Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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
00331
00332 protected:
00333
00334
00335
00336
00337
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
00356