1using LotSizingDataModel.Core.DecisionModel.Scheduling;
2using LotSizingDataModel.Core.PhysicalModel;
3using LotSizingDataModel.Core.Relationships;
4using LotSizingDataModel.Instance;
11 LotSizingInstance instance,
14 out ProductionSchedulingProfile? profile)
16 ArgumentNullException.ThrowIfNull(instance);
19 instance.SupplyChain.Plants
22 plant.WorkCenters.Select(
30 entry.WorkCenter.SchedulingProfile is not
null)
34 if (entries.Length != 1)
47 entries[0].WorkCenter;
50 entries[0].WorkCenter.SchedulingProfile;
59 ProductionSchedulingProfile Profile)
61 LotSizingInstance instance)
67 out ProductionSchedulingProfile? profile) ||
71 throw new InvalidOperationException(
72 "Executable GLSP requires exactly one scheduling work center.");
82 LotSizingInstance instance,
86 ArgumentNullException.ThrowIfNull(instance);
88 return instance.SupplyChain.ProductionRoutings
91 routing.WorkCenters.Any(
93 reference.PlantId == plantId &&
94 reference.WorkCenterId ==
103 LotSizingInstance instance,
104 ProductionRouting routing,
107 out ProductionCharacteristic? characteristic)
109 ArgumentNullException.ThrowIfNull(instance);
110 ArgumentNullException.ThrowIfNull(routing);
112 ProductionCharacteristic[] matches =
113 instance.SupplyChain.ProductionCharacteristics
118 candidate.WorkCenter.PlantId ==
120 candidate.WorkCenter.WorkCenterId ==
125 if (matches.Length != 1)
127 characteristic =
null;
139 LotSizingInstance instance,
140 ProductionRouting routing,
149 out ProductionCharacteristic? characteristic) ||
150 characteristic is
null)
152 throw new InvalidOperationException(
153 $
"Executable GLSP requires exactly one production " +
154 $
"characteristic for routing {routing.Id} on " +
155 $
"Plant:{plantId}/WorkCenter:{workCenterId}.");
158 return characteristic;
162 ProductionSchedulingProfile profile,
166 ArgumentNullException.ThrowIfNull(profile);
168 return profile.Changeovers
171 changeover.FromItemId ==
173 changeover.ToItemId ==