3using System.Threading.Tasks;
4using LotSizingDataModel.Core.Relationships;
5using LotSizingDataModel.Instance;
49 LotSizingInstance instance,
52 ArgumentNullException.ThrowIfNull(
55 ArgumentNullException.ThrowIfNull(
59 instance.SupplyChain.ProductionRoutings.Count > 0;
81 LotSizingInstance instance,
84 CancellationToken cancellationToken)
87 instance.PlanningHorizon;
89 if (planningHorizon <= 0)
91 throw new InvalidOperationException(
92 "Production variables cannot be built for an " +
93 "instance with a non-positive planning horizon.");
97 ProductionRouting routing
98 in instance.SupplyChain.ProductionRoutings)
100 cancellationToken.ThrowIfCancellationRequested();
104 throw new InvalidOperationException(
105 "Every production routing must have a " +
106 "strictly positive identifier before the " +
107 "mathematical formulation is built.");
112 period <= planningHorizon;
115 cancellationToken.ThrowIfCancellationRequested();
128 string variableName =
129 $
"x_r{routing.Id}_t{period}";
135 double.PositiveInfinity,
136 $
"Production quantity for routing " +
137 $
"{routing.Id} in period {period}.");
141 return ValueTask.CompletedTask;
Builds stable business-domain keys for mathematical variables and constraints.
string Build()
Builds the immutable domain-key text.
MathematicalDomainKeyBuilder Add(string name, string value)
Adds a text segment.
Provides the shared state required while constructing a solver-independent mathematical model.
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
const string Production
Identifies production-quantity decision variables.
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...
const string Routing
Routing identifier segment.
const string Period
Period index segment.