LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
StandardLotSizingFormulationOptions.cs
Go to the documentation of this file.
1using System;
2
4
5/// <summary>
6/// Configures the standard solver-independent mixed-integer
7/// lot-sizing formulation.
8/// </summary>
10{
11 /// <summary>Gets or sets whether production setups are included.</summary>
12 public bool IncludeProductionSetups { get; set; } = true;
13
14 /// <summary>Gets or sets whether backlog is included.</summary>
15 public bool IncludeBacklog { get; set; } = true;
16
17 /// <summary>Gets or sets whether shortages are included.</summary>
18 public bool IncludeShortage { get; set; } = true;
19
20 /// <summary>Gets or sets whether procurement is included.</summary>
21 public bool IncludeProcurement { get; set; } = true;
22
23 /// <summary>Gets or sets whether transport is included.</summary>
24 public bool IncludeTransport { get; set; } = true;
25
26 /// <summary>Gets or sets whether transport setups are included.</summary>
27 public bool IncludeTransportSetups { get; set; } = true;
28
29 /// <summary>Gets or sets whether additional capacities are included.</summary>
30 public bool IncludeAdditionalCapacity { get; set; } = true;
31
32 /// <summary>Gets or sets whether resource activations are included.</summary>
33 public bool IncludeResourceActivation { get; set; } = true;
34
35 /// <summary>Gets or sets whether safety-stock constraints are included.</summary>
36 public bool IncludeSafetyStock { get; set; } = true;
37
38 /// <summary>Gets or sets whether safety-stock violations are allowed.</summary>
39 public bool IncludeSafetyStockViolation { get; set; } = true;
40
41 /// <summary>Gets or sets whether BOM relations are included.</summary>
42 public bool IncludeBillOfMaterials { get; set; } = true;
43
44 /// <summary>Gets or sets whether structurally zero variables are omitted.</summary>
45 public bool RemoveStructurallyZeroVariables { get; set; } = true;
46
47 /// <summary>Gets or sets the structural zero tolerance.</summary>
48 public double StructuralZeroTolerance { get; set; } = 1e-12;
49
50 /// <summary>
51 /// Gets or sets whether production/setup Big-M values are
52 /// estimated automatically from the instance structure.
53 /// </summary>
54 public bool UseAutomaticProductionSetupBigM { get; set; } = true;
55
56 /// <summary>
57 /// Gets or sets the fallback Big-M used when the automatic
58 /// estimator cannot establish a finite structural bound, or
59 /// the fixed Big-M when automatic estimation is disabled.
60 /// </summary>
61 /// <remarks>
62 /// This property is preserved for backward compatibility.
63 /// It is no longer the normal Big-M used by every production
64 /// setup-link constraint.
65 /// </remarks>
66 public double ProductionSetupBigM { get; set; } = 1e6;
67
68 /// <summary>Explicit quantity bound for transport activation when capacities cannot establish one. No implicit fallback is used.</summary>
69 public double? TransportActivationBigM { get; set; }
70
71 /// <summary>Creates an independent copy.</summary>
73 {
74 return (StandardLotSizingFormulationOptions)MemberwiseClone();
75 }
76
77 /// <summary>Validates the option values.</summary>
78 public void EnsureValid()
79 {
80 if (!double.IsFinite(StructuralZeroTolerance) ||
82 {
83 throw new InvalidOperationException(
84 "The structural zero tolerance must be finite and non-negative.");
85 }
86
87 if (!double.IsFinite(ProductionSetupBigM) ||
89 {
90 throw new InvalidOperationException(
91 "ProductionSetupBigM must be finite and strictly positive.");
92 }
93
94 if (TransportActivationBigM is double transportBound && (!double.IsFinite(transportBound) || transportBound <= 0))
95 throw new InvalidOperationException("TransportActivationBigM must be finite and strictly positive when supplied.");
96
98 {
99 throw new InvalidOperationException(
100 "Transport setups cannot be enabled when transport is disabled.");
101 }
102
104 {
105 throw new InvalidOperationException(
106 "Safety-stock violations cannot be enabled when safety stock is disabled.");
107 }
108 }
109}
Configures the standard solver-independent mixed-integer lot-sizing formulation.
bool IncludeResourceActivation
Gets or sets whether resource activations are included.
double ProductionSetupBigM
Gets or sets the fallback Big-M used when the automatic estimator cannot establish a finite structura...
bool IncludeSafetyStockViolation
Gets or sets whether safety-stock violations are allowed.
double? TransportActivationBigM
Explicit quantity bound for transport activation when capacities cannot establish one....
StandardLotSizingFormulationOptions Clone()
Creates an independent copy.
bool IncludeSafetyStock
Gets or sets whether safety-stock constraints are included.
bool RemoveStructurallyZeroVariables
Gets or sets whether structurally zero variables are omitted.
bool IncludeAdditionalCapacity
Gets or sets whether additional capacities are included.
bool UseAutomaticProductionSetupBigM
Gets or sets whether production/setup Big-M values are estimated automatically from the instance stru...