LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
StartUpCost.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
5
7
8/// <summary>
9/// Represents the cost incurred when a new sequence of production setups
10/// starts during a planning period.
11/// </summary>
12/// <remarks>
13/// This is intentionally distinct from <see cref="FixedSetupCost"/>.
14/// A setup cost is associated with activating production for an item in a
15/// period. A start-up cost is associated with the beginning of a sequence of
16/// setups, i.e. with a transition into an active setup sequence.
17///
18/// The parameter provides factual model semantics only. The standard
19/// formulation does not yet contain the transition variable required to
20/// enforce this cost.
21/// </remarks>
22[Serializable]
23[XmlType(TypeName = "startUpCost")]
25{
26 public StartUpCost()
27 {
28 }
29
30 public StartUpCost(int planningHorizon)
31 : base(planningHorizon, defaultValue: 0.0)
32 {
33 }
34
36 int planningHorizon,
37 double defaultStartUpCost)
38 : base(planningHorizon, defaultStartUpCost)
39 {
40 }
41
42 [XmlIgnore]
44 Values;
45
46 public double GetStartUpCost(int period) =>
47 GetValue(period);
48
49 public void SetStartUpCost(
50 int period,
51 double cost) =>
52 SetValue(period, cost);
53
54 protected override void ValidateValue(
55 double value,
56 string parameterName)
57 {
58 base.ValidateValue(value, parameterName);
59
60 if (value < 0.0)
61 {
62 throw new ArgumentOutOfRangeException(
63 parameterName,
64 value,
65 "A start-up cost cannot be negative.");
66 }
67 }
68}
Represents a sequence of finite double values indexed by planning period.
StartUpCost(int planningHorizon, double defaultStartUpCost)
override void ValidateValue(double value, string parameterName)
Validates one value before it is assigned to the parameter.
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.