control_law.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_CONTROL_LAW_HPP
34 #define ACADO_TOOLKIT_CONTROL_LAW_HPP
35 
36 
39 
40 
42 
43 
65 {
66  //
67  // PUBLIC MEMBER FUNCTIONS:
68  //
69  public:
70 
73  ControlLaw( );
74 
79  ControlLaw( double _samplingTime
80  );
81 
86  ControlLaw( const ControlLaw& rhs
87  );
88 
91  virtual ~ControlLaw( );
92 
97  ControlLaw& operator=( const ControlLaw& rhs
98  );
99 
104  virtual ControlLaw* clone( ) const = 0;
105 
106 
113  virtual returnValue initializeAlgebraicStates( const VariablesGrid& _xa_init
114  );
115 
123  virtual returnValue initializeAlgebraicStates( const char* fileName
124  );
125 
126 
133  virtual returnValue initializeControls( const VariablesGrid& _u_init
134  );
135 
143  virtual returnValue initializeControls( const char* fileName
144  );
145 
146 
158  virtual returnValue init( double startTime = 0.0,
159  const DVector& _x = emptyConstVector,
160  const DVector& _p = emptyConstVector,
162  ) = 0;
163 
164 
177  virtual returnValue step( double currentTime,
178  const DVector& _x,
179  const DVector& _p = emptyConstVector,
181  ) = 0;
182 
194  virtual returnValue step( const DVector& _x,
195  const DVector& _p = emptyConstVector,
197  );
198 
211  virtual returnValue feedbackStep( double currentTime,
212  const DVector& _x,
213  const DVector& _p = emptyConstVector,
215  );
216 
224  virtual returnValue preparationStep( double nextTime = 0.0,
226  );
227 
228 
233  virtual returnValue shift( double timeShift = -1.0
234  );
235 
236 
243  inline returnValue getU( DVector& _u
244  ) const;
245 
252  inline returnValue getP( DVector& _p
253  ) const;
254 
255 
260  virtual uint getNX( ) const;
261 
266  virtual uint getNXA( ) const;
267 
272  virtual uint getNU( ) const;
273 
278  virtual uint getNP( ) const;
279 
284  virtual uint getNW( ) const;
285 
290  virtual uint getNY( ) const;
291 
292 
297  virtual double getLengthPredictionHorizon( ) const;
298 
303  virtual double getLengthControlHorizon( ) const;
304 
305 
312  virtual BooleanType isDynamic( ) const = 0;
313 
319  virtual BooleanType isStatic( ) const = 0;
320 
326  virtual BooleanType isInRealTimeMode( ) const;
327 
328 
329  //
330  // PROTECTED MEMBER FUNCTIONS:
331  //
332  protected:
333 
334 
335 
336  //
337  // DATA MEMBERS:
338  //
339  protected:
340 
343 };
344 
345 
347 
348 
349 #include <acado/control_law/control_law.ipp>
350 
351 
352 #endif // ACADO_TOOLKIT_CONTROL_LAW_HPP
353 
354 /*
355  * end of file
356  */
virtual returnValue initializeControls(const VariablesGrid &_u_init)
Definition: control_law.cpp:96
ControlLaw & operator=(const ControlLaw &rhs)
Definition: control_law.cpp:68
virtual uint getNY() const
virtual uint getNX() const
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
virtual BooleanType isInRealTimeMode() const
virtual BooleanType isDynamic() const =0
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
virtual returnValue feedbackStep(double currentTime, const DVector &_x, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid)
#define CLOSE_NAMESPACE_ACADO
virtual uint getNXA() const
virtual ~ControlLaw()
Definition: control_law.cpp:63
virtual uint getNU() const
virtual returnValue shift(double timeShift=-1.0)
static const DVector emptyConstVector
Definition: vector.hpp:336
returnValue getP(DVector &_p) const
virtual returnValue initializeAlgebraicStates(const VariablesGrid &_xa_init)
Definition: control_law.cpp:83
virtual ControlLaw * clone() const =0
virtual returnValue preparationStep(double nextTime=0.0, const VariablesGrid &_yRef=emptyConstVariablesGrid)
virtual uint getNP() const
void rhs(const real_t *x, real_t *f)
returnValue getU(DVector &_u) const
Base class for building-blocks of the SimulationEnvironment.
virtual double getLengthControlHorizon() const
#define BEGIN_NAMESPACE_ACADO
virtual uint getNW() const
virtual double getLengthPredictionHorizon() const
virtual returnValue step(double currentTime, const DVector &_x, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid)=0
virtual BooleanType isStatic() const =0
virtual returnValue init(double startTime=0.0, const DVector &_x=emptyConstVector, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid)=0
Base class for interfacing online feedback laws to be used within a Controller.
Definition: control_law.hpp:64
static const VariablesGrid emptyConstVariablesGrid


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