LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
GlspMicroSetupStateVariableFamilyBuilder.cs
Go to the documentation of this file.
1using LotSizingDataModel.Core.Relationships;
2using LotSizingDataModel.Instance;
4
6
9{
10 public override string FamilyId => "glspMicroSetupState";
11
12 protected override ValueTask BuildFamilyAsync(
13 LotSizingInstance instance,
16 CancellationToken cancellationToken)
17 {
18 (int plantId, var workCenter, var profile) =
20 IReadOnlyList<ProductionRouting> routings =
21 GlspSchedulingData.GetRoutings(instance, plantId, workCenter.Id);
22
23 foreach (var microPeriod in profile.EnumerateMicroPeriods())
24 {
25 foreach (ProductionRouting routing in routings)
26 {
27 cancellationToken.ThrowIfCancellationRequested();
29 context,
30 $"glspY_r{routing.Id}_t{microPeriod.MacroPeriod}_s{microPeriod.MicroPeriodIndex}",
32 plantId, workCenter.Id, routing.Id, routing.ItemId, microPeriod),
33 "GLSP setup state active in one micro-period.");
34 }
35 }
36
37 return ValueTask.CompletedTask;
38 }
39}
Provides the shared state required while constructing a solver-independent mathematical model.
static string CreateMicroSetupStateKey(int plantId, int workCenterId, int routingId, int itemId, ProductionMicroPeriodReference microPeriod)
override ValueTask BuildFamilyAsync(LotSizingInstance instance, MathematicalModelBuildContext context, StandardLotSizingFormulationOptions options, CancellationToken cancellationToken)
static int WorkCenter ProductionSchedulingProfile Profile GetSchedulingWorkCenter(LotSizingInstance instance)
static IReadOnlyList< ProductionRouting > GetRoutings(LotSizingInstance instance, int plantId, int workCenterId)
Configures the standard solver-independent mixed-integer lot-sizing formulation.
Provides common validation and variable-registration helpers for one variable family of the standard ...
static MathematicalVariable AddBinaryVariable(MathematicalModelBuildContext context, string name, string domainKey, string description="")
Creates and registers one binary variable.