LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
ProductionFamilySetupTime.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
5
7
8/// <summary>
9/// Capacity consumed when a shared production-family setup is active.
10/// </summary>
11[Serializable]
12[XmlType(TypeName = "productionFamilySetupTime")]
13public sealed class ProductionFamilySetupTime :
15{
17 {
18 }
19
20 public ProductionFamilySetupTime(int planningHorizon)
21 : base(planningHorizon, defaultValue: 0.0)
22 {
23 }
24
26 int planningHorizon,
27 double defaultSetupTime)
28 : base(planningHorizon, defaultSetupTime)
29 {
30 }
31
32 [XmlIgnore]
34
35 public double GetSetupTime(int period) => GetValue(period);
36
37 public void SetSetupTime(int period, double setupTime) =>
38 SetValue(period, setupTime);
39
40 protected override void ValidateValue(
41 double value,
42 string parameterName)
43 {
44 base.ValidateValue(value, parameterName);
45
46 if (value < 0.0)
47 {
48 throw new ArgumentOutOfRangeException(
49 parameterName,
50 value,
51 "A production-family setup time cannot be negative.");
52 }
53 }
54}
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.
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.