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())
133 int? expectedHorizon =
null;
137 in GetDecisionParameters())
139 if (expectedHorizon is
null)
148 expectedHorizon.Value)
181 throw new ArgumentOutOfRangeException(
184 "The planning horizon cannot be negative.");
189 in GetDecisionParameters())
213 private void SetDecisionParameter<T>(
219 if (ReferenceEquals(field, value))
225 if (field is not
null)
227 field.PropertyChanged -=
228 OnDecisionParameterPropertyChanged;
234 if (field is not
null)
236 field.PropertyChanged +=
237 OnDecisionParameterPropertyChanged;
241 OnPropertyChanged(propertyName);
250 private IEnumerable<IPlanningHorizonAware>
251 GetDecisionParameters()
279 private void OnDecisionParameterPropertyChanged(
281 PropertyChangedEventArgs e)
296 else if (ReferenceEquals(
Base class for model objects that notify listeners when one of their properties changes.
Represents a production work center belonging to a plant.
bool HasConsistentPlanningHorizon
Gets a value indicating whether every active parameter uses the same planning horizon.
CapacityConstraint? CapacityConstraint
Gets or sets the maximum regular capacity available during each planning period.
bool HasValidCapacityConfiguration
Gets a value indicating whether the dependencies between capacity-related parameters are respected.
FixedUsageCost? FixedUsageCost
Gets or sets the fixed cost incurred when the work center is used during a planning period.
AdditionalCapacity? AdditionalCapacity
Gets or sets the maximum additional capacity that may be allocated during each planning period.
void ResizeTimeSeries(int periodCount)
Resizes every active period-dependent parameter.
AdditionalCapacityCost? AdditionalCapacityCost
Gets or sets the cost of using one unit of additional capacity during each planning period.
ProductionSchedulingProfile? SchedulingProfile
int PlanningHorizon
Gets the planning horizon represented by the first active period-dependent parameter.
void ClearDecisionParameters()
Removes all decision-model parameters from this work center.
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.