Assembly: Ms;
The IMsUserOptimizationCallback interface is used to determine an algorithm that implements events on custom optimization problem calculation.
IMsUserOptimizationCallback
A custom optimization problem is calculated only by the specified custom algorithm. The algorithm can use various optimization packages, for example, LPSolve.
To set up calculation options of custom optimization problem, use the IMsUserOptimizationProblem interface.
To use a custom algorithm in custom optimization problem calculation, create a unit with event handler:
Public Class <class name>: Object, IMsUserOptimizationCallback
Public Sub OnLoad(Xml: IXMLDOMElement);
Begin
//...
// Implementation of event that occurs after problem loading
//...
End Sub OnLoad;
Public Sub OnSave(Xml: IXMLDOMElement);
Begin
//...
// Implementation of event that occurs after saving criterion function
//...
End Sub OnSave;
Public Sub OnBeforeExecute(Calculation: IMsMethodCalculation; Coord: IMsFormulaTransformCoord; Problem: IMsUserOptimizationProblem);
Begin
//...
// Implementation of event that occurs before problem calculation
//...
End Sub OnBeforeExecute;
Public Sub OnExecute(Runtime: IMsUORuntime);
Begin
//...
// Implementation of event that occurs during problem calculation in each calendar point
//...
End Sub OnExecute;
Public Sub OnAfterExecute(Calculation: IMsMethodCalculation; Coord: IMsFormulaTransformCoord; Problem: IMsUserOptimizationProblem);
Begin
//...
// Implementation of event that occurs after problem calculation
//...
End Sub OnAfterExecute;
Public Sub OnSetupParams(Params: IMsModelParams);
Begin
//...
// Implementation of event that occurs to set up problem parameters in custom interface
//...
End Sub OnSetupParams;
End Class <class name>;
Method name | Brief description | |
OnAfterExecute | The OnAfterExecute method implements the event that occurs after custom optimization problem calculation. | |
OnBeforeExecute | The OnBeforeExecute method implements the event that occurs before custom optimization problem calculation. | |
OnExecute | The OnExecute method implements the event that occurs during custom optimization problem calculation in each calendar point of the forecasting period. | |
OnLoad | The OnLoad method implements the event that occurs after loading a custom optimization problem from XML file. | |
OnSave | The OnSave method implements the event that occurs after saving criterion function. | |
OnSetupParams | The OnSetupParams method displays a custom interface that is used to set up custom optimization problem parameters. |
See also: