3using LotSizingDataModel.Core.PhysicalModel;
4using LotSizingDataModel.Solution;
5using LotSizingDataModel.Solution.Decisions;
52 LotSizingSolution solution,
56 ArgumentNullException.ThrowIfNull(
59 ArgumentNullException.ThrowIfNull(
62 ArgumentNullException.ThrowIfNull(
65 ArgumentNullException.ThrowIfNull(
72 int transportResourceId =
80 WarehouseReference origin =
87 WarehouseReference destination =
94 TransportDecision? decision =
95 solution.TransportDecisions
104 if (decision is
null)
106 if (solution.PlanningHorizon <= 0)
108 throw new InvalidOperationException(
109 "The target lot-sizing solution must have a " +
110 "strictly positive planning horizon before " +
111 "transport decisions are mapped.");
115 new TransportDecision(
120 solution.PlanningHorizon);
122 solution.AddTransportDecision(
126 decision.SetAdditionalCapacityUsed(
128 variableValue.
Value);
131 private static WarehouseReference ResolveWarehouse(
133 string warehouseSegment,
137 bool hasStandaloneWarehouse =
140 out
int warehouseId);
142 bool hasPlantWarehouse =
147 if (hasStandaloneWarehouse ==
150 throw new InvalidOperationException(
151 $
"A transport additional-capacity domain key " +
152 $
"must identify exactly one {role} warehouse " +
153 $
"using either '{warehouseSegment}' or " +
154 $
"'{plantSegment}'.");
157 if (hasStandaloneWarehouse)
159 return WarehouseReference
160 .ForStandaloneWarehouse(
164 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 TransportAdditionalCapacity
Identifies item-specific additional transport-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 TransportResource
Transport-resource identifier segment.
const string Item
Item or product identifier segment.
const string DestinationWarehouse
Standalone destination-warehouse identifier segment.
const string OriginPlant
Origin-plant identifier segment.
const string DestinationPlant
Destination-plant identifier segment.
const string Period
Period index segment.
const string OriginWarehouse
Standalone origin-warehouse identifier segment.
Provides the shared state and lookup services required while mapping a mathematical solver result bac...
Maps mathematical item-specific additional transport-capacity values to transport decisions in a lot-...
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 item-specific additional transport capacity value.