2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Xml.Serialization;
31 [XmlElement(
"capacityConstraint")]
34 get => _capacityConstraint;
35 set => SetDecisionParameter(
36 ref _capacityConstraint,
48 [XmlElement(
"additionalCapacity")]
51 get => _additionalCapacity;
52 set => SetDecisionParameter(
53 ref _additionalCapacity,
62 [XmlElement(
"fixedUsageCost")]
65 get => _fixedUsageCost;
66 set => SetDecisionParameter(
79 [XmlElement(
"additionalCapacityCost")]
82 get => _additionalCapacityCost;
83 set => SetDecisionParameter(
84 ref _additionalCapacityCost,
102 in GetDecisionParameters())
132 int? expectedHorizon =
null;
136 in GetDecisionParameters())
138 if (expectedHorizon is
null)
147 expectedHorizon.Value)
181 throw new ArgumentOutOfRangeException(
184 "The planning horizon cannot be negative.");
189 in GetDecisionParameters())
214 private void SetDecisionParameter<T>(
220 if (ReferenceEquals(field, value))
226 if (field is not
null)
228 field.PropertyChanged -=
229 OnDecisionParameterPropertyChanged;
235 if (field is not
null)
237 field.PropertyChanged +=
238 OnDecisionParameterPropertyChanged;
251 private IEnumerable<IPlanningHorizonAware>
252 GetDecisionParameters()
275 private void OnDecisionParameterPropertyChanged(
277 PropertyChangedEventArgs e)
292 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.
A transport resource with its own shared capacities and costs.
void ClearDecisionParameters()
Removes all decision-model parameters from this transport resource.
AdditionalCapacityCost? AdditionalCapacityCost
Gets or sets the cost of using one unit of additional transport capacity during each planning period.
void ResizeTimeSeries(int periodCount)
Resizes every active period-dependent parameter.
int PlanningHorizon
Gets the planning horizon represented by the first active period-dependent parameter.
AdditionalCapacity? AdditionalCapacity
Gets or sets the maximum additional capacity that may be allocated to the transport resource during e...
FixedUsageCost? FixedUsageCost
Gets or sets the fixed cost incurred when the transport resource is used during a planning period.
bool HasConsistentPlanningHorizon
Gets a value indicating whether all active parameters use the same planning horizon.
bool HasValidCapacityConfiguration
Gets a value indicating whether the dependencies between the capacity-related parameters are respecte...
bool HasDecisionParameters
Gets a value indicating whether at least one decision-model parameter is active.
CapacityConstraint? CapacityConstraint
Gets or sets the maximum regular capacity available for the transport resource during each planning p...
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.