ArrangeModels(ArrangeMode: MsArrangeMode; [Problem: IMsProblem = Null]);
ArrangeModels(ArrangeMode: Prognoz.Platform.Interop.Ms.MsArrangeMode;
Problem: Prognoz.Platform.Interop.Ms.IMsProblem);
ArrangeMode. Mode of auto building of the calculation chain.
Problem. The task, by which the calculation periods of created equation system will be set. The parameter is relevant if ArrangeMode=MsArrangeMode.CreateSystems.
The ArrangeModels method automatically creates a chain of model calculation by specified parameters in accordance with variables' interdependencies.
Automatic creation allows to find dependencies between models and to create calculation chain in accordance with these dependencies. Automatic creation ignores metamodels included into calculation chain.
Principles of automatic chain creation:
Explained model variables represent a set of Y.
The number of time series of all models includes:
Variables of the set Y.
Variables of the set Y having lags represent a set of Y1.
Variables that have no equations represent a set of X.
The chain includes first X, Y1, and then Y2. Y2 models depend only on X and on Y1.
Then the set of Y3 is created, containing models that can be computed based on X, Y1, Y2. The resulting set will be included into the chain, and so on.
If the chain includes models containing variables that depend on themselves, these model are placed to the Cycles folder.
The value of the ArrangeMode parameter influences to the automatic building in the following way:
ArrangeMode contains the values InsideFolders. Autoconstruction is executed separately for each folder entering into a chain.
ArrangeMode contains the value DeleteFolders. All models from all child folders are taken on a level for which autoconstruction is executed, and folders are deleted. Thus the chain is automatically created ignoring folders.
ArrangeMode contains the value SplitSlices. If the chain of calculation includes a multivariate model containing internal cycles, or if even one of its equations forms a cycle with other model included into the chain, the multidimensional model is divided into models that correspond to the dimensions for which the calculation method is determined. The equations that do not form cycles are placed into another multidimensional model. If the cycles are resolved by changing the order of equations in multidimensional model, a copy model is created with required order. All the created models are arranged in the order of dependency. The models that form cycles are placed to the Cycle N folder, where N is a cycle ordinal number. Original multidimensional models will not be changed; the created models will be named in accordance with names of source multidimensional model and saved to the folder next to this model. Folder name is generated in the following way: <Source model name>(<date and time of folder creation>).
ArrangeMode does not contain the value SplitSlices. Multidimensional models containing internal cycles are placed without changes to the Cycles folder.
NOTE. If the modeling container is a child of time series database, separate use of the SplitSlices value is unavailable.
ArrangeMode contains the CreateSystems value. If the calculation chain contains linear and non-linear regression equations, determinate equation creating cycle, they are combined in the equation system. Calculation periods of the system are taken from the modeling problem specified in the Problem parameter.
ArrangeMode contains the SplitSlices value. If the calculation chain contains cycles, the models that form a cycle are retrieved from the folders corresponding to the cycles to the calculation chain instead of the folders.
Executing the example requires a modeling container with the CONT_MODEL identifier, containing a metamodel with the META_ARRANGE identifier. Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
mb: IMetabase;
ContKey: Integer;
MetaModel: IMsMetaModel;
Chain: IMsCalculationChainEntries;
Begin
mb := MetabaseClass.Active;
ContKey := mb.GetObjectKeyById("CONT_MODEL");
MetaModel := mb.ItemByIdNamespace("META_ARRANGE", ContKey).Edit As IMsMetaModel;
Chain := MetaModel.CalculationChain;
Chain.ArrangeModels(MsArrangeMode.DeleteFolders Or MsArrangeMode.SplitSlices);
(MetaModel As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the elements in calculation chain is built without taking into account folders, multivariate models with cycles are divided into parts.
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;
ContKey: uinteger;
MetaModel: IMsMetaModel;
Chain: IMsCalculationChainEntries;
Begin
mb := Params.Metabase;
ContKey := mb.GetObjectKeyById("CONT_MODEL");
MetaModel := mb.ItemByIdNamespace["META_ARRANGE", ContKey].Edit() As IMsMetaModel;
Chain := MetaModel.CalculationChain;
Chain.ArrangeModels(MsArrangeMode.mamDeleteFolders Or MsArrangeMode.mamSplitSlices, Null);
(MetaModel As IMetabaseObject).Save();
End Sub;
See also: