LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
MaximumSetupCount.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
5
7
8/// <summary>
9/// Maximum number of setup transitions authorized for a work center in each
10/// planning period.
11/// </summary>
12[Serializable]
13[XmlType(TypeName = "maximumSetupCount")]
14public sealed class MaximumSetupCount :
16{
18 {
19 }
20
21 public MaximumSetupCount(int planningHorizon)
22 : base(planningHorizon, defaultValue: 0)
23 {
24 }
25
27 int planningHorizon,
28 int defaultMaximumSetupCount)
29 : base(
30 planningHorizon,
31 defaultMaximumSetupCount)
32 {
33 }
34
35 [XmlIgnore]
37 Values;
38
39 public int GetCount(int period) =>
40 GetValue(period);
41
42 public void SetCount(
43 int period,
44 int count) =>
45 SetValue(period, count);
46
47 protected override void ValidateValue(
48 int value,
49 string parameterName)
50 {
51 base.ValidateValue(value, parameterName);
52
53 if (value < 0)
54 {
55 throw new ArgumentOutOfRangeException(
56 parameterName,
57 value,
58 "A maximum setup count cannot be negative.");
59 }
60 }
61}
Represents a sequence of integer values indexed by planning period.
int GetValue(int period)
Gets the parameter value for a planning period.
IntegerTimeSeriesParameter()
Initializes an empty period-dependent integer parameter.
void SetValue(int period, int value)
Sets the parameter value for a planning period.
IntegerTimeSeries Values
Gets or sets the parameter values for all planning periods.
override void ValidateValue(int value, string parameterName)
Validates one integer value.
MaximumSetupCount(int planningHorizon, int defaultMaximumSetupCount)