IMsLinearDecompositionProblem.Level

Syntax

Level: DimCalendarLevel;

Description

The Level property determines the calendar level that should be used for problem calculation.

Example

Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. A metamodel with the META_MODEL identifier must be present in this container. The calendar of the container must begin before 2003, and come to an end after 2010.

Sub UserProc;
Var
    MB: IMetabase;
    Cont: IMetabaseObjectDescriptor;
    ModelKey: Integer;
    CrInf: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
    Problem: IMsProblem;
    LnDecProblem: MsLinearDecompositionProblem;
    Period: IMsModelPeriod;
Begin
    MB := MetabaseClass.Active;
    Cont := Mb.ItemById("CONT_MODEL").Bind;
    ModelKey := Cont.Key;
    // Create the Problem object
    CrInf := Mb.CreateCreateInfo;
    CrInf.ClassId := MetabaseObjectClass.KE_CLASS_MSPROBLEM;
    CrInf.Id := "New_ForwardLookingProblem";
    CrInf.Name := "New_ForwardLookingProblem";
    CrInf.Parent := Cont;
    CrInf.Permanent := False;
    MObj := Mb.CreateObject(CrInf).Edit;
    Problem := MObj As IMsProblem;
    // Add a metamodel
    Problem.MetaModel := MB.ItemByIdNamespace("META_MODEL", ModelKey).Bind As IMsMetaModel;
    // Determine a problem type - Forward-looking forecasting
    LnDecProblem := New MsLinearDecompositionProblem.Create;
    Problem.Details := LnDecProblem;
    // Determine a calendar level, by which problem will be calculated
    LnDecProblem.Level := DimCalendarLevel.Month;
    // Determine parameters of periods, on which problem will be calculated
    Period := LnDecProblem.Period;
    Period.IdentificationStartDate := DateTime.ComposeDay(200311);
    Period.IdentificationEndDate := DateTime.ComposeDay(20071231);
    Period.ForecastStartDate := DateTime.ComposeDay(200811);
    Period.ForecastEndDate := DateTime.ComposeDay(20101231);
    MObj.Save;
End Sub UserProc;

After executing the example, a new problem of the Forward-Looking Forecasting type with the New_ForwardLookingProblem identifier is created in the modeling container. The metamodel is added to the problem, the level of a calendar and parameters of the periods necessary for calculation of a problem are determined.

See also:

IMsLinearDecompositionProblem