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 FixedStartPointNoOverlapsWithOffset(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.Min); }
public void FixedStartPointWithOverlaps(IAccountForEfficiencies accountForEfficienciesCalculator) { // With decreasing efficiency // |-------------------| 90 // |---------------| 80 // |---------| 70 // |-----| 60 // 1% efficiency var dateIntervalEfficiencies = DateIntervalCollectionGenerator.OverlapsWithDecreasingDuration(this.now, TimeSpan.FromMinutes(1), this.numberOfIntervals) .Select((interval, i) => new DateIntervalEfficiency(interval, this.numberOfIntervals - i)).ToList(); var initialInterval = new DateInterval(this.now, dateIntervalEfficiencies.First().Max.Value); accountForEfficienciesCalculator.AccountForEfficiencies(initialInterval, dateIntervalEfficiencies, FixedEndPoint.Min); }
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); }
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); }
public void FixedStartPointWithOverlapsWithSpan(IAccountForEfficiencies accountForEfficienciesCalculator) { // |-------------------| 100% with highest priority // |-------------------| 90 // |---------------| 80 // |---------| 70 // |-----| 60 // 1% efficiency var dateIntervalEfficiencies = DateIntervalCollectionGenerator.OverlapsWithDecreasingDuration(this.now, TimeSpan.FromMinutes(1), this.numberOfIntervals) .Select((interval, i) => new DateIntervalEfficiency(interval, this.numberOfIntervals - i)).ToList(); var initialInterval = new DateInterval(this.now, dateIntervalEfficiencies.First().Max.Value); dateIntervalEfficiencies.Add(new DateIntervalEfficiency(initialInterval, 100, 1)); accountForEfficienciesCalculator.AccountForEfficiencies(initialInterval, dateIntervalEfficiencies, FixedEndPoint.Min); }