public void UpdateSplits(IRun splits)
            {
                Sections = new List <Section>();
                for (int splitIndex = splits.Count() - 1; splitIndex >= 0; splitIndex--)
                {
                    int sectionIndex = splitIndex;
                    while ((splitIndex > 0) && (splits[splitIndex - 1].Name.StartsWith("-")))
                    {
                        splitIndex--;
                    }

                    Sections.Insert(0, new Section(splitIndex, sectionIndex));
                }
            }
Beispiel #2
0
 public static void Clean(IRun run, TimingMethod method, CleanUpCallback callback = null)
 {
     var predictions = new TimeSpan?[run.Count + 1];
     CalculateSumOfBest(run, 0, run.Count() - 1, predictions, true, method);
     int segmentIndex = 0;
     TimeSpan? currentTime = TimeSpan.Zero;
     foreach (var segment in run)
     {
         currentTime = predictions[segmentIndex];
         foreach (var nullSegment in run[segmentIndex].SegmentHistory.Where(x => !x.Time[method].HasValue))
         {
             var prediction = SumOfSegmentsHelper.TrackBranch(run, currentTime, segmentIndex + 1, nullSegment.Index, method);
             CheckPrediction(run, predictions, prediction.Time[method], segmentIndex - 1, prediction.Index - 1, nullSegment.Index, method, callback);
         } 
         segmentIndex++;
     }
 }
Beispiel #3
0
        public static void Clean(IRun run, TimingMethod method, CleanUpCallback callback = null)
        {
            var predictions = new TimeSpan?[run.Count + 1];

            CalculateSumOfBest(run, 0, run.Count() - 1, predictions, true, method);
            int      segmentIndex = 0;
            TimeSpan?currentTime  = TimeSpan.Zero;

            foreach (var segment in run)
            {
                currentTime = predictions[segmentIndex];
                foreach (var nullSegment in run[segmentIndex].SegmentHistory.Where(x => !x.Time[method].HasValue))
                {
                    var prediction = TrackBranch(run, currentTime, segmentIndex + 1, nullSegment.Index, method);
                    CheckPrediction(run, predictions, prediction.Time[method], segmentIndex - 1, prediction.Index - 1, nullSegment.Index, method, callback);
                }
                segmentIndex++;
            }
        }
Beispiel #4
0
 public static TimeSpan?CalculateSumOfBest(IRun run, bool simpleCalculation, TimingMethod method = TimingMethod.RealTime)
 {
     return(CalculateSumOfBest(run, run.Count() - 1, simpleCalculation, method));
 }
Beispiel #5
0
        public static TimeSpan?CalculateSumOfBest(IRun run, bool simpleCalculation = false, bool useCurrentRun = true, TimingMethod method = TimingMethod.RealTime)
        {
            var predictions = new TimeSpan?[run.Count + 1];

            return(CalculateSumOfBest(run, 0, run.Count() - 1, predictions, simpleCalculation, useCurrentRun, method));
        }
Beispiel #6
0
 public static TimeSpan? CalculateSumOfBest(IRun run, bool simpleCalculation, TimingMethod method = TimingMethod.RealTime)
 {
     return CalculateSumOfBest(run, run.Count() - 1, simpleCalculation, method);
 }
Beispiel #7
0
 public static TimeSpan? CalculateSumOfBest(IRun run, bool simpleCalculation = false, bool useCurrentRun = true, TimingMethod method = TimingMethod.RealTime)
 {
     var predictions = new TimeSpan?[run.Count + 1];
     return CalculateSumOfBest(run, 0, run.Count() - 1, predictions, simpleCalculation, useCurrentRun, method);
 }
            public void UpdateSplits(IRun splits)
            {
                Sections = new List<Section>();
                for (int splitIndex = splits.Count() - 1; splitIndex >= 0; splitIndex--)
                {
                    int sectionIndex = splitIndex;
                    while ((splitIndex > 0) && (splits[splitIndex - 1].Name.StartsWith("-")))
                        splitIndex--;

                    Sections.Insert(0, new Section(splitIndex, sectionIndex));
                }
            }