21 public string Name =>
"Periodic Order Quantity";
30 ArgumentNullException.ThrowIfNull(problem);
33 "Periodic Order Quantity");
41 problem.TotalDemand / problem.
Horizon;
48 if (holdingCost == 0.0)
58 var continuousInterval =
61 (holdingCost * averageDemand));
63 var interval = (int)Math.Round(
65 MidpointRounding.AwayFromZero);
67 return Math.Clamp(interval, 1, problem.
Horizon);
72 CancellationToken cancellationToken =
default)
74 ArgumentNullException.ThrowIfNull(problem);
75 cancellationToken.ThrowIfCancellationRequested();
79 var buffer = ArrayPool<int>.Shared.Rent(horizon);
83 var cycleEnds = buffer.AsSpan(0, horizon);
92 while (start < horizon)
94 cancellationToken.ThrowIfCancellationRequested();
99 start + interval - 1);
101 cycleEnds[start] = end;
116 ArrayPool<int>.Shared.Return(buffer, clearArray:
false);
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)
Implements the classical Periodic Order Quantity (POQ) rule.
static int GetOrderInterval(UlsProblem problem)
string Name
Gets the stable human-readable name of the solver.
static bool IsApplicable(UlsProblem problem)
UlsSolverKind Kind
Gets the broad family of the solver.
UlsSolveResult Solve(UlsProblem problem, CancellationToken cancellationToken=default)
Solves an uncapacitated lot-sizing problem.
Represents a validated classical uncapacitated lot-sizing problem.
double TotalDemand
Gets the total demand over the complete planning horizon.
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.