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 
00034 #include <acado/control_law/control_law.hpp>
00035 
00036 
00037 BEGIN_NAMESPACE_ACADO
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 ControlLaw::ControlLaw( ) : SimulationBlock( BN_CONTROL_LAW )
00046 {
00047 }
00048 
00049 
00050 ControlLaw::ControlLaw( double _samplingTime
00051                                                 ) : SimulationBlock( BN_CONTROL_LAW,_samplingTime )
00052 {
00053 }
00054 
00055 
00056 ControlLaw::ControlLaw( const ControlLaw& rhs ) : SimulationBlock( rhs )
00057 {
00058         u = rhs.u;
00059         p = rhs.u;
00060 }
00061 
00062 
00063 ControlLaw::~ControlLaw( )
00064 {
00065 }
00066 
00067 
00068 ControlLaw& ControlLaw::operator=( const ControlLaw& rhs )
00069 {
00070         if ( this != &rhs )
00071         {
00072                 SimulationBlock::operator=( rhs );
00073 
00074                 u = rhs.u;
00075                 p = rhs.u;
00076         }
00077 
00078     return *this;
00079 }
00080 
00081 
00082 
00083 returnValue ControlLaw::initializeAlgebraicStates( const VariablesGrid& _xa_init )
00084 {
00085         return ACADOERROR( RET_NOT_IMPLEMENTED_IN_BASE_CLASS );
00086 }
00087 
00088 
00089 returnValue ControlLaw::initializeAlgebraicStates( const char* fileName )
00090 {
00091         return ACADOERROR( RET_NOT_IMPLEMENTED_IN_BASE_CLASS );
00092 }
00093 
00094 
00095 
00096 returnValue ControlLaw::initializeControls( const VariablesGrid& _u_init )
00097 {
00098         return ACADOERROR( RET_NOT_IMPLEMENTED_IN_BASE_CLASS );
00099 }
00100 
00101 
00102 returnValue ControlLaw::initializeControls( const char* fileName )
00103 {
00104         return ACADOERROR( RET_NOT_IMPLEMENTED_IN_BASE_CLASS );
00105 }
00106 
00107 
00108 
00109 
00110 returnValue ControlLaw::step(   const DVector& _x,
00111                                                                 const DVector& _p,
00112                                                                 const VariablesGrid& _yRef
00113                                                                 )
00114 {
00115     return step( 0.0,_x,_p,_yRef );
00116 }
00117 
00118 
00119 returnValue ControlLaw::feedbackStep(   double currentTime,
00120                                                                                 const DVector& _x,
00121                                                                                 const DVector& _p,
00122                                                                                 const VariablesGrid& _yRef
00123                                                                                 )
00124 {
00125         
00126         return step( currentTime,_x,_p,_yRef );
00127 }
00128 
00129 
00130 returnValue ControlLaw::preparationStep(        double nextTime,
00131                                                                                         const VariablesGrid& _yRef
00132                                                                                         )
00133 {
00134         
00135         return SUCCESSFUL_RETURN;
00136 }
00137 
00138 
00139 
00140 returnValue ControlLaw::shift(  double timeShift
00141                                                                 )
00142 {
00143         return ACADOERROR( RET_NO_REALTIME_MODE_AVAILABLE );
00144 }
00145 
00146 
00147 
00148 uint ControlLaw::getNX( ) const
00149 {
00150         return 0;
00151 }
00152 
00153 
00154 uint ControlLaw::getNXA( ) const
00155 {
00156         return 0;
00157 }
00158 
00159 
00160 uint ControlLaw::getNU( ) const
00161 {
00162         return 0;
00163 }
00164 
00165 
00166 uint ControlLaw::getNP( ) const
00167 {
00168         return 0;
00169 }
00170 
00171 
00172 uint ControlLaw::getNW( ) const
00173 {
00174         return 0;
00175 }
00176 
00177 
00178 uint ControlLaw::getNY( ) const
00179 {
00180         return 0;
00181 }
00182 
00183 
00184 double ControlLaw::getLengthPredictionHorizon( ) const
00185 {
00186         return samplingTime;
00187 }
00188 
00189 
00190 double ControlLaw::getLengthControlHorizon( ) const
00191 {
00192         return samplingTime;
00193 }
00194 
00195 
00196 
00197 
00198 
00199 
00200 BooleanType ControlLaw::isInRealTimeMode( ) const
00201 {
00202         return BT_FALSE;
00203 }
00204 
00205 
00206 
00207 CLOSE_NAMESPACE_ACADO
00208 
00209