LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
StartUpTime.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
5
7
8/// <summary>
9/// Represents the production capacity consumed when a new sequence of setups
10/// starts during a planning period.
11/// </summary>
12/// <remarks>
13/// This is intentionally distinct from <see cref="SetupTime"/>.
14/// Wolsey's start-up-time extension reduces the capacity of the period in
15/// which a sequence of setups starts. The standard formulation does not yet
16/// contain the transition variable required to enforce this consumption.
17/// </remarks>
18[Serializable]
19[XmlType(TypeName = "startUpTime")]
21{
22 public StartUpTime()
23 {
24 }
25
26 public StartUpTime(int planningHorizon)
27 : base(planningHorizon, defaultValue: 0.0)
28 {
29 }
30
32 int planningHorizon,
33 double defaultStartUpTime)
34 : base(planningHorizon, defaultStartUpTime)
35 {
36 }
37
38 [XmlIgnore]
40 Values;
41
42 public double GetStartUpTime(int period) =>
43 GetValue(period);
44
45 public void SetStartUpTime(
46 int period,
47 double startUpTime) =>
48 SetValue(period, startUpTime);
49
50 protected override void ValidateValue(
51 double value,
52 string parameterName)
53 {
54 base.ValidateValue(value, parameterName);
55
56 if (value < 0.0)
57 {
58 throw new ArgumentOutOfRangeException(
59 parameterName,
60 value,
61 "A start-up time cannot be negative.");
62 }
63 }
64}
Represents a sequence of finite double values indexed by planning period.
override void ValidateValue(double value, string parameterName)
Validates one value before it is assigned to the parameter.
void SetStartUpTime(int period, double startUpTime)
StartUpTime(int planningHorizon, double defaultStartUpTime)
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.