7 public override string FamilyId=>
"glspMacroProductionActivation";
8 public override bool IsEnabled(LotSizingInstance instance,
StandardLotSizingFormulationOptions options){ArgumentNullException.ThrowIfNull(instance);ArgumentNullException.ThrowIfNull(options);
return instance.SupplyChain.WorkCenters.Any(w=>w.SchedulingProfile?.MaximumProducedItemCount is not
null);}
9 protected override ValueTask
BuildFamilyAsync(LotSizingInstance instance,
MathematicalModelBuildContext context,
StandardLotSizingFormulationOptions options,CancellationToken cancellationToken){var (plantId,wc,profile)=
GlspSchedulingData.
GetSchedulingWorkCenter(instance);
foreach(var r
in GlspSchedulingData.
GetRoutings(instance,plantId,wc.Id))
for(
int t=1;t<=instance.PlanningHorizon;t++)
AddBinaryVariable(context,$
"glspMacroProductionActive_r{r.Id}_t{t}",
GlspFormulationVariableKeyFactory.
CreateMacroProductionActivationKey(r.Id,t),
"GLSP positive macro production flag.");
return ValueTask.CompletedTask;}
Provides the shared state required while constructing a solver-independent mathematical model.