1using LotSizingDataModel.Core.PhysicalModel;
2using LotSizingDataModel.Solution;
3using LotSizingDataModel.Solution.Decisions;
19 LotSizingSolution solution,
23 ArgumentNullException.ThrowIfNull(context);
24 ArgumentNullException.ThrowIfNull(solution);
25 ArgumentNullException.ThrowIfNull(domainKey);
26 ArgumentNullException.ThrowIfNull(variableValue);
32 WarehouseReference warehouse =
33 ResolveWarehouse(domainKey);
35 InventoryDecision? decision =
36 solution.InventoryDecisions.FirstOrDefault(
38 existing.ItemId == itemId &&
39 existing.Warehouse.Kind == warehouse.Kind &&
40 existing.Warehouse.ReferenceId == warehouse.ReferenceId);
45 new InventoryDecision(
48 solution.PlanningHorizon);
50 solution.AddInventoryDecision(decision);
53 decision.InitialInventoryLevel =
57 private static WarehouseReference ResolveWarehouse(
70 if (hasStandalone == hasPlant)
72 throw new InvalidOperationException(
73 "An initial-inventory key must identify exactly one warehouse.");
77 ? WarehouseReference.ForStandaloneWarehouse(warehouseId)
78 : WarehouseReference.ForPlantWarehouse(plantId);
Stores the value returned by a solver for one mathematical decision variable.
double Value
Gets or sets the value returned by the solver.
Maps a mathematical period-zero inventory value to the normalized 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)
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
const string InitialInventory
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 Warehouse
Warehouse identifier segment.
Provides the shared state and lookup services required while mapping a mathematical solver result bac...