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(
71 WarehouseReference warehouse =
75 WarehouseCapacityDecision? decision =
76 solution.WarehouseCapacityDecisions
84 if (solution.PlanningHorizon <= 0)
86 throw new InvalidOperationException(
87 "The target lot-sizing solution must have a " +
88 "strictly positive planning horizon before " +
89 "warehouse capacity decisions are mapped.");
93 new WarehouseCapacityDecision(
95 solution.PlanningHorizon);
97 solution.AddWarehouseCapacityDecision(
101 decision.SetAdditionalCapacityUsed(
103 variableValue.
Value);
106 private static WarehouseReference ResolveWarehouse(
109 bool hasStandaloneWarehouse =
112 out
int warehouseId);
114 bool hasPlantWarehouse =
119 if (hasStandaloneWarehouse ==
122 throw new InvalidOperationException(
123 "A warehouse additional-capacity domain key must " +
124 "identify exactly one warehouse using either " +
125 "'warehouse' or 'plant'.");
128 if (hasStandaloneWarehouse)
130 return WarehouseReference
131 .ForStandaloneWarehouse(
135 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.
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
const string WarehouseAdditionalCapacity
Identifies additional warehouse-capacity 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 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...
Maps mathematical additional warehouse-capacity values to warehouse capacity decisions in a lot-sizin...
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 additional warehouse-capacity value.