AdvancedOptions: MsProblemCalculationOptions;
The AdvancedOptions property determines additional parameters of problem calculation.
This property can be used to reduce calculation time of modeling problem.
If AdvancedOptions contains the value:
MsProblemCalculationOptions.SkipOutputDataLoad. It may cause incorrect calculation of the problems, which output variables have already have data: the points, by which NAN values are loaded, are not written to database.
MsProblemCalculationOptions.CacheCoords. Incorrect calculation of aggregation and some models on variables with slices.
Executing the example requires that the repository contains a modeling container with the MS identifier containing a modeling problem with the PROBLEM_ADV identifier.
Add links to the Metabase and Ms system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
ModelSpaceD: IMetabaseObjectDescriptor;
Problem: IMsProblem;
CalcSett: IMsProblemCalculationSettings;
Begin
Mb := MetabaseClass.Active;
// Get modeling container
ModelSpaceD := Mb.ItemById("MS");
// Get modeling problem
Problem := Mb.ItemByIdNamespace("PROBLEM_ADV", ModelSpaceD.Key).Bind As IMsProblem;
// Get problem calculation parameters
CalcSett := Problem.CreateCalculationSettings;
// Include the Fact scenario to calculation
CalcSett.FactIncluded := True;
// Set problem calculation periods
CalcSett.Period.IdentificationStartDate := DateTime.ComposeDay(2000, 1, 1);
CalcSett.Period.IdentificationEndDate := DateTime.ComposeDay(2004, 12, 31);
CalcSett.Period.ForecastStartDate := DateTime.ComposeDay(2005, 1, 1);
CalcSett.Period.ForecastEndDate := DateTime.ComposeDay(2007, 12, 31);
// Set additional calculation parameters
CalcSett.AdvancedOptions := MsProblemCalculationOptions.SkipOutputDataLoad Or MsProblemCalculationOptions.CacheCoords;
// Perform calculation
Problem.Calculate(CalcSett).Run;
End Sub UserProc;
After executing the example a modeling problem is calculated without loading data by output variables and with caching of data dimensions coordinates.
See also: