コード例 #1
0
        protected bool IsRunCondMet(HH hh = null)
        {
            if (coParRunCond == null)
            {
                return(true);
            }

            return((hh == null) ? coParRunCond.GetGlobalValue()                    // for non-spine functions return values of first person in data
                                : coParRunCond.GetPersonValue(hh, new Person(0))); // for spine functions return values of first person in HH
        }                                                                          // (allows for using loopcounters in global condition)
コード例 #2
0
 private bool IsFinished(HH hh, double iterationsDone, bool checkRunCond)
 {
     if (checkRunCond && !IsRunCondMet(hh))
     {
         return(true);                                   // mimics the old exe, which does a do-while, i.e. check RunCond at end only
     }
     if (nIterations == -1)
     {
         return(hh == null?breakCond.GetGlobalValue()               // loop is terminated by condition
                    : breakCond.GetPersonValue(hh, new Person(0))); // condition is global: any person is ok as
     }
     return(iterationsDone >= nIterations);                         // loop has a fixed number of iteration
 }