LotSizingDataModel.Core
2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
ProductionMicroPeriodReference.cs
Go to the documentation of this file.
1
using
System;
2
using
System.Xml.Serialization;
3
using
LotSizingDataModel.Core.Common
;
4
5
namespace
LotSizingDataModel.Core.DecisionModel.Scheduling
;
6
7
[Serializable]
8
[XmlType(TypeName =
"productionMicroPeriodReference"
)]
9
public
sealed
class
ProductionMicroPeriodReference
:
ModelObject
10
{
11
private
int
_macroPeriod;
12
private
int
_microPeriodIndex;
13
14
public
ProductionMicroPeriodReference
()
15
{
16
}
17
18
public
ProductionMicroPeriodReference
(
19
int
macroPeriod,
20
int
microPeriodIndex)
21
{
22
MacroPeriod
= macroPeriod;
23
MicroPeriodIndex
= microPeriodIndex;
24
}
25
26
[XmlAttribute(
"macroPeriod"
)]
27
public
int
MacroPeriod
28
{
29
get
=> _macroPeriod;
30
set
31
{
32
if
(value < 0)
33
{
34
throw
new
ArgumentOutOfRangeException(
35
nameof(value),
36
value,
37
"The macro-period index cannot be negative."
);
38
}
39
40
SetProperty(ref _macroPeriod, value);
41
}
42
}
43
44
[XmlAttribute(
"microPeriodIndex"
)]
45
public
int
MicroPeriodIndex
46
{
47
get
=> _microPeriodIndex;
48
set
49
{
50
if
(value < 0)
51
{
52
throw
new
ArgumentOutOfRangeException(
53
nameof(value),
54
value,
55
"The micro-period index cannot be negative."
);
56
}
57
58
SetProperty(ref _microPeriodIndex, value);
59
}
60
}
61
62
[XmlIgnore]
63
public
bool
IsInternallyValid
=>
64
MacroPeriod
> 0 &&
65
MicroPeriodIndex
> 0;
66
67
public
bool
RefersToSameMicroPeriod
(
68
ProductionMicroPeriodReference
? other) =>
69
other is not
null
&&
70
MacroPeriod
== other.MacroPeriod &&
71
MicroPeriodIndex
== other.
MicroPeriodIndex
;
72
73
public
override
string
ToString
() =>
74
$
"Macro:{MacroPeriod}/Micro:{MicroPeriodIndex}"
;
75
}
LotSizingDataModel.Core.Common.ModelObject
Base class for model objects that notify listeners when one of their properties changes.
Definition
ModelObject.cs:16
LotSizingDataModel.Core.DecisionModel.Scheduling.ProductionMicroPeriodReference.ProductionMicroPeriodReference
ProductionMicroPeriodReference()
Definition
ProductionMicroPeriodReference.cs:14
LotSizingDataModel.Core.DecisionModel.Scheduling.ProductionMicroPeriodReference.RefersToSameMicroPeriod
bool RefersToSameMicroPeriod(ProductionMicroPeriodReference? other)
Definition
ProductionMicroPeriodReference.cs:67
LotSizingDataModel.Core.DecisionModel.Scheduling.ProductionMicroPeriodReference.ProductionMicroPeriodReference
ProductionMicroPeriodReference(int macroPeriod, int microPeriodIndex)
Definition
ProductionMicroPeriodReference.cs:18
LotSizingDataModel.Core.DecisionModel.Scheduling.ProductionMicroPeriodReference.MicroPeriodIndex
int MicroPeriodIndex
Definition
ProductionMicroPeriodReference.cs:46
LotSizingDataModel.Core.DecisionModel.Scheduling.ProductionMicroPeriodReference.ToString
override string ToString()
Definition
ProductionMicroPeriodReference.cs:73
LotSizingDataModel.Core.DecisionModel.Scheduling.ProductionMicroPeriodReference.MacroPeriod
int MacroPeriod
Definition
ProductionMicroPeriodReference.cs:28
LotSizingDataModel.Core.DecisionModel.Scheduling.ProductionMicroPeriodReference.IsInternallyValid
bool IsInternallyValid
Definition
ProductionMicroPeriodReference.cs:63
LotSizingDataModel.Core.Common
Definition
DoubleTimeSeries.cs:7
LotSizingDataModel.Core.DecisionModel.Scheduling
Definition
MaximumProducedItemCount.cs:6
LotSizingDataModel.Core
DecisionModel
Scheduling
ProductionMicroPeriodReference.cs
Generated by
1.17.0