public void FixedEndPointNoOverlapsWithOffset(IAccountForEfficiencies accountForEfficienciesCalculator) { // 1% efficiency var dateIntervalEfficiencies = DateIntervalCollectionGenerator.NoOverlaps(this.now, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1), this.numberOfIntervals) .Select(interval => new DateIntervalEfficiency(interval, 1)).ToList(); var initialInterval = new DateInterval(this.now, dateIntervalEfficiencies.Last().Max.Value); accountForEfficienciesCalculator.AccountForEfficiencies(initialInterval, dateIntervalEfficiencies, FixedEndPoint.Max); }
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); }
public void FixedStartPointNoOverlapsWithOffsetWithSpan(double spanEfficiency, int spanPriority, bool assertIntervalsEquality) { // 1% efficiency var dateIntervalEfficiencies = DateIntervalCollectionGenerator.NoOverlaps(now, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1), numberOfIntervals) .Select(interval => new DateIntervalEfficiency(interval, 1)).ToList(); var initialInterval = new DateInterval(now, dateIntervalEfficiencies.Last().Max.Value); dateIntervalEfficiencies.Add(new DateIntervalEfficiency(initialInterval, spanEfficiency, spanPriority)); RunAccountForEfficienciesBenchmarkTest(initialInterval, dateIntervalEfficiencies, FixedEndPoint.Min, assertIntervalsEquality); }
public void FixedStartPointNoOverlapsWithOffsetWithSpan2(IAccountForEfficiencies accountForEfficienciesCalculator) { // |--------------------------------------| 100 % // |--| |--| |--| |--| |--| |--| |--| // 50 150 50 150 50 150 // 1% efficiency var dateIntervalEfficiencies = DateIntervalCollectionGenerator.NoOverlaps(this.now, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1), this.numberOfIntervals) .Select((interval, i) => new DateIntervalEfficiency(interval, i % 2 == 0 ? 50 : 150)).ToList(); var initialInterval = new DateInterval(this.now, dateIntervalEfficiencies.Last().Max.Value); dateIntervalEfficiencies.Add(new DateIntervalEfficiency(initialInterval, 100)); accountForEfficienciesCalculator.AccountForEfficiencies(initialInterval, dateIntervalEfficiencies, FixedEndPoint.Min); }