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.SetActivated(
103 variableValue.
Value >
107 private static WarehouseReference ResolveWarehouse(
110 bool hasStandaloneWarehouse =
113 out
int warehouseId);
115 bool hasPlantWarehouse =
120 if (hasStandaloneWarehouse ==
123 throw new InvalidOperationException(
124 "A warehouse-activation domain key must identify " +
125 "exactly one warehouse using either 'warehouse' " +
129 if (hasStandaloneWarehouse)
131 return WarehouseReference
132 .ForStandaloneWarehouse(
136 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 WarehouseActivation
Identifies warehouse activation 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 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 warehouse-activation values to warehouse capacity decisions in a lot-sizing solutio...
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 warehouse activation value.