LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
SmallBucketSetupStateVariableFamilyBuilder.cs
Go to the documentation of this file.
1using LotSizingDataModel.Instance;
4
6
7/// <summary>
8/// Binary routing setup-state variables for executable small-bucket models.
9/// </summary>
12{
13 public override string FamilyId =>
14 "smallBucketSetupState";
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 .Add(
38 routing.Id)
39 .Add(
41 period)
42 .Build();
43
45 context,
46 $"smallBucketSetupState_r{routing.Id}_t{period}",
47 key,
48 "Persistent small-bucket setup state.");
49 }
50 }
51
52 return ValueTask.CompletedTask;
53 }
54}
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...
const string Setup
Identifies production setup decision variables.
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...