IMsCalculationChainEntries.ArrangeModels

Fore Syntax

ArrangeModels(ArrangeMode: MsArrangeMode; [Problem: IMsProblem = Null]);

Fore.NET Syntax

ArrangeModels(ArrangeMode: Prognoz.Platform.Interop.Ms.MsArrangeMode;
              Problem: Prognoz.Platform.Interop.Ms.IMsProblem);

Parameters

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.

Description

The ArrangeModels method automatically creates a chain of model calculation by specified parameters in accordance with variables' interdependencies.

Comments

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:

The value of the ArrangeMode parameter influences to the automatic building in the following way:

NOTE. If the modeling container is a child of time series database, separate use of the SplitSlices value is unavailable.

Fore Example

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.

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;
    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:

IMsCalculationChainEntries