LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
ParallelRoutingTopologyDescriptor.cs
Go to the documentation of this file.
2
4{
6 int itemId,
7 IReadOnlyList<int> routingIds,
8 IReadOnlyList<int> plantIds,
9 bool hasMultipleRoutingsWithinPlant)
10 {
11 if (itemId <= 0)
12 {
13 throw new ArgumentOutOfRangeException(
14 nameof(itemId));
15 }
16
17 ArgumentNullException.ThrowIfNull(
18 routingIds);
19
20 ArgumentNullException.ThrowIfNull(
21 plantIds);
22
23 ItemId =
24 itemId;
25
27 routingIds
28 .Distinct()
29 .OrderBy(
30 value =>
31 value)
32 .ToArray();
33
34 PlantIds =
35 plantIds
36 .Distinct()
37 .OrderBy(
38 value =>
39 value)
40 .ToArray();
41
43 hasMultipleRoutingsWithinPlant;
44
45 if (RoutingIds.Count < 2)
46 {
47 throw new InvalidOperationException(
48 "A parallel-routing topology requires at least two routings.");
49 }
50 }
51
52 public int ItemId
53 {
54 get;
55 }
56
57 public IReadOnlyList<int> RoutingIds
58 {
59 get;
60 }
61
62 public IReadOnlyList<int> PlantIds
63 {
64 get;
65 }
66
67 public bool IsMultiSite =>
68 PlantIds.Count > 1;
69
71 {
72 get;
73 }
74}
ParallelRoutingTopologyDescriptor(int itemId, IReadOnlyList< int > routingIds, IReadOnlyList< int > plantIds, bool hasMultipleRoutingsWithinPlant)