LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
ProductionChangeover.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Xml.Serialization;
5
7
8/// <summary>
9/// One ordered setup-state transition on a work center.
10/// </summary>
11/// <remarks>
12/// The transition is directional: A -> B and B -> A are distinct definitions.
13/// </remarks>
14[Serializable]
15[XmlType(TypeName = "productionChangeover")]
16public sealed class ProductionChangeover :
19{
20 private int _fromItemId;
21 private int _toItemId;
22
23 [XmlAttribute("fromItemId")]
24 public int FromItemId
25 {
26 get => _fromItemId;
27 set
28 {
29 if (value < 0)
30 {
31 throw new ArgumentOutOfRangeException(
32 nameof(value),
33 value,
34 "The origin item identifier cannot be negative.");
35 }
36
37 SetProperty(ref _fromItemId, value);
38 }
39 }
40
41 [XmlAttribute("toItemId")]
42 public int ToItemId
43 {
44 get => _toItemId;
45 set
46 {
47 if (value < 0)
48 {
49 throw new ArgumentOutOfRangeException(
50 nameof(value),
51 value,
52 "The destination item identifier cannot be negative.");
53 }
54
55 SetProperty(ref _toItemId, value);
56 }
57 }
58
59 [XmlElement("changeoverTime")]
61 {
62 get;
63 set;
64 }
65
66 [XmlElement("changeoverCost")]
68 {
69 get;
70 set;
71 }
72
73 [XmlIgnore]
76
77 [XmlIgnore]
78 public int PlanningHorizon =>
79 ChangeoverTime?.PlanningHorizon ??
80 ChangeoverCost?.PlanningHorizon ??
81 0;
82
83 [XmlIgnore]
85 ChangeoverTime is null ||
86 ChangeoverCost is null ||
87 ChangeoverTime.PlanningHorizon ==
88 ChangeoverCost.PlanningHorizon;
89
90 public void ResizeTimeSeries(int periodCount)
91 {
92 if (periodCount < 0)
93 {
94 throw new ArgumentOutOfRangeException(
95 nameof(periodCount),
96 periodCount,
97 "The planning horizon cannot be negative.");
98 }
99
100 ChangeoverTime?.ResizeTimeSeries(periodCount);
101 ChangeoverCost?.ResizeTimeSeries(periodCount);
102
105 }
106}
Base class for model objects that notify listeners when one of their properties changes.
virtual void OnPropertyChanged([CallerMemberName] string? propertyName=null)
Raises the PropertyChanged event.
int PlanningHorizon
Gets the number of planning periods currently represented by the object's time-dependent data.
void ResizeTimeSeries(int periodCount)
Resizes every time-dependent series contained in the object.
Cost incurred by a changeover from one item setup state to another.
Capacity time consumed by a changeover from one item setup state to another.
Defines a model object containing data indexed by planning period.