LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
BitranYanasseHistoricalMapper.cs
Go to the documentation of this file.
5
7
8/// <summary>
9/// Maps the historical Bitran-Yanasse temporal classification to the portion
10/// of the LotSizingDataModel universal specification that can be represented
11/// exactly by notation scheme v1.
12/// </summary>
13/// <remarks>
14/// The 1982 classification concerns the capacitated single-item lot-size
15/// problem and classifies the temporal behavior of setup cost, holding cost,
16/// production cost and capacity.
17///
18/// Universal notation v1 now represents these historical dimensions through
19/// generic TP temporal qualifiers. The mapping is therefore lossless without
20/// introducing Bitran-Yanasse-specific syntax into the universal grammar.
21/// </remarks>
23{
24 /// <summary>
25 /// Gets the universal v1 domain specification shared by the classical
26 /// Bitran-Yanasse problem family, excluding temporal-pattern qualifiers
27 /// that v1 cannot yet encode.
28 /// </summary>
32 "1,SL,Net:UNK | Dem,Det,Prod,Cap:P | Obj:Econ");
33
36 {
37 ArgumentNullException.ThrowIfNull(profile);
38
40 profile,
43 Array.Empty<string>(),
44 applicability: null);
45 }
46
50 {
51 ArgumentNullException.ThrowIfNull(profile);
52 ArgumentNullException.ThrowIfNull(descriptor);
53
55 profile,
58 Array.Empty<string>(),
59 AssessApplicability(descriptor));
60 }
61
62 /// <summary>
63 /// Converts the four historical temporal positions to generic universal
64 /// TP qualifiers without using historical-specific universal tokens.
65 /// </summary>
66 public static IReadOnlyList<UniversalTemporalQualifier>
69 {
70 ArgumentNullException.ThrowIfNull(profile);
71
72 return new[]
73 {
76 profile.SetupCost.Pattern),
79 profile.HoldingCost.Pattern),
81 UniversalTemporalParameter.ProductionCost,
82 profile.ProductionCost.Pattern),
84 UniversalTemporalParameter.ProductionCapacity,
85 profile.Capacity.Pattern)
86 };
87 }
88
89 /// <summary>
90 /// Creates the lossless universal specification corresponding to one
91 /// complete historical profile.
92 /// </summary>
96 {
97 ArgumentNullException.ThrowIfNull(profile);
98
101
102 var notation =
104 alpha:
105 baseDomain.Notation.Alpha,
106 beta:
108 baseDomain.Notation.Beta.Features,
109 CreateTemporalQualifiers(profile)),
110 gamma:
111 baseDomain.Notation.Gamma);
112
114 notation);
115 }
116
120 {
121 ArgumentNullException.ThrowIfNull(descriptor);
122
123 var failedRequirements =
124 new List<string>();
125
126 var extensions =
127 new List<string>();
128
129 if (descriptor.Structure.ItemCount <= 0 ||
130 descriptor.Time.PlanningHorizon <= 0)
131 {
134 new[]
135 {
136 "positiveItemCountAndPlanningHorizon"
137 },
138 Array.Empty<string>());
139 }
140
141 if (descriptor.Structure.ItemCount != 1)
142 {
143 failedRequirements.Add("singleItem");
144 }
145
146 if (descriptor.Structure.HasProductStructure)
147 {
148 failedRequirements.Add("singleLevel");
149 }
150
151 if (!descriptor.Demand.HasDemand)
152 {
153 failedRequirements.Add("demand");
154 }
155
156 if (!descriptor.Demand.IsDeterministic)
157 {
158 failedRequirements.Add("deterministicDemand");
159 }
160
161 if (!descriptor.Production.HasProduction)
162 {
163 failedRequirements.Add("production");
164 }
165
166 if (!descriptor.Capacity.HasProductionCapacity)
167 {
168 failedRequirements.Add("productionCapacity");
169 }
170
172 {
173 failedRequirements.Add("singleEconomicObjective");
174 }
175
176 if (failedRequirements.Count > 0)
177 {
179 BitranYanasseApplicabilityKind.NotApplicable,
180 failedRequirements,
181 Array.Empty<string>());
182 }
183
184 AddExtension(
185 descriptor.Setup.HasSetupTimes,
186 "setupTimes",
187 extensions);
188
189 AddExtension(
190 descriptor.Setup.HasStartUpCosts,
191 "startupCosts",
192 extensions);
193
194 AddExtension(
195 descriptor.Production.HasLeadTimes,
196 "productionLeadTimes",
197 extensions);
198
199 AddExtension(
201 "lotSizeRestrictions",
202 extensions);
203
204 AddExtension(
206 "additionalCapacity",
207 extensions);
208
209 AddExtension(
210 descriptor.Capacity.HasSupplierCapacity,
211 "supplierCapacity",
212 extensions);
213
214 AddExtension(
216 "transportCapacity",
217 extensions);
218
219 AddExtension(
221 "warehouseCapacity",
222 extensions);
223
224 AddExtension(
226 "safetyStock",
227 extensions);
228
229 AddExtension(
231 "backlogging",
232 extensions);
233
234 AddExtension(
236 "lostSales",
237 extensions);
238
239 AddExtension(
240 descriptor.Procurement.HasPurchasing,
241 "purchasing",
242 extensions);
243
244 AddExtension(
246 "transportation",
247 extensions);
248
249 AddExtension(
251 "distribution",
252 extensions);
253
254 AddExtension(
256 "financialConstraints",
257 extensions);
258
260 extensions.Count == 0
262 : BitranYanasseApplicabilityKind.ExtendedButProjectable;
263
265 kind,
266 Array.Empty<string>(),
267 extensions);
268 }
269
270 private static void AddExtension(
271 bool condition,
272 string code,
273 ICollection<string> extensions)
274 {
275 if (condition)
276 {
277 extensions.Add(code);
278 }
279 }
280}
Typed structured description of the factual lot-sizing problem characteristics currently represented ...
Represents the historical Bitran-Yanasse temporal structure alpha/beta/gamma/delta for single-item ca...
Maps the historical Bitran-Yanasse temporal classification to the portion of the LotSizingDataModel u...
static IReadOnlyList< UniversalTemporalQualifier > CreateTemporalQualifiers(BitranYanasseTemporalProfile profile)
Converts the four historical temporal positions to generic universal TP qualifiers without using hist...
BitranYanasseApplicabilityAssessment AssessApplicability(LotSizingProblemDescriptor descriptor)
BitranYanasseHistoricalMapping Map(BitranYanasseTemporalProfile profile)
BitranYanasseHistoricalMapping Map(BitranYanasseTemporalProfile profile, LotSizingProblemDescriptor descriptor)
static UniversalProblemSpecification CreateUniversalSpecification(BitranYanasseTemporalProfile profile)
Creates the lossless universal specification corresponding to one complete historical profile.
static UniversalProblemSpecification ClassicalDomainSpecification
Gets the universal v1 domain specification shared by the classical Bitran-Yanasse problem family,...
Represents a lossless historical Bitran-Yanasse profile together with the lossless projection to univ...
Represents a universal notation interpreted as a problem specification.
static UniversalProblemSpecification Parse(string text, string? schemeVersion=null)
Typed abstract syntax tree for the versioned alpha | beta | gamma scheme.
Beta field: constraints and modeled extensions.
IReadOnlyCollection< UniversalNotationFeature > Features
HistoricalMappingCoverage
Describes how completely a historical classification can currently be represented by the universal no...
BitranYanasseApplicabilityKind
Describes whether an instance descriptor belongs to the scientific domain of the historical Bitran-Ya...
@ ExactHistoricalDomain
The descriptor satisfies the classical domain conditions and contains no currently identified extensi...
UniversalTemporalParameter
Identifies a time-varying model parameter that may be qualified by a generic temporal pattern in univ...
record UniversalTemporalQualifier
Qualifies one universal model-parameter family with a generic temporal pattern.