1using LotSizingDataModel.Core.DecisionModel.Scheduling;
2using LotSizingDataModel.Core.Relationships;
3using LotSizingDataModel.Instance;
21 LotSizingInstance instance,
24 CancellationToken cancellationToken)
26 var (plantId,wc,profile) =
29 IReadOnlyList<ProductionRouting> routings =
36 profile.EnumerateMicroPeriods().ToArray();
39 period<=instance.PlanningHorizon;
52 if(micro.MacroPeriod!=period)
69 foreach(ProductionRouting routing
in routings)
71 ProductionCharacteristic characteristic =
87 characteristic.UnitCapacityConsumption![period]);
90 characteristic.SetupTime?[period] ?? 0.0;
109 characteristic.StartUpTime?[period] ?? 0.0;
128 foreach(ProductionRouting from
in routings)
129 foreach(ProductionRouting to
in routings)
131 if(from.ItemId==to.ItemId)
152 double changeoverTime =
156 to.ItemId)?.ChangeoverTime?[period] ?? 0.0;
158 if(changeoverTime>0.0)
167 string additionalKey =
178 additional is not
null)
180 expression.Subtract(additional);
185 $
"glspMacroCapacity_p{plantId}_w{wc.Id}_t{period}",
188 wc.CapacityConstraint![period]);
191 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.
MathematicalModel Build(bool clone=true)
Builds and validates the mathematical model.
MathematicalVariableRegistry VariableRegistry
Gets the registry that maps business-domain keys to mathematical variables.
bool TryGet(string domainKey, out MathematicalVariable? variable)
Attempts to get the variable registered for a domain key.
Builds canonical mathematical domain keys for production start-up events.
static string CreateGlspKey(int plantId, int workCenterId, int routingId, int itemId, ProductionMicroPeriodReference microPeriod, int fixedPredecessorItemId, bool resetBoundary)
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
const string WorkCenterAdditionalCapacity
Identifies additional work-center-capacity 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.
Represents one decision variable in a mathematical optimization model.
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.