1using LotSizingDataModel.Core.DecisionModel.Scheduling;
2using LotSizingDataModel.Core.Relationships;
3using LotSizingDataModel.Instance;
14 ArgumentNullException.ThrowIfNull(instance);ArgumentNullException.ThrowIfNull(options);
15 return instance.SupplyChain.ProductionRoutings.Any(r=>r.GroupingConstraint is not
null);
19 ProductionSchedulingProfile profile=instance.SupplyChain.WorkCenters.Single(w=>w.SchedulingProfile is not
null).SchedulingProfile!;
20 foreach(ProductionRouting routing
in instance.SupplyChain.ProductionRoutings)
22 if(routing.GroupingConstraint is
null)
continue;
23 for(
int setupPeriod=1;setupPeriod<=instance.PlanningHorizon;setupPeriod++)
25 int spacing=routing.GroupingConstraint.GetGroupingPeriodCount(setupPeriod);
26 int last=Math.Min(instance.PlanningHorizon,setupPeriod+spacing-1);
27 for(
int forbidden=setupPeriod+1;forbidden<=last;forbidden++)
29 AddConstraint(context,$
"smallBucketGrouping_r{routing.Id}_t{setupPeriod}_k{forbidden}",
37 return ValueTask.CompletedTask;
Provides a fluent builder for linear expressions.
LinearExpressionBuilder Add(MathematicalVariable variable, double coefficient=1.0)
Adds a variable term to the expression.
LinearExpression Build(bool clone=true)
Builds and validates the linear expression.
Provides the shared state required while constructing a solver-independent mathematical model.
static string CreateSetupStartKey(ProductionSchedulingProfile profile, ProductionRouting routing, int period)
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.