2using System.Xml.Serialization;
17[XmlType(TypeName =
"cashFlowPolicy")]
22 private double _initialCashBalance;
23 private int _receiptDelayPeriods;
24 private int _disbursementDelayPeriods;
25 private bool _enforceMinimumCashBalance =
true;
30 [XmlAttribute(
"initialCashBalance")]
33 get => _initialCashBalance;
36 EnsureFinite(value, nameof(value));
37 SetProperty(ref _initialCashBalance, value);
41 [XmlAttribute(
"receiptDelayPeriods")]
44 get => _receiptDelayPeriods;
49 throw new ArgumentOutOfRangeException(nameof(value));
52 SetProperty(ref _receiptDelayPeriods, value);
56 [XmlAttribute(
"disbursementDelayPeriods")]
59 get => _disbursementDelayPeriods;
64 throw new ArgumentOutOfRangeException(nameof(value));
67 SetProperty(ref _disbursementDelayPeriods, value);
71 [XmlAttribute(
"enforceMinimumCashBalance")]
74 get => _enforceMinimumCashBalance;
75 set => SetProperty(ref _enforceMinimumCashBalance, value);
78 [XmlElement(
"fixedNetCashFlow")]
81 get => _fixedNetCashFlow;
84 ArgumentNullException.ThrowIfNull(value);
85 SetProperty(ref _fixedNetCashFlow, value);
89 [XmlElement(
"minimumCashBalance")]
92 get => _minimumCashBalance;
95 ArgumentNullException.ThrowIfNull(value);
96 SetProperty(ref _minimumCashBalance, value);
108 FixedNetCashFlow.PeriodCount ==
115 throw new ArgumentOutOfRangeException(nameof(periodCount));
125 private static void EnsureFinite(
127 string parameterName)
129 if (!
double.IsFinite(value))
131 throw new ArgumentOutOfRangeException(
134 "Cash values must be finite.");
Represents a sequence of finite double values indexed by planning period.
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.
Defines cash-flow timing and solvency semantics independently of OPEX budget.
DoubleTimeSeries MinimumCashBalance
bool EnforceMinimumCashBalance
DoubleTimeSeries FixedNetCashFlow
int DisbursementDelayPeriods
bool HasConsistentPlanningHorizon
double InitialCashBalance
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.
Defines a model object containing data indexed by planning period.