Example #1
0
        private List <Interval> GetIntarvalsFor(MonthDayDay monthDayDay)
        {
            var result = Intervals.Where(x =>
                                         x.DateStart.Month == monthDayDay.Month &&
                                         x.DateStart.Day == monthDayDay.DayStart);

            if (monthDayDay.Month != 2)
            {
                result = result.Where(x => x.DateFinish.Day == monthDayDay.DayFinish);
            }
            else
            {
                result = result.Where(x => x.DateFinish.Day == 28 || x.DateFinish.Day == 29);
            }

            return(result.ToList());
        }
Example #2
0
        public Probability GetProbability(MonthDayDay monthDayDay, int key)
        {
            var intervals = GetIntarvalsFor(monthDayDay);

            var probabilities = new List <ProbabilityItem>();

            foreach (var interval in intervals)
            {
                interval.IntervalValue.TryGetValue(key, out var val);
                probabilities.Add(new ProbabilityItem(interval.DateStart.Year, val));
            }

            var result = new Probability(monthDayDay, key);

            result.Probabilities = CountProbobilityValueInList(probabilities).ToList();

            return(result);
        }
Example #3
0
 public Probability(MonthDayDay _monthDayDay, int key)
 {
     monthDayDay = _monthDayDay;
     Init(key);
 }