ICallbackCycle.Execute

Fore Syntax

Execute;

Fore.NET Syntax

Execute();

Description

The Execute method calculates controlling variables.

Comments

Use the ICallbackCycle.GetTermValue and ICallbackCycle.SetControlVariableValue methods to get and edit variables values.

Fore Example

To execute the example, add a link to the Cp system assembly.

Class MyCallbackCycle: Object, ICallbackCycle
    Public
        U_Vars, P_Vars: INonLoVariables;
        U, P: array[10Of double;
        Vrbl: INonLoVariable;
    
    Public Function GetTermValue(EquationNumber: Integer; TimeMoment: Integer): Variant;
    Begin
        Return P[EquationNumber];
    End Function GetTermValue;
    
    Public Sub SetControlVariableValue(VariableNumber: Integer; TimeMoment: Integer; Value: Double);
    Begin
        U[VariableNumber] := Value * TimeMoment / 100;
    End Sub SetControlVariableValue;
        
    Public Sub Execute;
    Begin
        P := U;
    End Sub Execute;
End Class MyCallbackCycle;

The use of this class to calculate non-linear optimization is given in description of ICpNonLinearOptimization.CallbackCycle.

Fore.NET Example

Imports Prognoz.Platform.Interop.Cp;

Public Class MyCallbackCycle: Object, ICallbackCycle
    Shared
        U_Vars: INonLoVariables;
        P_Vars: INonLoVariables;
        U: array[10Of double;
        P: array[10Of double;
        Vrbl: INonLoVariable;
    
    Public Function GetTermValue(EquationNumber: Integer; TimeMoment: Integer): object;
    Begin
        Return P[EquationNumber];
    End Function GetTermValue;
    
    Public Sub SetControlVariableValue(VariableNumber: Integer; TimeMoment: Integer; Value: Double);
    Begin
        U[VariableNumber] := Value * TimeMoment / 100;
    End Sub SetControlVariableValue;
        
    Public Sub Execute();
    Begin
        P := U;
    End Sub Execute;
End Class MyCallbackCycle;

The use of this class to calculate non-linear optimization is given in description of ICpNonLinearOptimization.CallbackCycle.

See also:

ICallbackCycle