Diana
0.8.3
|
#include <DianaNLPTask.hpp>
Public Member Functions | |
virtual | ~DianaNLPTask () |
const Common::Collection::ICapeCollection & | GetSoughtParameters () const throw (Common::Error::ECapeUnknown) |
virtual ConstraintFuncArray * | GetConstraintFuncList (ConstraintType _type) throw (Common::Error::ECapeUnknown) |
virtual void | SetNLPParameters (Parameters::ICapeOptimizationPoint *_pars) throw (Common::Error::ECapeUnknown) |
const Parameters::ICapeOptimizationPoint & | GetNLPParameters () throw (Common::Error::ECapeUnknown) |
virtual void | AddConstraintFunc (ICapeNLPFunction *_func, ConstraintType _type) throw (Common::Error::ECapeUnknown) |
virtual Common::Types::CapeArrayDouble | CalcConstraints (ConstraintType _type) throw (Common::Error::ECapeUnknown) |
virtual Common::Types::CapeDouble | CalcConstraint (Common::Types::CapeLong _index, ConstraintType _type) throw (Common::Error::ECapeUnknown) |
virtual Common::Types::CapeShort | GetConstraintsCount (ConstraintType type) const throw (Common::Error::ECapeUnknown) |
virtual void | SetSimulationContext (Common::Identification::ICapeIdentification *simContextManager) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl) |
virtual void | Initialize () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder) |
virtual void | Terminate () throw (Common::Error::ECapeUnknown, Common::Error::ECapeOutOfResources, Common::Error::ECapeBadInvOrder) |
Common::Collection::ICapeCollection * | GetParameters () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl) |
virtual void | SetComponentName (const Common::Types::CapeString &_name) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
virtual void | SetComponentDescription (const Common::Types::CapeString &_description) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
virtual void | UpdateNLPParameters () throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
virtual void | UpdateOptimizationPoint () throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
void | SetReportingInterface (Diana::IDianaReporting *_pReportingInterface) throw (Common::Error::ECapeUnknown) |
void | RemoveReportingInterface (Diana::IDianaReporting *_pReportingInterface) throw (Common::Error::ECapeUnknown) |
Protected Member Functions | |
void | AddSoughtParameter (const Common::Parameter::ICapeParameter *parParameter) |
void | AddParametersSpec (const Common::Parameter::CapeArrayParameterSpec &_parspecs) throw (Common::Error::ECapeInvalidArgument) |
void | notifyEventHandlers (NLPTaskEvents event) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeFailedInitialisation) |
bool | areEventHandlers () |
Protected Attributes | |
Diana::DianaCollection | collParameters |
Collection of task's parameters. | |
ConstraintFuncArray | constrainsGx |
Array of ![]() | |
ConstraintFuncArray | constrainsHx |
Array of ![]() | |
Diana::DianaCollection | soughtParams |
Collection of sought parameters. | |
Parameters::ICapeOptimizationPoint * | fitParams |
Array of fitting parameters values generated by optimizer. | |
Private Attributes | |
std::vector < Diana::IDianaReporting * > | arrReportingInterfaces |
array of the reporting interfaces |
Represents an interface for CapeNLPTask class.
virtual ~DianaNLPTask | ( | ) | [virtual] |
Destructor for DianaNLPTask.
virtual void AddConstraintFunc | ( | ICapeNLPFunction * | _func, |
ConstraintType | _type | ||
) | throw (Common::Error::ECapeUnknown) [virtual] |
Adds constraint function.
Implements ICapeNLPTask.
void AddParametersSpec | ( | const Common::Parameter::CapeArrayParameterSpec & | _parspecs | ) | throw (Common::Error::ECapeInvalidArgument) [protected] |
Add parameters with specified specifications.
_parspecs | list of specifications for parameters |
void AddSoughtParameter | ( | const Common::Parameter::ICapeParameter * | parParameter | ) | [inline, protected] |
Adds parameter to the sought prameters' collection
virtual Common::Types::CapeDouble CalcConstraint | ( | Common::Types::CapeLong | _index, |
ConstraintType | _type | ||
) | throw (Common::Error::ECapeUnknown) [virtual] |
Evaluates constraint functions of the same type for given set of parameters.
_index | index of specified constraint |
_type | type of constraints |
Implements ICapeNLPTask.
virtual Common::Types::CapeArrayDouble CalcConstraints | ( | ConstraintType | _type | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Evaluates constraint functions of the same type for given set of parameters.
_type | type of constraints |
Implements ICapeNLPTask.
virtual ConstraintFuncArray* GetConstraintFuncList | ( | ConstraintType | _type | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Gets list of constrains of the type specified.
Implements ICapeNLPTask.
virtual Common::Types::CapeShort GetConstraintsCount | ( | ConstraintType | type | ) | const throw (Common::Error::ECapeUnknown) [virtual] |
Returns count of constraint functions of the same type.
type | type of constraints |
Implements ICapeNLPTask.
const Parameters::ICapeOptimizationPoint& GetNLPParameters | ( | ) | throw (Common::Error::ECapeUnknown) [inline, virtual] |
Get fitting parameters values.
Implements ICapeNLPTask.
Common::Collection::ICapeCollection* GetParameters | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl) [inline, virtual] |
Returns an ICapeCollection interface. This interface will contain a collection of ICapeParameter interfaces. This method allows any client to access all the Cape Open Parameters exposed by a model component. If the model component does not support exposing its parameters, it should raise the ECapeNoImpl error, instead of returning a NULL reference or an empty Collection. But if the PMC supports parameters but has for this call no parameters, it should return a valid ICapeCollection reference exposing zero parameters.
Implements ICapeUtilities.
Reimplemented in MultipleFittingTask.
const Common::Collection::ICapeCollection& GetSoughtParameters | ( | ) | const throw (Common::Error::ECapeUnknown) [inline, virtual] |
Returns sought parameters set.
Implements ICapeNLPTask.
virtual void Initialize | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder) [inline, 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.
Implements ICapeUtilities.
Reimplemented in SensParameterFittingTask, ParameterFittingTask, BasicDynamicNLPTask, DianaOEDTask, and MultipleFittingTask.
void notifyEventHandlers | ( | NLPTaskEvents | event | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeFailedInitialisation) [protected] |
Notifies all registered reporting interfaces about new step.
virtual void SetComponentDescription | ( | const Common::Types::CapeString & | _description | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
sets the description of the component.
_description | the description of the component |
Implements ICapeIdentification.
Reimplemented in SensParameterFittingTask.
virtual void SetComponentName | ( | const Common::Types::CapeString & | _name | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
sets the name of the component.
_name | the name of the component |
Implements ICapeIdentification.
Reimplemented in SensParameterFittingTask.
virtual void SetNLPParameters | ( | Parameters::ICapeOptimizationPoint * | _pars | ) | throw (Common::Error::ECapeUnknown) [inline, virtual] |
Set new fitting parameters values.
Implements ICapeNLPTask.
Reimplemented in DianaParameterFittingTask.
void SetReportingInterface | ( | Diana::IDianaReporting * | _pReportingInterface | ) | throw (Common::Error::ECapeUnknown) |
Sets the reference to an object in charge of managing some reporting at each step of the process.
Remark
The reporting interface will be called by the Solver:
virtual void SetSimulationContext | ( | Common::Identification::ICapeIdentification * | simContextManager | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl) [inline, virtual] |
Allows the environment to convey the component a reference to the former's simulation context. The simulation context will be environment objects which will expose a given set of Cape Open interfaces. Each of these interfaces will allow the component to call back the environment in order to benefit from its exposed services (such as creation of material templates, diagnostics or measurement unit conversion). If the component does not support accessing the simulation context, it is recommended to raise the ECapeNoImpl error.
simContextManager | the reference to the environment's simulation context class. For the component to use this class, this reference will have to be converted to each of the defined Cape Open Simulation Context interfaces. |
Implements ICapeUtilities.
virtual void Terminate | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeOutOfResources, Common::Error::ECapeBadInvOrder) [inline, virtual] |
The environment will order the component to get destroyed through this method. Any uninitialization that could fail must be placed here. Terminate is guaranteed to be the last method called by the client (except low level methods such as class destructors). Terminate may be called at any time, but may be only called once. When this method returns an error, the environment should report the user. However, after that the environment is not allowed to use the component anymore.
Implements ICapeUtilities.
virtual void UpdateNLPParameters | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
Set Parameters values as default parameters
Implements ICapeNLPTask.
virtual void UpdateOptimizationPoint | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
Update optimization point