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
00032 #ifndef ACADO_TOOLKIT_OCP_HPP
00033 #define ACADO_TOOLKIT_OCP_HPP
00034
00035 #include <acado/ocp/multi_objective_functionality.hpp>
00036 #include <acado/ocp/model_container.hpp>
00037
00038 BEGIN_NAMESPACE_ACADO
00039
00040 class Grid;
00041 class Objective;
00042 class Constraint;
00043
00089 class OCP: public MultiObjectiveFunctionality, public ModelContainer
00090 {
00091 public:
00092
00095 OCP( const double &tStart_ = 0.0,
00096 const double &tEnd_ = 1.0,
00097 const int &N_ = 20 );
00098
00099
00102 OCP( const double &tStart_,
00103 const double &tEnd_,
00104 const DVector& _numSteps );
00105
00106
00110 OCP( const double &tStart_,
00111 const Parameter &tEnd_,
00112 const int &N_ = 20 );
00113
00114
00117 OCP( const Grid &grid_ );
00118
00119
00121 virtual ~OCP( );
00122
00126 returnValue minimizeMayerTerm( const Expression& arg );
00127
00128
00134 returnValue minimizeMayerTerm( const int &multiObjectiveIdx, const Expression& arg );
00135
00136
00144 returnValue maximizeMayerTerm( const Expression& arg );
00145
00146
00150 returnValue minimizeLagrangeTerm( const Expression& arg );
00151
00152
00156 returnValue maximizeLagrangeTerm( const Expression& arg );
00157
00176 returnValue minimizeLSQ( const DMatrix &S,
00177 const Function &h,
00178 const DVector &r );
00179
00180 returnValue minimizeLSQ( const Function &h,
00181 const DVector &r );
00182
00183 returnValue minimizeLSQ( const Function &h );
00184
00185 returnValue minimizeLSQ( const MatrixVariablesGrid &S,
00186 const Function &h,
00187 const VariablesGrid &r );
00188
00189 returnValue minimizeLSQ( const DMatrix &S,
00190 const Function &h,
00191 const VariablesGrid &r );
00192
00193 returnValue minimizeLSQ( const Function &h,
00194 const VariablesGrid &r );
00195
00196 returnValue minimizeLSQ( const MatrixVariablesGrid &S,
00197 const Function &h,
00198 const char* rFilename );
00199
00200 returnValue minimizeLSQ( const DMatrix &S,
00201 const Function &h,
00202 const char* rFilename );
00203
00204 returnValue minimizeLSQ( const Function &h,
00205 const char* rFilename );
00206
00208 returnValue minimizeLSQ( const DMatrix& S,
00209 const Function& h );
00210
00213 returnValue minimizeLSQ( const BMatrix& S,
00214 const Function& h );
00215
00217 returnValue minimizeLSQ( const DMatrix& S,
00218 const std::string& h );
00219
00222 returnValue minimizeLSQ( const BMatrix& S,
00223 const std::string& h );
00224
00242 returnValue minimizeLSQEndTerm( const DMatrix & S,
00243 const Function & m,
00244 const DVector & r );
00245
00246 returnValue minimizeLSQEndTerm( const Function & m,
00247 const DVector & r );
00248
00250 returnValue minimizeLSQEndTerm( const DMatrix& S,
00251 const Function& m );
00252
00254 returnValue minimizeLSQEndTerm( const DMatrix& S,
00255 const std::string& m );
00256
00259 returnValue minimizeLSQEndTerm( const BMatrix& S,
00260 const Function& m );
00261
00264 returnValue minimizeLSQEndTerm( const BMatrix& S,
00265 const std::string& m );
00266
00274 returnValue minimizeLSQLinearTerms( const DVector& Slx,
00275 const DVector& Slu );
00276
00279 returnValue minimizeLSQLinearTerms( const BVector& Slx,
00280 const BVector& Slu );
00290 returnValue subjectTo( const DifferentialEquation& differentialEquation_ );
00291
00292
00297 returnValue subjectTo( const ConstraintComponent& component );
00298
00299
00304 returnValue subjectTo( int index_, const ConstraintComponent& component );
00305
00306
00322 returnValue subjectTo( const double lb_,
00323 const Expression& arg1,
00324 const Expression& arg2,
00325 const double ub_ );
00326
00327
00343 returnValue subjectTo( const double lb_, const Expression *arguments, const double ub_ );
00344
00357 returnValue subjectTo( const DVector& _lb, const Expression& _expr, const DVector& _ub );
00358
00359 returnValue subjectTo( int _index, const DVector& _lb, const Expression& _expr, const DVector& _ub );
00360
00367 BooleanType hasObjective () const;
00368 BooleanType hasConstraint () const;
00369
00370 returnValue getGrid ( Grid& grid_ ) const;
00371 returnValue getObjective ( Objective& objective_ ) const;
00372 returnValue getObjective ( const int &multiObjectiveIdx, Expression **arg ) const;
00373
00374 returnValue getConstraint( Constraint& constraint_ ) const;
00375
00376 returnValue setObjective ( const Objective & objective_ );
00377 returnValue setConstraint( const Constraint& constraint_ );
00378 returnValue setNumberIntegrationSteps( const uint numSteps );
00379
00384 virtual BooleanType hasEquidistantGrid( ) const;
00385
00386 double getStartTime ( ) const;
00387 double getEndTime( ) const;
00390 protected:
00391
00392 void setupGrid( double tStart, double tEnd, int N );
00393 void setupGrid( const DVector& times );
00394
00396 std::tr1::shared_ptr<Grid> grid;
00398 std::tr1::shared_ptr<Objective> objective;
00400 std::tr1::shared_ptr<Constraint> constraint;
00401 };
00402
00403 CLOSE_NAMESPACE_ACADO
00404
00405 #endif // ACADO_TOOLKIT_OCP_HPP