LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
ProductionStartUpDomainKeyFactory.cs
Go to the documentation of this file.
1using LotSizingDataModel.Core.DecisionModel.Scheduling;
2using LotSizingDataModel.Core.Relationships;
5
7
8/// <summary>
9/// Builds canonical mathematical domain keys for production start-up events.
10/// </summary>
11/// <remarks>
12/// Start-up is deliberately distinct from setup state, setup-start occurrence,
13/// and sequence-dependent changeover. The same physical transition may trigger
14/// several independent accounting/capacity terms, but each term keeps its own
15/// parameter family and mathematical category.
16/// </remarks>
18{
27
28 public static string CreateSmallBucketKey(
29 ProductionSchedulingProfile profile,
30 ProductionRouting routing,
31 int period)
32 {
33 ArgumentNullException.ThrowIfNull(profile);
34 ArgumentNullException.ThrowIfNull(routing);
35
36 var builder =
40 .Add(MathematicalDomainKeySegment.Item, routing.ItemId)
42
43 if (period == 1 && profile.HasInitialSetupState)
44 {
45 builder.Add(
47 profile.InitialSetupItemId);
48 }
49
50 if (period > 1 &&
51 profile.SetupCarryOverPolicy == SetupCarryOverPolicy.Forbidden)
52 {
53 builder.Add(
55 1);
56 }
57
58 return builder.Build();
59 }
60
61 public static string CreateGlspKey(
62 int plantId,
63 int workCenterId,
64 int routingId,
65 int itemId,
66 ProductionMicroPeriodReference microPeriod,
67 int fixedPredecessorItemId,
68 bool resetBoundary)
69 {
70 var builder =
75 .Add(MathematicalDomainKeySegment.Period, microPeriod.MacroPeriod)
76 .Add(MathematicalDomainKeySegment.MicroPeriod, microPeriod.MicroPeriodIndex)
79
80 if (fixedPredecessorItemId > 0)
81 {
82 builder.Add(
84 fixedPredecessorItemId);
85 }
86
87 if (resetBoundary)
88 {
89 builder.Add(
91 1);
92 }
93
94 return builder.Build();
95 }
96}
Builds stable business-domain keys for mathematical variables and constraints.
MathematicalDomainKeyBuilder Add(string name, string value)
Adds a text segment.
Builds canonical mathematical domain keys for production start-up events.
static string CreateSmallBucketKey(ProductionSchedulingProfile profile, ProductionRouting routing, int period)
static string CreateGlspKey(int plantId, int workCenterId, int routingId, int itemId, ProductionMicroPeriodReference microPeriod, int fixedPredecessorItemId, bool resetBoundary)
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...