2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Xml.Serialization;
34 get => _capacityConstraint;
35 set => SetDecisionParameter(
36 ref _capacityConstraint,
42 [XmlElement(
"capacityConstraint")]
59 [XmlElement(
"additionalCapacity")]
62 get => _additionalCapacity;
63 set => SetDecisionParameter(
64 ref _additionalCapacity,
73 [XmlElement(
"fixedUsageCost")]
76 get => _fixedUsageCost;
77 set => SetDecisionParameter(
90 [XmlElement(
"additionalCapacityCost")]
93 get => _additionalCapacityCost;
94 set => SetDecisionParameter(
95 ref _additionalCapacityCost,
113 in GetDecisionParameters())
144 int? expectedHorizon =
null;
148 in GetDecisionParameters())
150 if (expectedHorizon is
null)
159 expectedHorizon.Value)
192 throw new ArgumentOutOfRangeException(
195 "The planning horizon cannot be negative.");
202 in GetDecisionParameters())
209 for (
int period = previousCapacityHorizon + 1; period <= periodCount; period++)
232 private void SetDecisionParameter<T>(
238 if (ReferenceEquals(field, value))
244 if (field is not
null)
246 field.PropertyChanged -=
247 OnDecisionParameterPropertyChanged;
253 if (field is not
null)
255 field.PropertyChanged +=
256 OnDecisionParameterPropertyChanged;
260 OnPropertyChanged(propertyName);
269 private IEnumerable<IPlanningHorizonAware>
270 GetDecisionParameters()
298 private void OnDecisionParameterPropertyChanged(
300 PropertyChangedEventArgs e)
315 else if (ReferenceEquals(
Base class for model objects that notify listeners when one of their properties changes.
XML capacity series for work centers and warehouses, with INF for unbounded periods.
static ? ResourceCapacitySeries FromConstraint(CapacityConstraint? constraint)
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.
ResourceCapacitySeries? SerializedCapacity
XML capacity series with INF for unbounded periods.
AdditionalCapacityCost? AdditionalCapacityCost
Gets or sets the cost of using one unit of additional capacity during each planning period.
ProductionSchedulingProfile? SchedulingProfile
double? GetProductionCapacity(int period)
Returns the maximum production capacity, or null when the period is unbounded.
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.