IMsProblemCalculationSettings.ScenarioIncluded

Syntax

ScenarioIncluded(Scenario: IMsScenario): Boolean;

Parameters

Scenario. The scenario of modeling problem by which the problem is calculated.

Description

The ScenarioIncluded property determines whether the calculation by scenario of modeling problem is executed. The scenario is passed by the Scenario parameter.

Comments

If ScenarioIncluded = True, the calculation is performed by the specified scenario.

Example

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

Problem: IMsProblem;

CalcSett: IMsProblemCalculationSettings;

Calculation: IMsProblemCalculation;

i: Integer;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemByIdNamespace("PROBLEM_1", MB.ItemById("KONT_MODEL").Key).Edit;

Problem := MObj As IMsProblem;

CalcSett := Problem.CreateCalculationSettings;

For i := 0 To Problem.Scenarios.Count - 1 Do

CalcSett.ScenarioIncluded(Problem.Scenarios.Item(i)) := True;

End For;

Calculation := Problem.Calculate(CalcSett);

Calculation.Run;

MObj.Save;

End Sub Main;

After executing the example the problem with the PROBLEM_1 identifier is calculated. Calculation is executed by all scenarios that are contained in this problem.

See also:

IMsProblemCalculationSettings