LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
PeriodicOperatingExpenditureBudget.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
5
7
8/// <summary>
9/// Represents the maximum modeled operating expenditure allowed in each
10/// planning period.
11/// </summary>
12/// <remarks>
13/// The executable alpha.23 formulation interprets this parameter against
14/// positive coefficients of period-indexed variables in the economic
15/// objective. Negative revenue coefficients do not replenish the budget and
16/// positive objective terms without a period segment are outside this periodic
17/// operating envelope.
18/// </remarks>
19[Serializable]
20[XmlType(TypeName = "periodicOperatingExpenditureBudget")]
23{
27
29 int planningHorizon)
30 : base(
31 planningHorizon,
32 defaultValue: 0.0)
33 {
34 }
35
37 int planningHorizon,
38 double defaultBudget)
39 : base(
40 planningHorizon,
41 defaultBudget)
42 {
43 }
44
45 [XmlIgnore]
47 Values;
48
49 public double GetBudget(int period) =>
50 GetValue(period);
51
52 public void SetBudget(
53 int period,
54 double budget) =>
55 SetValue(period, budget);
56
57 protected override void ValidateValue(
58 double value,
59 string parameterName)
60 {
61 base.ValidateValue(
62 value,
63 parameterName);
64
65 if (value < 0.0)
66 {
67 throw new ArgumentOutOfRangeException(
68 parameterName,
69 value,
70 "An operating expenditure budget cannot be negative.");
71 }
72 }
73}
Represents a sequence of finite double values indexed by planning period.
DoubleTimeSeriesParameter()
Initializes an empty period-dependent parameter.
double GetValue(int period)
Gets the parameter value for a planning period.
DoubleTimeSeries Values
Gets or sets the values of the parameter for all planning periods.
void SetValue(int period, double value)
Sets the parameter value for a planning period.
override void ValidateValue(double value, string parameterName)
Validates one value before it is assigned to the parameter.