All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

OptimizationInterfaces Interface CATIOptAlgorithm

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---ObjectModelerSystem.CATInterfaceEvents
        |
        +---CATIOptAlgorithm
 

Usage: you can reimplement this interface by deriving the supplied CATOptAlgorithmAdapter adapter class.


interface CATIOptAlgorithm

This interface describes the basic behaviour of an optimization algorithm.
An algorithm must expose a way to edit itself (method CreateEditionFrame).

BOA information: this interface CANNOT be implemented using the BOA (Basic Object Adapter). To know more about the BOA, refer to the CAA Encyclopedia home page. Click Middleware at the bottom left, then click the Object Modeler tab page. Several articles deal with the BOA.


Method Index


o AllHistoricToString()
Returns a string describing the history of the optimization algorithm.
o CheckCompatibility(CATIOptOptimization_var&)
This method checks if the global optimization definition is compatible with the current algorithm.
o GetBestResultIndex(int&)
Returns the index of the Opimization Log corresponding to the best solution found according to the problem defined.
o GetEndIterationNotification()
This event is triggered every time you want during the algorithm run.
o GetSetting(char*,double&)
Gets an algorithm setting.
o OneHistoricToString(int)
Returns a string describing the history of the optimization algorithm.
o Run(CATIOptOptimization_var&)
This method launches a run of optimization, with respect to the algorihtm settings, problems, and goals defined in the feature optimization.
o SetSetting(char*,double)
Sets an algorithm setting.

Methods


o AllHistoricToString
public virtual CATUnicodeString AllHistoricToString()= 0
Returns a string describing the history of the optimization algorithm.
Returns:
The string containing the evolution of the free parameters, objective and constraints. Contains additional information with respect to the design table output of the optimization.
o CheckCompatibility
public virtual HRESULT CheckCompatibility(CATIOptOptimization_var& iOptim) = 0
This method checks if the global optimization definition is compatible with the current algorithm. For example, your algorithm may not be able to run if the optimization has only constraints and no parameter to optimize so that the optimization won't be compatible with the current algorithm. In implementation, you may call the method SendOptimizationError() on the CATIOptOptimization given in argument, in order to send the error(s) explanation(s) to the interactiv dialog. If you do that, a popup will be displayed at the end of the check so that the user will know why there is a compatibility problem (to give a complete list of compatibility problems, check everything, call the SendOptimizationError() each time there is a problem and return E_FAIL at the end of the whole check). WARNING : the OptimizerUI will prevent the algorithm from running if at least one error is sent OR if this method returns E_FAIL. Since all the sent errors will be displayed to the user in interactiv mode, you should distinguish the internal errors (like NULL pointers) from user errors (like no free parameter selected).
Parameters:
iOptim
The optimization you want to check compatibility with.
Returns:
S_OK if the algorithm is compatible with the optimization, E_FAIL else.
o GetBestResultIndex
public virtual HRESULT GetBestResultIndex(int& oBestResultIndex) const = 0
Returns the index of the Opimization Log corresponding to the best solution found according to the problem defined.
Parameters:
oBestResultIndex
The index of the best point found by the optimizer.
Returns:
S_OK if the best is found. E_FAIL if it was not found. E_NOTIMPLEMENTED for algorithms (such as DOEs) for which this notion is meaningless.
o GetEndIterationNotification
public virtual CATCallbackEvent GetEndIterationNotification()const = 0
This event is triggered every time you want during the algorithm run. It may correspond to a model update and/or an end of iteration. It is used for example by the stop dialog to update its display.
o GetSetting
public virtual HRESULT GetSetting( const char* iAttrName,
double& oContent) = 0
Gets an algorithm setting. The setting is defined by its attribute name. The value of the setting is returned in a double but can be an integer.
Returns:
S_OK if the operation succeeded, E_FAIL else (non existing attribute).
o OneHistoricToString
public virtual CATUnicodeString OneHistoricToString(int iHistoricIndex) = 0
Returns a string describing the history of the optimization algorithm.
Parameters:
iHistoricIndex
The index of the historic to be dumped (1 to Number of constraints + objective value + best objective)
Returns:
The string containing the evolution of the free parameters, objective and constraints. Contains additional information with respect to the design table output of the optimization.
o Run
public virtual HRESULT Run(CATIOptOptimization_var& iOptim) = 0
This method launches a run of optimization, with respect to the algorihtm settings, problems, and goals defined in the feature optimization. In implementation, you may call the method SendOptimizationError() on the CATIOptOptimization given in argument, in order to send the error(s) explanation(s) to the interactiv dialog. If you do that, a popup will be displayed at the end of the run so that the user will know what happened during the run. Notice that if you are integrating your algorithm in the OptimizerUI, the CheckCompatibility() method will be called so that it may prevent the algorithm to run.
Parameters:
optim
the optimization to run.
Returns:
S_OK if the operation succeeded, E_FAIL else
o SetSetting
public virtual HRESULT SetSetting( const char* iAttrName,
double iContent) = 0
Sets an algorithm setting. This setting is defined by its attribute name. The value of the setting is given as a double (but can be an integer).
Returns:
S_OK if the operation succeeded, E_FAIL else (non existing attribute).

This object is included in the file: CATIOptAlgorithm.h
If needed, your Imakefile.mk should include the module: OptimizationItf

Copyright © 2003, Dassault Systèmes. All rights reserved.