IMsProblemCalculationSettings.Details

Fore Syntax

Details: Object;

Fore.NET Syntax

Details: object;

Description

The Details property determines type of calculated criterion problem.

Comments

If the Details property contains object of the type:

Fore Example

Executing the example requires that the repository contains a modeling container with the MS identifier containing a criterion function with the TARGET_PROBLEM identifier.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    MsKey: Integer;
    Problem: IMsProblem;
    CalcSettings: IMsProblemCalculationSettings;
    Calculation: IMsProblemCalculation;
    TargetProblem: IMsTargetProblem;
Begin
    mb := MetabaseClass.Active;
    // Get modelling container key
    MsKey := mb.GetObjectKeyById("MS");
    // Get criterion problem
    Problem := mb.ItemByIdNamespace("TARGET_PROBLEM", MsKey).Bind As IMsProblem;
    // Create problem calculation parameters
    CalcSettings := Problem.CreateCalculationSettings;
    // Get criterion problem parameters
    TargetProblem := Problem.AdditionalDetails.Item(0As IMsTargetProblem;
    // Determine type of calculated problem
    CalcSettings.Details := TargetProblem;
    // Calculate problem
    Calculation := Problem.Calculate(CalcSettings);
    Calculation.Run;
End Sub UserProc;

After executing the example optimal control problem is calculated.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    MsKey: uinteger;
    Problem: IMsProblem;
    CalcSettings: IMsProblemCalculationSettings;
    Calculation: IMsProblemCalculation;
    TargetProblem: IMsTargetProblem;
Begin
    mb := Params.Metabase;
    // Get modelling container key
    MsKey := mb.GetObjectKeyById("MS");
    // Get criterion problem
    Problem := mb.ItemByIdNamespace["TARGET_PROBLEM", MsKey].Bind() As IMsProblem;
    // Create problem calculation parameters
    CalcSettings := Problem.CreateCalculationSettings();
    // Get criterion problem parameters
    TargetProblem := Problem.AdditionalDetails.Item[0As IMsTargetProblem;
    // Determine type of calculated problem
    CalcSettings.Details := TargetProblem;
    // Calculate problem
    Calculation := Problem.Calculate(CalcSettings);
    Calculation.Run();
End Sub;

See also:

IMsProblemCalculationSettings