2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Xml.Serialization;
36 get => _capacityConstraint;
37 set => SetDecisionParameter(ref _capacityConstraint, value, nameof(
CapacityConstraint));
41 [XmlElement(
"capacityConstraint")]
57 [XmlElement(
"additionalCapacity")]
60 get => _additionalCapacity;
61 set => SetDecisionParameter(
62 ref _additionalCapacity,
73 [XmlElement(
"fixedUsageCost")]
76 get => _fixedUsageCost;
77 set => SetDecisionParameter(
89 [XmlElement(
"additionalCapacityCost")]
92 get => _additionalCapacityCost;
93 set => SetDecisionParameter(
94 ref _additionalCapacityCost,
112 in GetDecisionParameters())
142 int? expectedHorizon =
null;
146 in GetDecisionParameters())
148 if (expectedHorizon is
null)
157 expectedHorizon.Value)
193 throw new ArgumentOutOfRangeException(
196 "The planning horizon cannot be negative.");
203 in GetDecisionParameters())
210 for (
int period = previousCapacityHorizon + 1; period <= periodCount; period++)
234 private void SetDecisionParameter<T>(
240 if (ReferenceEquals(field, value))
246 if (field is not
null)
248 field.PropertyChanged -=
249 OnDecisionParameterPropertyChanged;
255 if (field is not
null)
257 field.PropertyChanged +=
258 OnDecisionParameterPropertyChanged;
271 private IEnumerable<IPlanningHorizonAware>
272 GetDecisionParameters()
295 private void OnDecisionParameterPropertyChanged(
297 PropertyChangedEventArgs e)
312 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.
XML capacity series for work centers and warehouses, with INF for unbounded periods.
static ? ResourceCapacitySeries FromConstraint(CapacityConstraint? constraint)
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.
ResourceCapacitySeries? SerializedCapacity
XML capacity series with INF for unbounded periods.
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.
double? GetStorageCapacity(int period)
Returns the maximum storage capacity, or null when the period is unbounded.
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.