private void RunAccountForEfficienciesBenchmarkTest( DateInterval initialInterval, List <DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint = FixedEndPoint.Min, bool assertIntervalsEquality = false) { var stopwatch = Stopwatch.StartNew(); var effectualInterval = initialInterval.AccountForEfficiencies(dateIntervalEfficiencies, fixedEndPoint); stopwatch.Stop(); Debug.WriteLine(string.Format("Span whole collection, Elapsed time: {0} ms, result is: {1}", stopwatch.ElapsedMilliseconds, effectualInterval)); if (assertIntervalsEquality) { Assert.AreEqual(initialInterval, effectualInterval); } initialInterval = (fixedEndPoint == FixedEndPoint.Min) ? new DateInterval(this.now, dateIntervalEfficiencies[this.numberOfIntervals / 2].Max.Value) : new DateInterval(dateIntervalEfficiencies[this.numberOfIntervals / 2].Max.Value, dateIntervalEfficiencies.Last().Max.Value); stopwatch.Reset(); stopwatch.Start(); effectualInterval = initialInterval.AccountForEfficiencies(dateIntervalEfficiencies, fixedEndPoint); stopwatch.Stop(); Debug.WriteLine(string.Format("Span half collection, Elapsed time: {0} ms, result is: {1}", stopwatch.ElapsedMilliseconds, effectualInterval)); if (assertIntervalsEquality) { Assert.AreEqual(initialInterval, effectualInterval); } }
public void NoOverlaps(int durationInMinutes, int offSetinMinutes, FixedEndPoint fixedEndPoint) { // 1% efficiency var dateIntervalEfficiencies = DateIntervalCollectionGenerator.NoOverlaps(now, TimeSpan.FromMinutes(durationInMinutes), TimeSpan.FromMinutes(offSetinMinutes), numberOfIntervals) .Select(interval => new DateIntervalEfficiency(interval, 1)).ToList(); var initialInterval = new DateInterval(now, dateIntervalEfficiencies.Last().Max.Value); RunAccountForEfficienciesBenchmarkTest(initialInterval, dateIntervalEfficiencies, fixedEndPoint, assertIntervalsEquality: false); }
private void RunAccountForEfficienciesBenchmarkTest( DateInterval initialInterval, List<DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint = FixedEndPoint.Min, bool assertIntervalsEquality = false) { var stopwatch = Stopwatch.StartNew(); var effectualInterval = initialInterval.AccountForEfficiencies(dateIntervalEfficiencies, fixedEndPoint); stopwatch.Stop(); Debug.WriteLine(string.Format("Span whole collection, Elapsed time: {0} ms, result is: {1}", stopwatch.ElapsedMilliseconds, effectualInterval)); if(assertIntervalsEquality) { Assert.AreEqual(initialInterval, effectualInterval); } initialInterval = (fixedEndPoint == FixedEndPoint.Min) ? new DateInterval(this.now, dateIntervalEfficiencies[this.numberOfIntervals / 2].Max.Value) : new DateInterval(dateIntervalEfficiencies[this.numberOfIntervals / 2].Max.Value, dateIntervalEfficiencies.Last().Max.Value); stopwatch.Reset(); stopwatch.Start(); effectualInterval = initialInterval.AccountForEfficiencies(dateIntervalEfficiencies, fixedEndPoint); stopwatch.Stop(); Debug.WriteLine(string.Format("Span half collection, Elapsed time: {0} ms, result is: {1}", stopwatch.ElapsedMilliseconds, effectualInterval)); if (assertIntervalsEquality) { Assert.AreEqual(initialInterval, effectualInterval); } }
/// <summary> /// This method will accept a dateInterval and calcualte a new dateInterval taking into account the dateIntervalEfficiencies /// ASSUMPTION: the input dateInterval has an efficiency of 100%. /// </summary> /// <param name="dateInterval"> /// </param> /// <param name="dateIntervalEfficiencies"> /// </param> /// <param name="fixedEndPoint"> /// </param> /// <returns> /// The <see cref="DateInterval"/>. /// </returns> public static DateInterval AccountForEfficiencies(this DateInterval dateInterval, List<DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint = FixedEndPoint.Min) { throw new NotImplementedException(); }
public DateInterval AccountForEfficiencies(DateInterval initialInterval, List <DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint) { return(initialInterval.MoustafaS2(dateIntervalEfficiencies, fixedEndPoint)); }
public DateInterval AccountForEfficiencies(DateInterval initialInterval, List <DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint) { return(initialInterval.Quicks01ver(dateIntervalEfficiencies, fixedEndPoint)); }
public DateInterval AccountForEfficiencies(DateInterval initialInterval, List<DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint) { return initialInterval.thcristo3(dateIntervalEfficiencies, fixedEndPoint); }
/// <summary> /// This method will accept a dateInterval and calcualte a new dateInterval taking into account the dateIntervalEfficiencies /// ASSUMPTION: the input dateInterval has an efficiency of 100%. /// </summary> /// <param name="dateInterval"> /// </param> /// <param name="dateIntervalEfficiencies"> /// </param> /// <param name="fixedEndPoint"> /// </param> /// <returns> /// The <see cref="DateInterval"/>. /// </returns> public static DateInterval AccountForEfficiencies(this DateInterval dateInterval, List <DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint = FixedEndPoint.Min) { throw new NotImplementedException(); }
/// <summary> /// This method will accept a dateInterval and calcualte a new dateInterval taking into account the dateIntervalEfficiencies /// ASSUMPTION: the input dateInterval has an efficiency of 100%. /// </summary> /// <param name="dateInterval"> /// </param> /// <param name="dateIntervalEfficiencies"> /// </param> /// <param name="fixedEndPoint"> /// </param> /// <returns> /// The <see cref="DateInterval"/>. /// </returns> public static DateInterval AccountForEfficiencies(this DateInterval dateInterval, List<DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint = FixedEndPoint.Min) { return Orc.Submissions.AccountForEfficiencies.AccountForEfficiencies.Quicks01lver3(dateInterval, dateIntervalEfficiencies, fixedEndPoint); }
/// <summary> /// This method will accept a dateInterval and calcualte a new dateInterval taking into account the dateIntervalEfficiencies /// ASSUMPTION: the input dateInterval has an efficiency of 100%. /// </summary> /// <param name="dateInterval"> /// </param> /// <param name="dateIntervalEfficiencies"> /// </param> /// <param name="fixedEndPoint"> /// </param> /// <returns> /// The <see cref="DateInterval"/>. /// </returns> public static DateInterval AccountForEfficiencies(this DateInterval dateInterval, List <DateIntervalEfficiency> dateIntervalEfficiencies, FixedEndPoint fixedEndPoint = FixedEndPoint.Min) { return(Orc.Submissions.AccountForEfficiencies.AccountForEfficiencies.Quicks01lver3(dateInterval, dateIntervalEfficiencies, fixedEndPoint)); }