Example #1
0
 StepByStepPicking(
     FilteringHeuristic filtering)     //choosing next value (tries all possible variations of parametrs, if doesnt fit - backtracking will solve the issue)
 {
     if (filtering == FilteringHeuristic.NONE)
     {
         if (Value.TeacherValue != Teachers.Last())
         {
             Value.TeacherValue = Teachers.ElementAt(Teachers.IndexOf(Value.TeacherValue) + 1);
         }
         else if (Value.AudienceValue != Audiences.Last())
         {
             Value.TeacherValue  = Teachers.First(); // resetting previous data element
             Value.AudienceValue = Audiences.ElementAt(Audiences.IndexOf(Value.AudienceValue) + 1);
         }
         else if (Value.TimeValue != Times.Last())
         {
             Value.AudienceValue = Audiences.First(); // resetting previous data element
             Value.TimeValue     = Times.ElementAt(Times.IndexOf(Value.TimeValue) + 1);
         }
         else if (Value.DayValue != Days.Last())
         {
             Value.TimeValue = Times.First(); // resetting previous data element
             Value.DayValue  = Days.ElementAt(Days.IndexOf(Value.DayValue) + 1);
         }
     }
     else
     {
         Value = new Value(PossibleValues.First());
         PossibleValues.RemoveAt(0);
     }
 }
Example #2
0
        public int IndexOf(KeyValuePair <double, double[, ]> item)
        {
            var index = Times.IndexOf(item.Key);

            if (index == -1)
            {
                return(-1);
            }
            if (item.Value != Parameters[index])
            {
                return(-1);
            }
            return(index);
        }
Example #3
0
 internal double[, ] this[double t]
 {
     get { return(Parameters[Times.IndexOf(t)]); }
 }