4using System.Threading.Tasks;
5using LotSizingDataModel.Core.Querying;
6using LotSizingDataModel.Core.Relationships;
7using LotSizingDataModel.Instance;
25 LotSizingInstance instance,
28 ArgumentNullException.ThrowIfNull(instance);
29 ArgumentNullException.ThrowIfNull(options);
31 return options.IncludeResourceActivation &&
35 entry.WorkCenter.FixedUsageCost is not
null &&
36 entry.WorkCenter.CapacityConstraint is not
null);
41 LotSizingInstance instance,
44 CancellationToken cancellationToken)
46 var queries =
new SupplyChainQueries(instance.SupplyChain);
49 .EnumerateWorkCenters(instance.SupplyChain))
51 if (entry.WorkCenter.FixedUsageCost is
null ||
52 entry.WorkCenter.CapacityConstraint is
null)
57 for (
int period = 1; period <= instance.PlanningHorizon; period++)
59 cancellationToken.ThrowIfCancellationRequested();
63 foreach (ProductionRouting routing
64 in instance.SupplyChain.ProductionRoutings)
67 routing.WorkCenters.FirstOrDefault(candidate =>
68 candidate.PlantId == entry.PlantId &&
69 candidate.WorkCenterId == entry.WorkCenter.Id);
71 if (reference is
null)
76 ProductionCharacteristic characteristic =
77 queries.GetRequiredProductionCharacteristic(
85 characteristic.UnitCapacityConsumption?[period] ?? 1.0);
88 string activationKey =
99 context.GetVariable(activationKey),
100 entry.WorkCenter.CapacityConstraint[period]);
104 $
"workCenterActivationLink_p{entry.PlantId}" +
105 $
"_w{entry.WorkCenter.Id}_t{period}",
110 "Work-center production load requires activation.");
114 return ValueTask.CompletedTask;
Provides a fluent builder for linear expressions.
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 WorkCenterActivation
Identifies work-center activation decision variables.
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...
const string Plant
Plant identifier segment.
const string WorkCenter
Work-center identifier segment.
const string Period
Period index segment.
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.