2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Xml.Serialization;
43 [XmlElement(
"inventoryBalanceRule")]
46 get => _inventoryBalanceRule;
49 ArgumentNullException.ThrowIfNull(value);
51 if (ReferenceEquals(_inventoryBalanceRule, value))
56 _inventoryBalanceRule = value;
68 [XmlElement(
"scheduledReceipt")]
71 get => _scheduledReceipt;
72 set => SetDecisionParameter(
73 ref _scheduledReceipt,
84 [XmlElement(
"safetyStock")]
88 set => SetDecisionParameter(
100 [XmlElement(
"safetyStockViolationCost")]
104 get => _safetyStockViolationCost;
105 set => SetDecisionParameter(
106 ref _safetyStockViolationCost,
120 [XmlElement(
"capacityConstraint")]
123 get => _capacityConstraint;
124 set => SetDecisionParameter(
125 ref _capacityConstraint,
139 [XmlElement(
"additionalCapacity")]
142 get => _additionalCapacity;
143 set => SetDecisionParameter(
144 ref _additionalCapacity,
158 [XmlElement(
"additionalCapacityCost")]
161 get => _additionalCapacityCost;
162 set => SetDecisionParameter(
163 ref _additionalCapacityCost,
177 [XmlElement(
"unitCapacityConsumption")]
180 get => _unitCapacityConsumption;
181 set => SetDecisionParameter(
182 ref _unitCapacityConsumption,
193 [XmlElement(
"setupTime")]
197 set => SetDecisionParameter(
209 [XmlElement(
"fixedSetupCost")]
212 get => _fixedSetupCost;
213 set => SetDecisionParameter(
225 [XmlElement(
"unitUsageCost")]
228 get => _unitUsageCost;
229 set => SetDecisionParameter(
248 in GetDecisionParameters())
287 int? expectedHorizon =
null;
291 in GetDecisionParameters())
293 if (expectedHorizon is
null)
302 expectedHorizon.Value)
343 throw new ArgumentOutOfRangeException(
346 "The planning horizon cannot be negative.");
351 in GetDecisionParameters())
389 private void SetDecisionParameter<T>(
395 if (ReferenceEquals(field, value))
401 if (field is not
null)
403 field.PropertyChanged -=
404 OnDecisionParameterPropertyChanged;
410 if (field is not
null)
412 field.PropertyChanged +=
413 OnDecisionParameterPropertyChanged;
417 OnPropertyChanged(propertyName);
430 private IEnumerable<IPlanningHorizonAware>
431 GetDecisionParameters()
487 private void OnDecisionParameterPropertyChanged(
489 PropertyChangedEventArgs e)
500 else if (ReferenceEquals(
507 else if (ReferenceEquals(
513 else if (ReferenceEquals(
519 else if (ReferenceEquals(
526 else if (ReferenceEquals(
533 else if (ReferenceEquals(sender,
SetupTime))
Base class for model objects that notify listeners when one of their properties changes.
Represents the unit cost incurred when the inventory level falls below the required safety-stock leve...
Represents the inventory of an item in a warehouse.
SetupTime? SetupTime
Gets or sets the capacity consumed to prepare the warehouse storage resource for this item.
int PlanningHorizon
Gets the planning horizon represented by the first active period-dependent parameter.
UnitCapacityConsumption? UnitCapacityConsumption
Gets or sets the storage capacity consumed by one unit of the item.
void ClearDecisionParameters()
Removes all optional decision-model parameters.
AdditionalCapacity? AdditionalCapacity
Gets or sets the maximum additional storage capacity available specifically for this item.
FixedSetupCost? FixedSetupCost
Gets or sets the fixed preparation cost associated with storing this item.
bool HasConsistentPlanningHorizon
Gets a value indicating whether all active parameters use the same planning horizon.
SafetyStock? SafetyStock
Gets or sets the required safety-stock level for each planning period.
bool HasDecisionParameters
Gets a value indicating whether at least one optional decision-model parameter is active.
AdditionalCapacityCost? AdditionalCapacityCost
Gets or sets the cost of using one unit of additional storage capacity for this item.
bool HasValidDecisionConfiguration
Gets a value indicating whether the direct dependencies between the inventory parameters are respecte...
InventoryBalanceRule InventoryBalanceRule
Gets or sets the inventory-balance rule.
SafetyStockViolationCost? SafetyStockViolationCost
Gets or sets the cost incurred for each unit missing from the required safety-stock level.
UnitUsageCost? UnitUsageCost
Gets or sets the cost of storing one unit of the item during each planning period.
ScheduledReceipt? ScheduledReceipt
Gets or sets the quantities from orders already in progress and expected to be received during the pl...
CapacityConstraint? CapacityConstraint
Gets or sets the maximum storage capacity reserved for this item during each planning period.
void ResizeTimeSeries(int periodCount)
Resizes every active period-dependent parameter.
Defines a model object containing data indexed by planning period.
int PlanningHorizon
Gets the number of planning periods currently represented by the object's time-dependent data.
void ResizeTimeSeries(int periodCount)
Resizes every time-dependent series contained in the object.