3using LotSizingDataModel.Core.PhysicalModel;
4using LotSizingDataModel.Solution;
5using LotSizingDataModel.Solution.Decisions;
51 LotSizingSolution solution,
55 ArgumentNullException.ThrowIfNull(
58 ArgumentNullException.ThrowIfNull(
61 ArgumentNullException.ThrowIfNull(
64 ArgumentNullException.ThrowIfNull(
75 WarehouseReference warehouse =
79 InventoryDecision? decision =
80 solution.InventoryDecisions
85 existing.Warehouse.Kind ==
87 existing.Warehouse.ReferenceId ==
88 warehouse.ReferenceId);
92 if (solution.PlanningHorizon <= 0)
94 throw new InvalidOperationException(
95 "The target lot-sizing solution must have a " +
96 "strictly positive planning horizon before " +
97 "inventory setup decisions are mapped.");
101 new InventoryDecision(
104 solution.PlanningHorizon);
106 solution.AddInventoryDecision(
110 decision.SetSetupActivated(
112 variableValue.
Value >
116 private static WarehouseReference ResolveWarehouse(
119 bool hasStandaloneWarehouse =
122 out
int warehouseId);
124 bool hasPlantWarehouse =
129 if (hasStandaloneWarehouse ==
132 throw new InvalidOperationException(
133 "An inventory-setup domain key must identify " +
134 "exactly one warehouse using either 'warehouse' " +
138 if (hasStandaloneWarehouse)
140 return WarehouseReference
141 .ForStandaloneWarehouse(
145 return WarehouseReference
Stores the value returned by a solver for one mathematical decision variable.
double Value
Gets or sets the value returned by the solver.
Maps mathematical inventory-setup values to item-specific inventory setup decisions in a lot-sizing s...
override string Category
Gets the mathematical domain-key category handled by this mapper.
override void MapValue(MathematicalSolutionMappingContext context, LotSizingSolution solution, MathematicalDomainKey domainKey, MathematicalVariableValue variableValue)
Maps one non-zero inventory-setup value.
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
const string InventorySetup
Identifies inventory setup decision variables.
Provides a reusable base implementation for mathematical decision mappers handling one domain-key cat...
virtual double ZeroTolerance
Gets the absolute tolerance below which a solver value is considered equal to zero.
Represents a parsed mathematical-model business-domain key.
int GetRequiredInt32(string name)
Gets a required integer segment.
bool TryGetInt32(string name, out int value)
Attempts to get an integer segment.
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...
const string Plant
Plant identifier segment.
const string Item
Item or product identifier segment.
const string Period
Period index segment.
const string Warehouse
Warehouse identifier segment.
Provides the shared state and lookup services required while mapping a mathematical solver result bac...