2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Xml.Serialization;
37 [XmlElement(
"backlogConstraint")]
40 get => _backlogConstraint;
41 set => SetDecisionParameter(
42 ref _backlogConstraint,
54 [XmlElement(
"backlogCost")]
58 set => SetDecisionParameter(
71 [XmlElement(
"shortageConstraint")]
74 get => _shortageConstraint;
75 set => SetDecisionParameter(
76 ref _shortageConstraint,
88 [XmlElement(
"shortageCost")]
92 set => SetDecisionParameter(
103 [XmlElement(
"sellingPrice")]
106 get => _sellingPrice;
107 set => SetDecisionParameter(
126 in GetDecisionParameters())
171 int? expectedHorizon =
null;
175 in GetDecisionParameters())
177 if (expectedHorizon is
null)
186 expectedHorizon.Value)
223 throw new ArgumentOutOfRangeException(
226 "The planning horizon cannot be negative.");
231 in GetDecisionParameters())
257 private void SetDecisionParameter<T>(
263 if (ReferenceEquals(field, value))
269 if (field is not
null)
271 field.PropertyChanged -=
272 OnDecisionParameterPropertyChanged;
278 if (field is not
null)
280 field.PropertyChanged +=
281 OnDecisionParameterPropertyChanged;
296 private IEnumerable<IPlanningHorizonAware>
297 GetDecisionParameters()
325 private void OnDecisionParameterPropertyChanged(
327 PropertyChangedEventArgs e)
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 ability of a distribution center to source a given item from a given warehouse invento...
SellingPrice? SellingPrice
Gets or sets the unit selling price of the item supplied by the warehouse to the distribution center ...
ShortageCost? ShortageCost
Gets or sets the unit cost applied to each item unit permanently lost as shortage.
void ClearDecisionParameters()
Removes all optional decision-model parameters from this sourcing relationship.
bool HasConsistentPlanningHorizon
Gets a value indicating whether all active parameters use the same planning horizon.
ShortageConstraint? ShortageConstraint
Gets or sets the maximum quantity of demand that may be permanently lost during each planning period.
bool HasDecisionParameters
Gets a value indicating whether at least one decision-model parameter is active.
void ResizeTimeSeries(int periodCount)
Resizes every active period-dependent parameter.
bool HasValidDecisionConfiguration
Gets a value indicating whether the dependencies between service constraints and costs are respected.
int PlanningHorizon
Gets the planning horizon represented by the first active period-dependent parameter.
bool AllowsShortage
Gets a value indicating whether shortage is authorized.
BacklogConstraint? BacklogConstraint
Gets or sets the maximum backlog quantity allowed during each planning period.
BacklogCost? BacklogCost
Gets or sets the unit cost applied to each item unit remaining in backlog during a planning period.
bool AllowsBacklog
Gets a value indicating whether backlog is authorized.
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.