Beispiel #1
0
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Extension_Name, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT, minCount = 1, maxCount = 1,
         substitutes = new List <string>()
         {
             Extension_Id
         }
     });
     fun.par.Add(Extension_Id, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Extension_Name
         }
     });
     fun.par.Add(Extension_Switch, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT, minCount = 1, maxCount = 1
     });
     fun.par.Add(Dataset, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT, minCount = 0, maxCount = DefinitionAdmin.MANY
     });
     fun.par.Add(System, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT, minCount = 0, maxCount = DefinitionAdmin.MANY
     });
 }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(PostFix, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 1, maxCount = 1,
         substitutes = new List <string>()
         {
             PostLoop
         }
     });
     fun.par.Add(PostLoop, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             PostFix
         }
     });
     fun.par.Add(Iteration, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.NUMBER,
         minCount  = 0, maxCount = 1
     });
 }
            public const string Allow_Duplicates  = "Allow_Duplicates"; // EM3-executable always allows duplicates (i.e. this is just for EM2)

            internal static void Add(DefinitionAdmin.Fun fun)
            {
                fun.par.Add(Pol_Name, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT, minCount = 1, maxCount = 1
                });
                fun.par.Add(Insert_After_Pol, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 1, maxCount = 1,
                    substitutes = new List <string>()
                    {
                        Insert_Before_Pol
                    }
                });
                fun.par.Add(Insert_Before_Pol, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
                    substitutes = new List <string>()
                    {
                        Insert_After_Pol
                    }
                });
                fun.par.Add(Allow_Duplicates, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.BOOLEAN, minCount = 0, maxCount = 1, defaultValue = false
                });
            }
Beispiel #4
0
            public const string EM2_Var_Name = "Var_Name";                        // very old EM2-notation

            internal static void Add(DefinitionAdmin.Fun fun)
            {
                fun.par.Add(Var_SystemYear, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 0, maxCount = 1
                });
                fun.par.Add(Var_Dataset, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 0, maxCount = 1
                });
                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = THE_ONLY_GROUP,
                    minCount  = 0, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(Var_Monetary, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.BOOLEAN,
                    minCount  = 0, maxCount = 1, defaultValue = true
                });
                fun.parGroups.Last().par.Add(PAR_TYPE.PLACEHOLDER.ToString(), new DefinitionAdmin.Par()
                {
                    valueType       = PAR_TYPE.FORMULA,
                    placeholderType = PAR_TYPE.TEXT,
                    minCount        = 0, maxCount = 1, defaultValue = "0"
                });
            }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Formula, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.FORMULA,
         minCount    = 1, maxCount = 1,
         description = "Formula for calculating the function's result." + Environment.NewLine + Environment.NewLine
                       + "Allowed operations:" + Environment.NewLine
                       + " - addition: operator +" + Environment.NewLine
                       + " - subtraction: operator -" + Environment.NewLine
                       + "- multiplication: operator *" + Environment.NewLine
                       + "- division: operator /" + Environment.NewLine
                       + "- raising to a power: operator ^, e.g. 2 ^ 3 (result: 8)" + Environment.NewLine
                       + "- percentage: operator %, e.g. yem*3% (result: yem*(3/100))" + Environment.NewLine
                       + "- reminder of division:  operator \\, e.g. 22\\5 (result: 2)" + Environment.NewLine
                       + "- minimum and maximum: operators <min> and <max>, e.g. 10<min>15 (result: 10)" + Environment.NewLine
                       + "- absolute value: operator <abs>(), e.g. <abs>(50-70) (result: 20)" + Environment.NewLine
                       + "- negation: operator !(), e.g. !(IsMarried), !(17) (result: 0), !(0) (result: 1)" + Environment.NewLine + Environment.NewLine
                       + "Allowed operands:" + Environment.NewLine
                       + "- numeric values, e.g. 10, 0.3, -25" + Environment.NewLine
                       + "- numeric values with a period, e.g. 12000#m, 1000#y" + Environment.NewLine
                       + "- amount#i as place holders for numeric values specified by footnote parameters" + Environment.NewLine
                       + "- variables, e.g. yem" + Environment.NewLine
                       + "- incomelists, e.g. ils_dispy" + Environment.NewLine
                       + "- queries, e.g. IsUnemployed" + Environment.NewLine
                       + "- random numbers: rand, e.g. rand * 100 (result: random number between 0 and 100, see function RandSeed for more information)" + Environment.NewLine + Environment.NewLine
                       + "Order of operation rules:" + Environment.NewLine
                       + "- ^, <min>, <max>, <abs>(), !(), %" + Environment.NewLine
                       + "- before multiplicative operations */ \\" + Environment.NewLine
                       + "- before additive operations +-" + Environment.NewLine + Environment.NewLine
                       + "Parentheses can be used to group operations, e.g. (2+3)*4."
     });
 }
 public static void AddAllPar(DefinitionAdmin.Fun fun)
 {
     fun.par.AddRange(GetAgePar());
     fun.par.AddRange(GetNMPar(optional: true));
     fun.par.AddRange(GetIncomePar(optional: true));
     fun.par.AddRange(GetHasMinMaxPar(optional: true));
     fun.par.AddRange(GetDBNamePar(optional: true));
 }
