Diana
0.8.3
|
#include <DianaDynamicNLPTask.hpp>
Public Member Functions | |
BasicDynamicNLPTask (Numeric::Solvers::Solver::ICapeNumericSolver *_solver, Numeric::Solvers::Model::ICapeNumericContinuousModel *_model) | |
BasicDynamicNLPTask (Diana::IDianaMain *_dianaMain, Common::Types::CapeString _solverName, Numeric::Solvers::Model::ICapeNumericContinuousModel *_model) | |
virtual | ~BasicDynamicNLPTask () |
virtual void | AddEstimatedParameter (const Common::Parameter::ICapeParameterSpec *pSpecValue, eEstimatedParameterType eptTypeOfUnknown=DIANA_PARAMETER) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
virtual void | AddEstimatedParameter (const Common::Types::CapeString strName, eEstimatedParameterType eptTypeOfUnknown=DIANA_PARAMETER) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
virtual void | AddEstimatedParameter (const Common::Types::CapeLong nIndex, eEstimatedParameterType eptTypeOfUnknown=DIANA_PARAMETER) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
virtual Common::Types::CapeDouble | CalcObjFunction () throw (Common::Error::ECapeUnknown, Common::Error::ECapeSolvingError) |
virtual void | Initialize () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder) |
virtual Common::Types::CapeArrayDouble | GetObjFunctionGradient () throw (Common::Error::ECapeUnknown) |
Common::Types::CapeLong | GetModelParametersCount () const |
Common::Types::CapeLong | GetModelStateVarsCount () const |
Common::Types::CapeLong | GetFreeParametersCount () const |
Protected Member Functions | |
virtual Common::Types::CapeDouble | EvaluateObjFunction () throw (Common::Error::ECapeUnknown, Common::Error::ECapeSolvingError) |
void | Init (Diana::IDianaMain *_dianaMain, Common::Types::CapeString _solverName, Numeric::Solvers::Model::ICapeNumericContinuousModel *_model) |
void | Init (Numeric::Solvers::Solver::ICapeNumericSolver *_solver, Numeric::Solvers::Model::ICapeNumericContinuousModel *_model) |
virtual void | ExtractParams (const Numeric::Solvers::NLPTasks::Parameters::ICapeOptimizationPoint &_parVals) throw (Common::Error::ECapeUnknown) |
Protected Attributes | |
Common::Parameter::CapeArrayParameter | arrEstimatedInitStates |
Array with estimated state variables. | |
Common::Parameter::CapeArrayParameter | arrEstimatedParameters |
Array with estimated model's parameters. | |
Common::Parameter::CapeArrayParameter | arrEstimatedFreeParams |
Array with estimated unknowns. | |
Common::Types::CapeBoolean | bInitialized |
Flag, indicates that optimizer is initialised. |
Class for dynamic optimization tasks with objactive function written on Python.
BasicDynamicNLPTask | ( | Numeric::Solvers::Solver::ICapeNumericSolver * | _solver, |
Numeric::Solvers::Model::ICapeNumericContinuousModel * | _model | ||
) |
Constructor of BasicDynamicNLPTask class.
_soughtParams | - sought parameters collection with names, bounds and precision of estimated model's parameters. |
BasicDynamicNLPTask | ( | Diana::IDianaMain * | _dianaMain, |
Common::Types::CapeString | _solverName, | ||
Numeric::Solvers::Model::ICapeNumericContinuousModel * | _model | ||
) |
Constructor of BasicDynamicNLPTask class.
_dianaMain | - pointer to DianaMain which is used to create solver |
_solverName | - name of the solver used for integrating |
_model | - considered model |
_soughtParams | - sought parameters collection with names, bounds and precision of estimated model's parameters. |
virtual ~BasicDynamicNLPTask | ( | ) | [virtual] |
Destructor of BasicDynamicNLPTask class.
virtual void AddEstimatedParameter | ( | const Common::Parameter::ICapeParameterSpec * | pSpecValue, |
eEstimatedParameterType | eptTypeOfUnknown = DIANA_PARAMETER |
||
) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
Adds unknown to the list of sought parameters.
pSpecValue | name of added parameter |
eptTypeOfUnknown | type of added parameter (default value DIANA_PARAMETER) |
virtual void AddEstimatedParameter | ( | const Common::Types::CapeString | strName, |
eEstimatedParameterType | eptTypeOfUnknown = DIANA_PARAMETER |
||
) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
Adds unknown to the list of sought parameters.
strName | name of added parameter |
eptTypeOfUnknown | type of added parameter (default value DIANA_PARAMETER) |
virtual void AddEstimatedParameter | ( | const Common::Types::CapeLong | nIndex, |
eEstimatedParameterType | eptTypeOfUnknown = DIANA_PARAMETER |
||
) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
Adds unknown to the list of sought parameters.
nIndex | index of added parameter |
eptTypeOfUnknown | type of added parameter (default value DIANA_PARAMETER) |
virtual Common::Types::CapeDouble CalcObjFunction | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeSolvingError) [virtual] |
Calculates and returns objective function value for optimization task.
Reimplemented from BasicNLPTask.
virtual Common::Types::CapeDouble EvaluateObjFunction | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeSolvingError) [protected, virtual] |
Calculates and returns objective function value for optimization task.
Reimplemented from BasicNLPTask.
virtual void ExtractParams | ( | const Numeric::Solvers::NLPTasks::Parameters::ICapeOptimizationPoint & | _parVals | ) | throw (Common::Error::ECapeUnknown) [protected, virtual] |
Extracts parameters from set of parameters for setting intial values of state variables and estimated parameters.
_parVals | set of parameters for task |
Reimplemented from DianaDynamicNLPTask.
Returns count of optimizad free parameters.
Returns count of optimizad model's parameters.
Returns count of optimizad model's state variables.
virtual Common::Types::CapeArrayDouble GetObjFunctionGradient | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Calculates and returns gradient with respect to objective function value for optimization task.
Reimplemented from BasicNLPTask.
void Init | ( | Diana::IDianaMain * | _dianaMain, |
Common::Types::CapeString | _solverName, | ||
Numeric::Solvers::Model::ICapeNumericContinuousModel * | _model | ||
) | [protected] |
Initialize task's class.
_dianaMain | - pointer to DianaMain which is used to create solver |
_solverName | - name of the solver used for integrating |
_model | - considered model |
void Init | ( | Numeric::Solvers::Solver::ICapeNumericSolver * | _solver, |
Numeric::Solvers::Model::ICapeNumericContinuousModel * | _model | ||
) | [protected] |
Initialize task's class.
virtual void Initialize | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder) [virtual] |
The environment will order the component to get initialized through this method. Any initialisation that could fail must be placed here. Initialize is guaranteed to be the first method called by the client (except low level methods such as class constructors or initialization persistence methods). Initialize has to be called once when the component is instantiated in a particular flowsheet. When the initialization fails, before signalling an error, the component must free all the resources that were allocated before the failure occurred. When the environment receives this error, it may not use the component anymore. The method terminate of the current interface must not either be called. Hence, the environment may only release the component through the middleware native mechanisms.
Reimplemented from DianaNLPTask.