2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Xml.Serialization;
35 [XmlElement(
"capacityConstraint")]
38 get => _capacityConstraint;
39 set => SetDecisionParameter(
40 ref _capacityConstraint,
52 [XmlElement(
"additionalCapacity")]
55 get => _additionalCapacity;
56 set => SetDecisionParameter(
57 ref _additionalCapacity,
66 [XmlElement(
"additionalCapacityCost")]
69 get => _additionalCapacityCost;
70 set => SetDecisionParameter(
71 ref _additionalCapacityCost,
80 [XmlElement(
"unitCapacityConsumption")]
83 get => _unitCapacityConsumption;
84 set => SetDecisionParameter(
85 ref _unitCapacityConsumption,
94 [XmlElement(
"setupTime")]
98 set => SetDecisionParameter(
108 [XmlElement(
"fixedSetupCost")]
111 get => _fixedSetupCost;
112 set => SetDecisionParameter(
122 [XmlElement(
"unitUsageCost")]
125 get => _unitUsageCost;
126 set => SetDecisionParameter(
145 in GetDecisionParameters())
178 int? expectedHorizon =
null;
182 in GetDecisionParameters())
184 if (expectedHorizon is
null)
193 expectedHorizon.Value)
227 throw new ArgumentOutOfRangeException(
230 "The planning horizon cannot be negative.");
235 in GetDecisionParameters())
262 private void SetDecisionParameter<T>(
268 if (ReferenceEquals(field, value))
274 if (field is not
null)
276 field.PropertyChanged -=
277 OnDecisionParameterPropertyChanged;
283 if (field is not
null)
285 field.PropertyChanged +=
286 OnDecisionParameterPropertyChanged;
299 private IEnumerable<IPlanningHorizonAware>
300 GetDecisionParameters()
338 private void OnDecisionParameterPropertyChanged(
340 PropertyChangedEventArgs e)
351 else if (ReferenceEquals(
358 else if (ReferenceEquals(
365 else if (ReferenceEquals(sender,
SetupTime))
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 the transport characteristics of an item for a specific transport resource.
void ResizeTimeSeries(int periodCount)
Resizes every active period-dependent parameter.
UnitUsageCost? UnitUsageCost
Gets or sets the cost of transporting one unit of the item during each planning period.
FixedSetupCost? FixedSetupCost
Gets or sets the fixed cost incurred when the transport resource is prepared for this item.
int PlanningHorizon
Gets the planning horizon represented by the first active period-dependent parameter.
AdditionalCapacity? AdditionalCapacity
Gets or sets the maximum additional transport capacity available specifically for this item.
SetupTime? SetupTime
Gets or sets the capacity consumed to prepare the transport resource for this item during each planni...
bool HasValidDecisionConfiguration
Gets a value indicating whether the dependencies between the transport parameters are respected.
CapacityConstraint? CapacityConstraint
Gets or sets the maximum transport capacity available specifically for this item during each planning...
void ClearDecisionParameters()
Removes all optional decision-model parameters from this transport characteristic.
UnitCapacityConsumption? UnitCapacityConsumption
Gets or sets the transport capacity consumed by one unit of the item during each planning period.
AdditionalCapacityCost? AdditionalCapacityCost
Gets or sets the unit cost of additional transport capacity allocated to this item.
bool HasConsistentPlanningHorizon
Gets a value indicating whether all active parameters use the same planning horizon.
bool HasDecisionParameters
Gets a value indicating whether at least one decision-model parameter is active.
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.