Beispiel #7
0
 internal static void AddRunCond(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Run_Cond, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CONDITION, isCommon = true,
         minCount    = 0, maxCount = 1,
         description = "Function is only carried out if the condition is fulfilled. The parameter is intended to be a conditional switch. Thus the condition must not be individual or household based, but refer to a specific processing state or other global condition."
     });
 }
Beispiel #8
0
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(PostFix, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 1, maxCount = 1,
         substitutes = new List <string>()
         {
             PostLoop
         }
     });
     fun.par.Add(PostLoop, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             PostFix
         }
     });
     fun.par.Add(Var, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.VAR,
         minCount  = 0, maxCount = DefinitionAdmin.MANY
     });
     fun.par.Add(IL, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.IL,
         minCount  = 0, maxCount = DefinitionAdmin.MANY
     });
     //fun.par.Add(LoopFromTo, new DefinitionAdmin.Par()
     //{
     //    valueType = PAR_TYPE.TEXT,
     //    minCount = 0, maxCount = DefinitionAdmin.MANY
     //});
     fun.par.Add(Level, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TU,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Var_Level, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TU,
         minCount  = 0, maxCount = DefinitionAdmin.MANY
     });
     fun.par.Add(IL_Level, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TU,
         minCount  = 0, maxCount = DefinitionAdmin.MANY
     });
 }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Keep_Cond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 1, maxCount = 1
     });
     fun.par.Add(Keep_Cond_Who, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 0, maxCount = 1, defaultValue = Value.WHO_ONE,
         categValues = GetWhoMustBeEligValues()
     });
 }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Operator_IL, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.IL,
         minCount    = 1, maxCount = 1,
         substitutes = new List <string>()
         {
             Operand
         }
     });
     fun.par.Add(Operand, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.FORMULA,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Operand_IL
         }
     });
     fun.par.Add(Operand_Factors, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.BOOLEAN,
         minCount  = 0, maxCount = 1, defaultValue = false
     });
     fun.par.Add(Operand_IL, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.IL,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Operation, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 0, maxCount = 1, defaultValue = Value.ILVAROP_MUL,
         categValues = new List <string>()
         {
             Value.ILVAROP_MUL, Value.ILVAROP_ADD, Value.ILVAROP_NEGTOZERO
         }
     });
     fun.par.Add(Sel_Var, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 0, maxCount = 1, defaultValue = Value.ILVAROP_ALL,
         categValues = new List <string>()
         {
             Value.ILVAROP_ALL, Value.ILVAROP_MIN, Value.ILVAROP_MAX, Value.ILVAROP_MINPOS
         }
     });
 }
            public static void Add(DefinitionAdmin.Fun fun, bool addAmount = true)
            {
                fun.par.Add(LowLim, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA, isFootnote = true, isCommon = true,
                    minCount    = 0, maxCount = 1, defaultValue = DefinitionAdmin.NEG_INFINITE,
                    description = "Footnote parameter for the further specification of an operand: replaces operand if operand is smaller."
                });
                fun.par.Add(UpLim, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA, isFootnote = true, isCommon = true,
                    minCount    = 0, maxCount = 1, defaultValue = DefinitionAdmin.POS_INFINITE,
                    description = "Footnote parameter for the further specification of an operand: replaces operand if operand is higher."
                });
                fun.par.Add(LimPriority, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.CATEG, isFootnote = true, isCommon = true,
                    minCount    = 0, maxCount = 1, defaultValue = Value.NA,
                    categValues = new List <string>()
                    {
                        Value.LIMPRI_LOWER, Value.LIMPRI_UPPER, Value.NA
                    },
                    description = "1-Footnote parameter for the further specification of an operand:" + Environment.NewLine
                                  + "Possible values:" + Environment.NewLine
                                  + "If upper limit (#_UpLim) is smaller than lower limit (#_LowLim) ..." + Environment.NewLine
                                  + "- upper: ... upper limit dominates;" + Environment.NewLine
                                  + "- lower: ... lower limit dominates;" + Environment.NewLine
                                  + "- not defined: ... a warning is issued."
                });
                fun.par.Add(Level, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TU, isFootnote = true, isCommon = true,
                    minCount    = 0, maxCount = 1,
                    description = "Footnote parameter for the further specification of an operand: indicates an alternative assessment unit for an operand."
                });

                if (addAmount)
                {
                    fun.par.Add(Amount, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.TEXT, // PAR_TYPE.NUMBER would not allow for (legal) usage of constants
                        isFootnote  = true, isCommon = true,
                        minCount    = 0, maxCount = 1,
                        description = "Footnote parameter for the further specification of an operand: indicates the numeric value of an operand."
                    });
                }
            }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.parGroups.Add(new DefinitionAdmin.ParGroup()
     {
         groupName = Switch_X, minCount = 1, maxCount = DefinitionAdmin.MANY
     });
     fun.parGroups.Last().par.Add(PolFun, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT, minCount = 1, maxCount = 1,
         description = "The name or identifier of the policy respectively the identifier or symbolic-identifier (add-ons) of the function."
     });
     fun.parGroups.Last().par.Add(Switch_NewVal, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT, minCount = 1, maxCount = 1,
         description = "New switch of the policy/function."
     });
 }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Name, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Update_All
         }
     });
     fun.par.Add(Update_All, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.BOOLEAN,
         minCount    = 0, maxCount = 1, defaultValue = false,
         substitutes = new List <string>()
         {
             Name
         }
     });
 }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.parGroups.Add(new DefinitionAdmin.ParGroup()
     {
         groupName = Param_X, minCount = 1, maxCount = DefinitionAdmin.MANY
     });
     fun.parGroups.Last().par.Add(Param_Id, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT, minCount = 1, maxCount = 1
     });
     fun.parGroups.Last().par.Add(Param_NewVal, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT, minCount = 1, maxCount = 1
     });
     fun.par.Add(Dataset, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = DefinitionAdmin.MANY,
         description = "If any 'Dataset' parameter is used (several can be used within one group), the change only takes place if one of them matches the dataset of the concerned run." + Environment.NewLine +
                       "The wildcards * and ? can be used, where * stands for any character and ? stands for one arbitrary character (e.g.be_20 * _a ?)."
     });
 }
