33 public string Name =>
"Segerstedt reformulated Silver-Meal";
42 CancellationToken cancellationToken =
default)
44 ArgumentNullException.ThrowIfNull(problem);
45 cancellationToken.ThrowIfCancellationRequested();
49 var buffer = ArrayPool<int>.Shared.Rent(horizon);
53 var cycleEnds = buffer.AsSpan(0, horizon);
68 while (start < horizon)
70 cancellationToken.ThrowIfCancellationRequested();
73 var accumulatedHolding = 0.0;
74 var previousAverage = setupCost;
81 while (candidate < horizon)
88 if (!
double.IsFinite(accumulatedHolding))
90 throw new ArithmeticException(
91 "Numerical overflow while evaluating reformulated Silver-Meal.");
95 candidate - start + 1;
98 (setupCost + accumulatedHolding) /
101 if (average > previousAverage)
106 previousAverage = average;
115 cycleEnds[start] = bestEnd;
131 ArrayPool<int>.Shared.Return(
Shared applicability checks for classical stationary-cost lot-sizing heuristics.
static void ThrowIfNotStationary(UlsProblem problem, string solverName)
static bool HasStationaryRelevantCosts(UlsProblem problem)
static int FindNextPositiveDemand(ReadOnlySpan< double > demands, int start)
Builds and validates a zero-backlogging heuristic solution from a set of replenishment cycles.
static UlsSolveResult Build(UlsProblem problem, ReadOnlySpan< int > cycleEnds, string solverName, CancellationToken cancellationToken)
Represents a validated classical uncapacitated lot-sizing problem.
int Horizon
Gets the number of planning periods.
ReadOnlySpan< double > HoldingCosts
Gets end-of-period unit holding costs by period.
ReadOnlySpan< double > Demands
Gets demand by period.
ReadOnlySpan< double > SetupCosts
Gets fixed setup costs by period.
Represents the outcome returned by a ULS solution strategy.
Defines the common strategy contract implemented by every ULS solver.
UlsSolverKind
Identifies the broad family of a ULS solution strategy.