ScenarioIncluded(Scenario: IMsScenario): Boolean;
Scenario. The scenario of modeling problem by which the problem is calculated.
The ScenarioIncluded property determines whether the calculation by scenario of modeling problem is executed. The scenario is passed by the Scenario parameter.
If ScenarioIncluded = True, the calculation is performed by the specified scenario.
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: