private void PrepareIterationPar()
 {
     // assess parameters which define the number of iterations
     breakCond = GetUniquePar <ParCond>(DefPar.Loop.BreakCond);
     if (breakCond == null)
     {
         ParNumber parIt = GetUniquePar <ParNumber>(DefPar.Loop.Num_Iterations);
         if (parIt != null)
         {
             nIterations = (int)parIt.GetValue();
         }
         else
         {
             infoStore.communicator.ReportError(new Communicator.ErrorInfo()
             {
                 isWarning = false,
                 message   = $"{description.Get()}: neither parameter {DefPar.Loop.Num_Iterations} nor {DefPar.Loop.BreakCond} defined"
             });
         }
     }
     else
     {
         if (!breakCond.IsGlobal())
         {
             infoStore.communicator.ReportError(new Communicator.ErrorInfo()
             {
                 isWarning = false,
                 message   = $"{breakCond.description.Get()}: condition is supposed to be global but contains personal/household related operands"
             });
         }
     }
 }
Esempio n. 2
0
        private void PrepareRunCond(List <ParBase> nonFootnotePar)
        {
            coParRunCond = GetUniquePar <ParCond>(DefPar.Common.Run_Cond);
            if (coParRunCond == null)
            {
                return;
            }

            coParRunCond.CheckAndPrepare(this);
            if (!coParRunCond.IsGlobal())
            {
                infoStore.communicator.ReportError(new Communicator.ErrorInfo()
                {
                    isWarning = true, message = $"{coParRunCond.description.Get()}: condition must use global variables only"
                });
            }
            else if (coParRunCond.IsGlobal(true)) // if read-time checking is possible (e.g. for IsUsedDataset, GetSystemYear, ...)
            {
                runCondMet_ReadTime = IsRunCondMet();
            }
            nonFootnotePar.Remove(coParRunCond); // remove, to not check and prepare again with the other parameters
        }