2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Xml.Serialization;
33 [XmlElement(
"capacityConstraint")]
36 get => _capacityConstraint;
37 set => SetDecisionParameter(
38 ref _capacityConstraint,
49 [XmlElement(
"additionalCapacity")]
52 get => _additionalCapacity;
53 set => SetDecisionParameter(
54 ref _additionalCapacity,
65 [XmlElement(
"fixedUsageCost")]
68 get => _fixedUsageCost;
69 set => SetDecisionParameter(
81 [XmlElement(
"additionalCapacityCost")]
84 get => _additionalCapacityCost;
85 set => SetDecisionParameter(
86 ref _additionalCapacityCost,
104 in GetDecisionParameters())
134 int? expectedHorizon =
null;
138 in GetDecisionParameters())
140 if (expectedHorizon is
null)
149 expectedHorizon.Value)
183 throw new ArgumentOutOfRangeException(
186 "The planning horizon cannot be negative.");
191 in GetDecisionParameters())
216 private void SetDecisionParameter<T>(
222 if (ReferenceEquals(field, value))
228 if (field is not
null)
230 field.PropertyChanged -=
231 OnDecisionParameterPropertyChanged;
237 if (field is not
null)
239 field.PropertyChanged +=
240 OnDecisionParameterPropertyChanged;
253 private IEnumerable<IPlanningHorizonAware>
254 GetDecisionParameters()
277 private void OnDecisionParameterPropertyChanged(
279 PropertyChangedEventArgs e)
294 else if (ReferenceEquals(
Base class for model objects that notify listeners when one of their properties changes.
virtual void OnPropertyChanged([CallerMemberName] string? propertyName=null)
Raises the PropertyChanged event.
Represents a warehouse in the supply chain.
AdditionalCapacity? AdditionalCapacity
Gets or sets the maximum additional storage capacity that may be allocated to the warehouse.
bool HasValidCapacityConfiguration
Gets a value indicating whether the dependencies between the warehouse-capacity parameters are respec...
FixedUsageCost? FixedUsageCost
Gets or sets the fixed cost incurred when the warehouse is used during a planning period.
int PlanningHorizon
Gets the planning horizon represented by the first active period-dependent parameter.
bool HasDecisionParameters
Gets a value indicating whether the warehouse contains at least one global decision-model parameter.
CapacityConstraint? CapacityConstraint
Gets or sets the maximum global storage capacity of the warehouse during each planning period.
void ClearDecisionParameters()
Removes all global decision-model parameters from the warehouse.
AdditionalCapacityCost? AdditionalCapacityCost
Gets or sets the cost of using one unit of global additional warehouse capacity.
void ResizeTimeSeries(int periodCount)
Resizes every active period-dependent warehouse parameter.
bool HasConsistentPlanningHorizon
Gets a value indicating whether all active parameters use the same planning horizon.
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.