LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
SmallBucketSetupStartVariableFamilyBuilder.cs
Go to the documentation of this file.
1using LotSizingDataModel.Core.DecisionModel.Scheduling;
2using LotSizingDataModel.Instance;
4
6
9{
10 public override string FamilyId => "smallBucketSetupStart";
11
12 protected override ValueTask BuildFamilyAsync(
13 LotSizingInstance instance,
16 CancellationToken cancellationToken)
17 {
18 ProductionSchedulingProfile profile =
19 instance.SupplyChain.WorkCenters
20 .Single(workCenter => workCenter.SchedulingProfile is not null)
21 .SchedulingProfile!;
22
23 foreach (var routing in instance.SupplyChain.ProductionRoutings)
24 {
25 for (int period = 1; period <= instance.PlanningHorizon; period++)
26 {
27 cancellationToken.ThrowIfCancellationRequested();
29 context,
30 $"smallBucketSetupStart_r{routing.Id}_t{period}",
32 profile, routing, period),
33 "Mathematical-only small-bucket setup-start occurrence.");
34 }
35 }
36
37 return ValueTask.CompletedTask;
38 }
39}
Provides the shared state required while constructing a solver-independent mathematical model.
static string CreateSetupStartKey(ProductionSchedulingProfile profile, ProductionRouting routing, int period)
override ValueTask BuildFamilyAsync(LotSizingInstance instance, MathematicalModelBuildContext context, StandardLotSizingFormulationOptions options, CancellationToken cancellationToken)
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.