Beispiel #15
0
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Id_Func, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT, minCount = 1, maxCount = 1
     });
     fun.par.Add(Insert_After_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT, minCount = 1, maxCount = 1,
         substitutes = new List <string>()
         {
             Insert_Before_Func
         }
     });
     fun.par.Add(Insert_Before_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Insert_After_Func
         }
     });
 }
            internal static void Add(DefinitionAdmin.Fun fun)
            {
                fun.par.Add(Name, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 1, maxCount = 1
                });
                fun.par.Add(Warn_If_NonMonetary, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.BOOLEAN,
                    minCount  = 0, maxCount = 1, defaultValue = true
                });
                // see FunDefIL for description on how this is checked
                fun.par.Add(PAR_TYPE.PLACEHOLDER.ToString(), new DefinitionAdmin.Par()
                {
                    valueType       = PAR_TYPE.TEXT, // actually + / - / +0.5 / etc., i.e. requires specific check by FunDefIL
                    placeholderType = PAR_TYPE.VARorIL,
                    minCount        = 0, maxCount = DefinitionAdmin.MANY
                });

                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = GROUP_REGEXP,
                    minCount  = 0, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(RegExp_Def, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 1, maxCount = 1
                });
                fun.parGroups.Last().par.Add(RegExp_Factor, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 0, maxCount = 1
                });
            }
Beispiel #17
0
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Elig_Cond, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CONDITION,
         maxCount    = 1, minCount = 1,
         description = "A combination of conditions: output variable is set to 1 if they are fulfilled, else to 0." + Environment.NewLine + Environment.NewLine
                       + "The comibation consists of:" + Environment.NewLine
                       + "- conditions which must be fulfilled, e.g. {dag<19}," + Environment.NewLine
                       + "- conditions which must not be fulfilled, e.g. !{IsMarried}," + Environment.NewLine
                       + "- combined by the logical operators & (and) and | (or), e.g. {dag<19} & !{IsMarried}," + Environment.NewLine
                       + "- (possibly) grouped by parentheses, e.g. {dag<15} | ({dag<19} & !{IsMarried})." + Environment.NewLine + Environment.NewLine
                       + "A single condition has" + Environment.NewLine
                       + "- either 1 component, usually a yes-no-query, e.g. {IsUnemployed}" + Environment.NewLine
                       + "- or 2 components separated by a comparison operator >,<,>=,<=,=,!=, e.g. {poa=0}." + Environment.NewLine + Environment.NewLine
                       + "The operands left and right from the comparison operator are:" + Environment.NewLine
                       + "- numeric values, e.g. 10, 0.3, (-25), note that negative values must be bracketed" + Environment.NewLine
                       + "- numeric values with a period, e.g. 12000#m, 1000#y" + Environment.NewLine
                       + "- amount#i as place holders for numeric values specified by footnote parameters" + Environment.NewLine
                       + "- variables, e.g. yem" + Environment.NewLine
                       + "- incomelists, e.g. ils_dispy" + Environment.NewLine
                       + "- queries, e.g. IsUnemployed"
     });
 }
            internal static void Add(DefinitionAdmin.Fun fun)
            {
                fun.par.Add(Dataset, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 1, maxCount = DefinitionAdmin.MANY
                });
                fun.par.Add(DBYearVar, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.VAR,
                    minCount  = 0, maxCount = 1
                });
                fun.par.Add(Def_Factor, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 0, maxCount = 1, defaultValue = 1.0
                });
                fun.par.Add(WarnIfNoFactor, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.BOOLEAN,
                    minCount  = 0, maxCount = 1, defaultValue = true
                });
                fun.par.Add(WarnIfNonMonetary, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.BOOLEAN,
                    minCount  = 0, maxCount = 1, defaultValue = true
                });

                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = GROUP_MAIN,
                    minCount  = 0, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(Factor_Condition, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.CONDITION,
                    minCount  = 0, maxCount = 1
                });
                fun.parGroups.Last().par.Add(PAR_TYPE.PLACEHOLDER.ToString(), new DefinitionAdmin.Par()
                {
                    valueType       = PAR_TYPE.TEXT, // factor can be name of factor or a number
                    placeholderType = PAR_TYPE.VAR,
                    minCount        = 0, maxCount = 1
                });

                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = GROUP_FACTOR_DEF,
                    minCount  = 0, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(Factor_Name, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 1, maxCount = 1
                });
                fun.parGroups.Last().par.Add(Factor_Value, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.NUMBER,
                    minCount  = 1, maxCount = 1
                });

                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = GROUP_AGG,
                    minCount  = 0, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(AggVar_Name, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.VAR,
                    minCount  = 1, maxCount = 1
                });
                fun.parGroups.Last().par.Add(AggVar_Part, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.VAR,
                    minCount  = 1, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(AggVar_Tolerance, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.NUMBER,
                    minCount  = 0, maxCount = 1, defaultValue = 0.0
                });

                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = GROUP_REGEXP,
                    minCount  = 0, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(RegExp_Def, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 1, maxCount = 1
                });
                fun.parGroups.Last().par.Add(RegExp_Factor, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.TEXT,
                    minCount  = 1, maxCount = 1,
                });
            }
 // DatabaseName is actually the only global query-parameter, and thus if functions only allow for RunCond
 // (and not for other common parameters) they usually will allow only for this query-parameter
 internal static void AddDBNamePar(DefinitionAdmin.Fun fun)
 {
     fun.par.AddRange(GetDBNamePar(optional: true));
 }
Beispiel #20
0
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Loop_Id, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 1, maxCount = 1
     });
     fun.par.Add(BreakCond, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CONDITION,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Num_Iterations
         }
     });
     fun.par.Add(Num_Iterations, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.NUMBER,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             BreakCond
         }
     });
     fun.par.Add(Last_Pol, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Last_Func, Stop_Before_Pol, Stop_Before_Func
         }
     });
     fun.par.Add(Last_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Last_Pol, Stop_Before_Pol, Stop_Before_Func
         }
     });
     fun.par.Add(Stop_Before_Pol, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Last_Pol, Last_Func, Stop_Before_Func
         }
     });
     fun.par.Add(Stop_Before_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Last_Pol, Last_Func, Stop_Before_Pol
         }
     });
     fun.par.Add(First_Pol, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             First_Func, Start_After_Pol, Start_After_Func
         }
     });
     fun.par.Add(First_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             First_Pol, Start_After_Pol, Start_After_Func
         }
     });
     fun.par.Add(Start_After_Pol, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             First_Pol, First_Func, Start_After_Func
         }
     });
     fun.par.Add(Start_After_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             First_Pol, First_Func, Start_After_Pol
         }
     });
 }
Beispiel #21
0
            public const string Band_XXX = "Band_XXX"; // that's a more or less arbitrary name (note however, that it is used in error messages)

            internal static void Add(DefinitionAdmin.Fun fun)
            {
                fun.par.Add(Base, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.FORMULA,
                    minCount  = 1, maxCount = 1
                });
                fun.par.Add(Do_Average_Rates, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.BOOLEAN,
                    minCount  = 0, maxCount = 1
                });
                fun.par.Add(Quotient, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.FORMULA,
                    minCount  = 0, maxCount = 1
                });
                fun.par.Add(BaseThreshold, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.FORMULA,
                    minCount  = 0, maxCount = 1
                });
                fun.par.Add(Round_Base, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.NUMBER,
                    minCount  = 0, maxCount = 1
                });
                fun.par.Add(Simple_Prog, new DefinitionAdmin.Par()
                {
                    valueType = PAR_TYPE.BOOLEAN,
                    minCount  = 0, maxCount = 1
                });


                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = Band_XXX,
                    minCount  = 1, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(Band_Rate, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 1, maxCount = 1,
                    substitutes = new List <string>()
                    {
                        Band_Amount
                    }
                });
                fun.parGroups.Last().par.Add(Band_Amount, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1,
                    substitutes = new List <string>()
                    {
                        Band_Rate
                    }
                });
                fun.parGroups.Last().par.Add(Band_LowLim, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1,
                    substitutes = new List <string>()
                    {
                        Band_UpLim
                    }
                });
                fun.parGroups.Last().par.Add(Band_UpLim, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1,
                    substitutes = new List <string>()
                    {
                        Band_LowLim
                    }
                });
            }
            internal static void Add(DefinitionAdmin.Fun fun)
            {
                fun.par.Add(Base_ILName, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.IL, minCount = 1, maxCount = 1,
                    description = "Incomelist specifying the variables on which the arithmetic operation takes place."
                });
                fun.par.Add(Base_Prefix, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
                    description = $"All variables in (decomposed) incomelist '{Base_ILName}' must start with this prefix."
                });
                fun.par.Add(Base_Postfix, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
                    description = $"All variables in (decomposed) incomelist '{Base_ILName}' must end with this postfix."
                });

                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = ILName, minCount = 0, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(ILName, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.IL, minCount = 1, maxCount = 1,
                    description = $"Additional incomelist containing variables used in the arithmetic operation (referred to by IL_COMPONENT). " +
                                  $"Decomposed content must at least contain all variables contained in '{Base_ILName}' " +
                                  $"only differing by '{Base_Prefix}'/'{Prefix}' and '{Base_Postfix}'/'{Postfix}'."
                });
                fun.parGroups.Last().par.Add(Prefix, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
                    description = $"All variables in (decomposed) incomelist '{ILName}' with same group must start with this prefix."
                });
                fun.parGroups.Last().par.Add(Postfix, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
                    description = $"All variables in (decomposed) incomelist '{ILName}' with same group must end with this postfix."
                });

                fun.par.Add(Formula, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA, minCount = 1, maxCount = 1,
                    description = $"Arithmetic operation to be performed, allowing for placeholders '{BASE_IL_COMPONENT}', '{IL_COMPONENT}['{ILName}']' and '{OUT_IL_COMPONENT}'."
                });


                fun.par.Add(Out_ILName, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 1, maxCount = 1,
                    description = "Name of the incomelist to contain the output variables. Will be created if it does not exist."
                });
                fun.par.Add(Out_Prefix, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
                    description = $"All variables in incomelist '{Out_ILName}' must start with this prefix, if the incomelist exists; if not they will be created with this prefix."
                });
                fun.par.Add(Out_Postfix, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.TEXT, minCount = 0, maxCount = 1,
                    description = $"All variables in incomelist '{Out_ILName}' must end with this postfix, if the incomelist exists; if not they will be created with this postfix."
                });
            }
            public const string Comp_X = "Comp_X"; // that's a more or less arbitrary name (note however, that it is used in error messages)

            internal static void Add(DefinitionAdmin.Fun fun)
            {
                fun.par.Add(Base, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1,
                    description = "Base amount that can be used with parameters compX_perTU / compX_perElig, referenced as $Base."
                });
                fun.par.Add(Withdraw_Base, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1,
                    description = "Withdraw_Base * Withdraw_Rate is deducted from function's (preliminary) result.\nNot that if withdraw parameters are used, the function's result cannot be negative."
                });
                fun.par.Add(Withdraw_Rate, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1, defaultValue = 0.0,
                    substitutes = new List <string>()
                    {
                        Withdraw_End
                    },
                    description = "Withdraw_Base * Withdraw_Rate is deducted from function's (preliminary) result.\nNot that if withdraw parameters are used, the function's result cannot be negative."
                });
                fun.par.Add(Withdraw_Start, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1, defaultValue = 0.0,
                    description = "Level of Withdraw_Base where withdrawal starts."
                });
                fun.par.Add(Withdraw_End, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1, defaultValue = DefinitionAdmin.POS_INFINITE,
                    substitutes = new List <string>()
                    {
                        Withdraw_Rate
                    },
                    description = "Level of Withdraw_Base where withdrawal ends (i.e. benefit is totally withdrawn).\nNote that the parameter is ignored if Withdraw_Rate is indicated."
                });

                fun.parGroups.Add(new DefinitionAdmin.ParGroup()
                {
                    groupName = Comp_X,
                    minCount  = 1, maxCount = DefinitionAdmin.MANY
                });
                fun.parGroups.Last().par.Add(Comp_Cond, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.CONDITION,
                    minCount    = 1, maxCount = 1,
                    description = "Condition that must be fulfilled to add the component (comp_perTU / comp_perElig) to the function's result.\nSyntax rules as for parameter Elig_Cond of function Elig apply."
                });
                fun.parGroups.Last().par.Add(Comp_perTU, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 1, maxCount = 1,
                    substitutes = new List <string>()
                    {
                        Comp_perElig
                    },
                    description = "Formula to calculate one component of the function's result. The result of the formula is added once to the function's result, regardless whether one or more members of the assessment unit fulfill the components condition (Comp_Cond).\nSyntax rules as for parameter Formula of function ArithOp apply."
                });
                fun.parGroups.Last().par.Add(Comp_perElig, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1,
                    substitutes = new List <string>()
                    {
                        Comp_perTU
                    },
                    description = "Formula to calculate one component of the function's result. The result of the formula is added to the function's result once for each member of the assessment unit fulfiling the components condition (Comp_Cond).\nSyntax rules as for parameter Formula of function ArithOp apply."
                });
                fun.parGroups.Last().par.Add(Comp_LowLim, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1, defaultValue = DefinitionAdmin.NEG_INFINITE,
                    description = "Replaces component if component is smaller."
                });
                fun.parGroups.Last().par.Add(Comp_UpLim, new DefinitionAdmin.Par()
                {
                    valueType   = PAR_TYPE.FORMULA,
                    minCount    = 0, maxCount = 1, defaultValue = DefinitionAdmin.POS_INFINITE,
                    description = "Replaces component if component is higher."
                });
            }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Loop_Id, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 1, maxCount = 1
     });
     fun.par.Add(Elig_Unit, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TU,
         minCount  = 1, maxCount = 1
     });
     fun.par.Add(Elig_Unit_Cond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Elig_Unit_Cond_Who, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 0, maxCount = 1, defaultValue = Value.WHO_ALL,
         categValues = GetWhoMustBeEligValues()
     });
     fun.par.Add(Last_Pol, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Last_Func, Stop_Before_Pol, Stop_Before_Func
         }
     });
     fun.par.Add(Last_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Last_Pol, Stop_Before_Pol, Stop_Before_Func
         }
     });
     fun.par.Add(Stop_Before_Pol, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Last_Pol, Last_Func, Stop_Before_Func
         }
     });
     fun.par.Add(Stop_Before_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             Last_Pol, Last_Func, Stop_Before_Pol
         }
     });
     fun.par.Add(First_Pol, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             First_Func, Start_After_Pol, Start_After_Func
         }
     });
     fun.par.Add(First_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             First_Pol, Start_After_Pol, Start_After_Func
         }
     });
     fun.par.Add(Start_After_Pol, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             First_Pol, First_Func, Start_After_Func
         }
     });
     fun.par.Add(Start_After_Func, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             First_Pol, First_Func, Start_After_Pol
         }
     });
 }
