LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
SmallBucketProductionActivationVariableFamilyBuilder.cs
Go to the documentation of this file.
1using LotSizingDataModel.Instance;
4
6
7/// <summary>
8/// Mathematical-only small-bucket production activation variables.
9/// </summary>
12{
13 public override string FamilyId =>
14 "smallBucketProductionActivation";
15
16 protected override ValueTask BuildFamilyAsync(
17 LotSizingInstance instance,
20 CancellationToken cancellationToken)
21 {
22 foreach (
23 var routing
24 in instance.SupplyChain.ProductionRoutings)
25 {
26 for (
27 int period = 1;
28 period <= instance.PlanningHorizon;
29 period++)
30 {
31 cancellationToken.ThrowIfCancellationRequested();
32
33 string key =
36 .AuxiliarySmallBucketProductionActivation)
37 .Add(
39 routing.Id)
40 .Add(
42 period)
43 .Build();
44
46 context,
47 $"smallBucketProductionActive_r{routing.Id}_t{period}",
48 key,
49 "Mathematical-only small-bucket positive-production flag.");
50 }
51 }
52
53 return ValueTask.CompletedTask;
54 }
55}
Builds stable business-domain keys for mathematical variables and constraints.
MathematicalDomainKeyBuilder Add(string name, string value)
Adds a text segment.
Provides the shared state required while constructing a solver-independent mathematical model.
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.
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...