3using LotSizingDataModel.Core.PhysicalModel;
4using LotSizingDataModel.Solution;
5using LotSizingDataModel.Solution.Decisions;
49 LotSizingSolution solution,
53 ArgumentNullException.ThrowIfNull(
56 ArgumentNullException.ThrowIfNull(
59 ArgumentNullException.ThrowIfNull(
62 ArgumentNullException.ThrowIfNull(
73 WarehouseReference warehouse =
77 InventoryDecision? decision =
78 solution.InventoryDecisions
83 existing.Warehouse.Kind ==
85 existing.Warehouse.ReferenceId ==
86 warehouse.ReferenceId);
91 new InventoryDecision(
94 solution.PlanningHorizon);
96 solution.AddInventoryDecision(
102 variableValue.
Value);
105 private static WarehouseReference ResolveWarehouse(
108 bool hasStandaloneWarehouse =
111 out
int warehouseId);
113 bool hasPlantWarehouse =
118 if (hasStandaloneWarehouse ==
121 throw new InvalidOperationException(
122 "An inventory domain key must identify exactly " +
123 "one warehouse using either 'warehouse' or " +
127 if (hasStandaloneWarehouse)
129 return WarehouseReference
130 .ForStandaloneWarehouse(
134 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-variable values to inventory decisions in a lot-sizing solution.
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 value.
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
const string Inventory
Identifies inventory-level decision variables.
Provides a reusable base implementation for mathematical decision mappers handling one domain-key cat...
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...