Beispiel #25
0
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Varname_Sum, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_Mean, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_Median, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_Decile, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_Quintile, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_Count, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_PosCount, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_NegCount, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_Min, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Varname_Max, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Agg, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.VARorIL,
         minCount  = 0, maxCount = DefinitionAdmin.MANY
     });
     fun.par.Add(Incl_Cond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Incl_Cond_Who, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 0, maxCount = 1,
         categValues = GetWhoMustBeEligValues()
     });
     fun.par.Add(Use_Weights, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.BOOLEAN, defaultValue = true,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(Weight_Var, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.VAR, defaultValue = DefVarName.DWT,
         minCount  = 0, maxCount = 1
     });
 }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(FlagVar, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.VAR,
         minCount    = 0, maxCount = 1,
         description = "If indicated, variable is set to 1 for persons added by this AddHHMembes function.\nNote that the variable must exist.\nAlso note that the variable is not changed for any other persons (thus it can e.g.be used to hold the flag for more than one AddHHMembers functions)."
     });
     fun.parGroups.Add(new DefinitionAdmin.ParGroup()
     {
         groupName = GROUP_MAIN,
         minCount  = 1, maxCount = DefinitionAdmin.MANY
     });
     fun.parGroups.Last().par.Add(Add_Who, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 1, maxCount = 1,
         categValues = new List <string>()
         {
             Value.ADDHHMEMBERS_CHILD, Value.ADDHHMEMBERS_PARTNER, Value.ADDHHMEMBERS_OTHER
         }
     });
     fun.parGroups.Last().par.Add(ParentCond, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CONDITION,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             PartnerCond, HHCond
         }
     });
     fun.parGroups.Last().par.Add(PartnerCond, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CONDITION,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             ParentCond, HHCond
         }
     });
     fun.parGroups.Last().par.Add(HHCond, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CONDITION,
         minCount    = 0, maxCount = 1,
         substitutes = new List <string>()
         {
             PartnerCond, ParentCond
         }
     });
     fun.parGroups.Last().par.Add(IsPartnerParent, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.BOOLEAN,
         minCount  = 0, maxCount = 1, defaultValue = true
     });
     fun.parGroups.Last().par.Add(PAR_TYPE.PLACEHOLDER.ToString(), new DefinitionAdmin.Par()
     {
         valueType       = PAR_TYPE.FORMULA,
         placeholderType = PAR_TYPE.VAR,
         minCount        = 0, maxCount = DefinitionAdmin.MANY
     });
 }
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(Name, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 1, maxCount = 1
     });
     fun.par.Add(IsStatic, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.BOOLEAN,
         minCount    = 0, maxCount = 1, defaultValue = true, // i.e. reflects the "old" behaviour
         description = "If set to no, TU is recreated on each use, default = yes.\nSet to 'no' e.g. for a child-definition depending on a variable that changes during run."
     });
     fun.par.Add(Type, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 1, maxCount = 1,
         categValues = new List <string>()
         {
             Value.TUTYPE_HH, Value.TUTYPE_IND, Value.TUTYPE_SUBGROUP
         }
     });
     fun.par.Add(Members, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.TEXT,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(HeadDefInc, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.VARorIL,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(ExtHeadCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(PartnerCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(DepChildCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(OwnChildCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(OwnDepChildCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(LooseDepChildCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(DepParentCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(DepRelativeCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(LoneParentCond, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.CONDITION,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(StopIfNoHeadFound, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.BOOLEAN,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(NoChildIfHead, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.BOOLEAN,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(NoChildIfPartner, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.BOOLEAN,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(AssignDepChOfDependents, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.BOOLEAN,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(AssignPartnerOfDependents, new DefinitionAdmin.Par()
     {
         valueType = PAR_TYPE.BOOLEAN,
         minCount  = 0, maxCount = 1
     });
     fun.par.Add(MultiplePartners, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 0, maxCount = 1,
         categValues = new List <string>()
         {
             Value.MULTIPLE_PARTNERS_WARN, Value.MULTIPLE_PARTNERS_IGNORE, Value.MULTIPLE_PARTNERS_ALLOW
         },
         description = "Allows customizing the behaviour when multiple partners are found in the data."
     });
 }
Beispiel #28
0
            internal static void Add(DefinitionAdmin.Fun fun,
                                     TU_ADD_MODE tuMode         = TU_ADD_MODE.COMPULSORY,
                                     OUTVAR_ADD_MODE outvarMode = OUTVAR_ADD_MODE.COMPULSORY, string outvarDefault = null, bool addResultVar = true,
                                     bool addElig = true, bool addRunCond = true, bool addLimits = true, bool addRound = true)
            {
                if (outvarMode != OUTVAR_ADD_MODE.NOT)
                {
                    fun.par.Add(Output_Var, new DefinitionAdmin.Par()
                    {
                        valueType    = PAR_TYPE.OUTVAR, isCommon = true,
                        minCount     = outvarMode == OUTVAR_ADD_MODE.COMPULSORY ? 1 : 0, maxCount = 1,
                        defaultValue = outvarDefault,
                        substitutes  = outvarMode == OUTVAR_ADD_MODE.OPTIONAL_NOADD ? new List <string>() : new List <string> {
                            Output_Add_Var
                        },
                        description = "Variable for storing the result of the function. Result of function overwrites the current value of the variable."
                    });
                    if (outvarMode != OUTVAR_ADD_MODE.OPTIONAL_NOADD)
                    {
                        fun.par.Add(Output_Add_Var, new DefinitionAdmin.Par()
                        {
                            valueType    = PAR_TYPE.OUTVAR, isCommon = true,
                            minCount     = 0, maxCount = 1,
                            defaultValue = outvarDefault,
                            substitutes  = new List <string>()
                            {
                                Output_Var
                            },
                            description = "Variable for storing the result of the function. Result of function is added to the current value of the variable."
                        });
                    }
                }
                if (tuMode != TU_ADD_MODE.NOT)
                {
                    fun.par.Add(TAX_UNIT, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.TU, isCommon = true,
                        minCount    = tuMode == TU_ADD_MODE.COMPULSORY ? 1 : 0, maxCount = 1,
                        description = "Assessment unit for function's calculations."
                    });
                }
                if (addResultVar)
                {
                    fun.par.Add(Result_Var, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.OUTVAR, isCommon = true,
                        minCount    = 0, maxCount = 1,
                        description = "Variable for storing the result of the function. Result of function overwrites the current value of the variable."
                    });
                }

                if (addElig)
                {
                    fun.par.Add(Who_Must_Be_Elig, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.CATEG, isCommon = true,
                        minCount    = 0, maxCount = 1,
                        categValues = GetWhoMustBeEligValues(),
                        description = "Function's calculations are carried out if ..." + Environment.NewLine +
                                      "- one (one_member): ... one member of the assessment unit is 'eligible'" + Environment.NewLine +
                                      "- one_adult: ... one adult member of the assessment unit is 'eligible'" + Environment.NewLine +
                                      "- all (all_members; taxunit): ... all members of the assessment unit are 'eligible'" + Environment.NewLine +
                                      "- all_adults: ... all adult members of the assessment unit are 'eligible'" + Environment.NewLine +
                                      "- nobody: ... always" + Environment.NewLine +
                                      "'eligible' is determined by the variable indicated by parameter Elig_Var"
                    });
                    fun.par.Add(Elig_Var, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.VAR, isCommon = true,
                        minCount    = 0, maxCount = 1, defaultValue = DefVarName.DEFAULT_ELIGVAR,
                        description = "Variable indicating whether a person is 'eligible' (see parameter Who_Must_Be_Elig):" + Environment.NewLine +
                                      "- zero: person is not eligible" + Environment.NewLine +
                                      "- non zero: person is eligible"
                    });
                }

                if (addRunCond)
                {
                    AddRunCond(fun);
                }

                if (addLimits)
                {
                    fun.par.Add(LowLim, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.FORMULA, isCommon = true,
                        minCount    = 0, maxCount = 1, defaultValue = DefinitionAdmin.NEG_INFINITE,
                        description = "Replaces result of function if result is smaller."
                    });
                    fun.par.Add(UpLim, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.FORMULA, isCommon = true,
                        minCount    = 0, maxCount = 1, defaultValue = DefinitionAdmin.POS_INFINITE,
                        description = "Replaces result of function if result is higher."
                    });
                    fun.par.Add(Threshold, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.FORMULA, isCommon = true,
                        minCount    = 0, maxCount = 1, defaultValue = DefinitionAdmin.NEG_INFINITE,
                        description = "Replaces result of function if result is smaller: if lower limit is not defined by zero, otherwise by lower limit."
                    });
                    fun.par.Add(Limpriority, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.CATEG, isCommon = true,
                        minCount    = 0, maxCount = 1, defaultValue = Value.NA,
                        categValues = new List <string>()
                        {
                            Value.LIMPRI_LOWER, Value.LIMPRI_UPPER, Value.NA
                        },
                        description = "Parameter for the further specification of an operand:" + Environment.NewLine +
                                      "Possible values:" + Environment.NewLine +
                                      "If upper limit (UpLim) is smaller than lower limit (LowLim) ..." + Environment.NewLine +
                                      "- upper: ... upper limit dominates" + Environment.NewLine +
                                      "- lower: ... lower limit dominates" + Environment.NewLine +
                                      "- not defined: ... a warning is issued."
                    });
                }

                if (addRound)
                {
                    fun.par.Add(Round_Down, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.NUMBER, isCommon = true,
                        minCount    = 0, maxCount = 1,
                        substitutes = new List <string>()
                        {
                            Round_to, Round_Up
                        },
                        description = "Result is rounded down to nearest whole number if set to 1, to nearest number with 1 decimal if set to 0.1, to nearest 10 if set to 10, etc."
                    });

                    fun.par.Add(Round_Up, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.NUMBER, isCommon = true,
                        minCount    = 0, maxCount = 1,
                        substitutes = new List <string>()
                        {
                            Round_Down, Round_to
                        },
                        description = "Result is rounded up to nearest whole number if set to 1, to nearest number with 1 decimal if set to 0.1, to nearest 10 if set to 10, etc."
                    });

                    fun.par.Add(Round_to, new DefinitionAdmin.Par()
                    {
                        valueType   = PAR_TYPE.NUMBER, isCommon = true,
                        minCount    = 0, maxCount = 1,
                        substitutes = new List <string>()
                        {
                            Round_Down, Round_Up
                        },
                        description = "Result is rounded to nearest whole number if set to 1, to nearest number with 1 decimal if set to 0.1, to nearest 10 if set to 10, etc."
                    });
                }
            }
Beispiel #29
0
 internal static void Add(DefinitionAdmin.Fun fun)
 {
     fun.par.Add(File, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 1, maxCount = 1,
         description = "Name of text file to write the output to (the extension .txt can be omitted)."
     });
     fun.par.Add(Var, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.VAR,
         minCount    = 0, maxCount = DefinitionAdmin.MANY,
         description = "Name of a variable to be included in the output."
     });
     fun.par.Add(StringVar, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.STRINGVAR,
         minCount    = 0,
         maxCount    = DefinitionAdmin.MANY,
         description = "Name of a string variable to be included in the output."
     });
     fun.par.Add(IL, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.IL,
         minCount    = 0, maxCount = DefinitionAdmin.MANY,
         description = "Name of an incomelist to be included in the output.\nThe total value of the incomelist is outputted (see parameter DefIL for outputting components)."
     });
     fun.par.Add(VarGroup, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = DefinitionAdmin.MANY,
         description = "Regular expression that describes a group of variables to be included in the output, where * stands for any character and ? stands for one arbitrary character (e.g. b* includes all variables starting with b)."
     });
     fun.par.Add(ILGroup, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TEXT,
         minCount    = 0, maxCount = DefinitionAdmin.MANY,
         description = "Regular expression that describes a group of incomelists to be included in the output, where * stands for any character and ? stands for one arbitrary character (e.g. ils* for all system incomelists)."
     });
     fun.par.Add(DefIL, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.IL,
         minCount    = 0, maxCount = DefinitionAdmin.MANY,
         description = "Name of an incomelist to be included in the output.\nThe content of the incomelist is outputted, i.e. the variables contained in the incomelist (see parameter IL for outputting the total value)."
     });
     fun.par.Add(nDecimals, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.NUMBER,
         minCount    = 0, maxCount = 1, defaultValue = 2.0,
         description = "Number of decimals of monetary variables to show in output.\nValues with more decimals are rounded."
     });
     fun.par.Add(Append, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.BOOLEAN,
         minCount    = 0, maxCount = 1, defaultValue = false,
         description = "If set to yes: any existing content of the output file is removed.\nIf set to no: output is added to any existing content of the output file."
     });
     fun.parGroups.Add(new DefinitionAdmin.ParGroup()
     {
         groupName = UnitInfo_XXX,
         minCount  = 0, maxCount = DefinitionAdmin.MANY
     });
     fun.parGroups.Last().par.Add(UnitInfo_TU, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.TU,
         minCount    = 1, maxCount = 1,
         description = "Assessment unit for which UnitInfo_Id parameters apply.\nNote, that outputting unit info variables usually only makes sense if TAX_UNIT is set to an individual assessment unit."
     });
     fun.parGroups.Last().par.Add(UnitInfo_Id, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.CATEG,
         minCount    = 1, maxCount = DefinitionAdmin.MANY,
         categValues = new List <string>()
         {
             Value.UNITINFO_HEADID,
             Value.UNITINFO_ISPARTNER,
             Value.UNITINFO_ISDEPENDENTCHILD, Value.UNITINFO_ISDEPCHILD,
             Value.UNITINFO_ISOWNCHILD,
             Value.UNITINFO_ISOWNDEPENDENTCHILD, Value.UNITINFO_ISOWNDEPCHILD,
             Value.UNITINFO_ISDEPPARENT,
             Value.UNITINFO_ISDEPRELATIVE,
             Value.UNITINFO_ISLONEPARENT,
             Value.UNITINFO_ISCOHABITING,
             Value.UNITINFO_ISWITHPARTNER,
             Value.UNITINFO_ISPARENT,
             Value.UNITINFO_ISPARENTOFDEPCHILD,
             Value.UNITINFO_ISINEDUCATION,
             Value.UNITINFO_ISLOOSEDEPCHILD,
             Value.UNITINFO_ISLONEPARENTOFDEPCHILD,
             Value.UNITINFO_NPERSINUNIT,
             Value.UNITINFO_NDEPCHILDRENINTU,
             Value.UNITINFO_NDEPPARENTSINTU,
             Value.UNITINFO_NDEPRELATIVESINTU
         },
         description = "The UnitInfo parameters allow the determination of the 'status' of single members within the assessment unit specified by UnitInfo_TU.\nPossible values of UnitInfo_Id are:\n- HeadID: the output includes PersonId of the unit's Head.\n- IsPartner: the output includes a 0/1-variable for being Partner.\n- IsDependentChild (IsDepChild): the output includes a 0/1-variable for being a dependent child.\n- IsOwnChild: the output includes a 0/1-variable for being an own child.\n- IsOwnDependentChild (IsOwnDepChild): the output includes a 0/1-variable for being an own dependent child.\n- IsDepParent: the output includes a 0/1-variable for being a dependent parent.\n- IsDepRelative: the output includes a 0/1-variable for being a dependent relative.\n- IsLoneParent: the output includes a 0/1-variable for being a lone parent."
     });
     fun.par.Add(Replace_Void_By, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.NUMBER,
         minCount    = 0, maxCount = 1,
         description = "Amount to be used for 'undefined' in the output.\nNote that the default 'void' value is 0.0000000000001."
     });
     fun.par.Add(Suppress_Void_Message, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.BOOLEAN,
         minCount    = 0, maxCount = 1, defaultValue = false,
         description = "If set to yes, the warning for an 'undefined' variable is suppressed."
     });
     fun.par.Add(MultiplyMonetaryBy, new DefinitionAdmin.Par()
     {
         valueType   = PAR_TYPE.FORMULA,
         minCount    = 0, maxCount = 1,
         description = "All monetary values are multiplied by this factor.\n(Allows e.g. for the specification of a special exchange rate)."
     });
 }