LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
Inventory.HistoricalSemantics.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
3
5
6/// <summary>
7/// Specifies how the stock before period 1 is treated by the optimization model.
8/// </summary>
10{
11 /// <summary>
12 /// <see cref="Inventory.InitialInventory"/> is a fixed input parameter.
13 /// This preserves the historical LotSizingDataModel behavior.
14 /// </summary>
16
17 /// <summary>
18 /// Initial inventory is an explicit non-negative optimization decision.
19 /// The fixed <see cref="Inventory.InitialInventory"/> value must then be zero.
20 /// </summary>
22
23 /// <summary>
24 /// No initial-inventory decision exists and the initial stock is fixed to zero.
25 /// </summary>
27}
28
29/// <summary>
30/// Adds explicit initial-stock decision semantics to <see cref="Inventory"/>.
31/// </summary>
32/// <remarks>
33/// The distinction is generic and is not named after a historical classification.
34/// It permits an exact projection of Wolsey's DLSI/DLS distinction without treating
35/// an acronym as model evidence.
36/// </remarks>
37public sealed partial class Inventory
38{
39 private InitialInventoryDecisionMode _initialInventoryDecisionMode =
40 InitialInventoryDecisionMode.FixedParameter;
41
42 private double _initialInventoryDecisionUnitCost;
43
44 /// <summary>
45 /// Gets or sets whether initial inventory is fixed, a decision, or absent/fixed zero.
46 /// </summary>
47 [XmlAttribute("initialInventoryDecisionMode")]
49 {
50 get => _initialInventoryDecisionMode;
51 set => SetProperty(ref _initialInventoryDecisionMode, value);
52 }
53
54 /// <summary>
55 /// Gets or sets the unit cost applied to an initial-inventory decision.
56 /// </summary>
57 /// <remarks>
58 /// This coefficient corresponds to the period-zero stock coefficient when the
59 /// initial stock is a decision variable. It is ignored for fixed/absent modes.
60 /// </remarks>
61 [XmlAttribute("initialInventoryDecisionUnitCost")]
63 {
64 get => _initialInventoryDecisionUnitCost;
65 set
66 {
67 if (!double.IsFinite(value) || value < 0.0)
68 {
69 throw new ArgumentOutOfRangeException(
70 nameof(value),
71 value,
72 "The initial-inventory decision unit cost must be finite and non-negative.");
73 }
74
75 SetProperty(ref _initialInventoryDecisionUnitCost, value);
76 }
77 }
78
79 /// <summary>
80 /// Gets whether the initial-inventory semantics are internally coherent.
81 /// </summary>
82 [XmlIgnore]
85 InitialInventory == 0.0;
86}
bool HasValidInitialInventoryDecisionSemantics
Gets whether the initial-inventory semantics are internally coherent.
double InitialInventory
Gets or sets the initial inventory level.
Definition Inventory.cs:164
InitialInventoryDecisionMode InitialInventoryDecisionMode
Gets or sets whether initial inventory is fixed, a decision, or absent/fixed zero.
double InitialInventoryDecisionUnitCost
Gets or sets the unit cost applied to an initial-inventory decision.
InitialInventoryDecisionMode
Specifies how the stock before period 1 is treated by the optimization model.
@ FixedParameter
Inventory.InitialInventory is a fixed input parameter. This preserves the historical LotSizingDataMod...
@ VariableDecision
Initial inventory is an explicit non-negative optimization decision. The fixed Inventory....
@ AbsentFixedZero
No initial-inventory decision exists and the initial stock is fixed to zero.