LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
CapacityAnalyzer.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
8
10
11/// <summary>
12/// Provides capacity-profile and capacity-load calculations
13/// for production, storage and transport resources.
14///
15/// The analyzer does not modify the supply-chain model.
16/// </summary>
17public sealed class CapacityAnalyzer
18{
19 /// <summary>
20 /// Initializes a capacity analyzer and creates
21 /// a new supply-chain index.
22 /// </summary>
23 public CapacityAnalyzer(SupplyChain supplyChain)
24 : this(
26 supplyChain ??
27 throw new ArgumentNullException(
28 nameof(supplyChain))))
29 {
30 }
31
32 /// <summary>
33 /// Initializes a capacity analyzer using an existing index.
34 /// </summary>
36 {
37 Index = index ??
38 throw new ArgumentNullException(nameof(index));
39
41
42 Queries = new SupplyChainQueries(index);
43 }
44
45 /// <summary>
46 /// Gets the analyzed supply chain.
47 /// </summary>
48 public SupplyChain SupplyChain { get; }
49
50 /// <summary>
51 /// Gets the entity index used by the analyzer.
52 /// </summary>
53 public SupplyChainIndex Index { get; }
54
55 /// <summary>
56 /// Gets the query service used to resolve relationships
57 /// and applicable capacity parameters.
58 /// </summary>
60
61 /// <summary>
62 /// Rebuilds the underlying entity index.
63 ///
64 /// Call this method after directly adding or removing
65 /// entities from the supply chain.
66 /// </summary>
67 public void RebuildIndex()
68 {
69 Index.Rebuild();
70 }
71
72 #region Capacity profiles
73
74 /// <summary>
75 /// Gets the complete capacity profile of a work center.
76 /// </summary>
78 WorkCenterReference workCenter)
79 {
80 ArgumentNullException.ThrowIfNull(workCenter);
81
82 Index.GetRequiredWorkCenter(workCenter);
83
84 return CreateCapacityProfile(
85 period =>
86 Queries.GetWorkCenterCapacity(
87 workCenter,
88 period));
89 }
90
91 /// <summary>
92 /// Gets the complete global capacity profile
93 /// of a warehouse.
94 /// </summary>
96 WarehouseReference warehouse)
97 {
98 ArgumentNullException.ThrowIfNull(warehouse);
99
100 Index.GetRequiredWarehouse(warehouse);
101
102 return CreateCapacityProfile(
103 period =>
104 Queries.GetWarehouseCapacity(
105 warehouse,
106 period));
107 }
108
109 /// <summary>
110 /// Gets the complete capacity profile applicable
111 /// to an item stored in a warehouse.
112 ///
113 /// An item-specific inventory capacity is used when
114 /// available. Otherwise, the global warehouse capacity
115 /// is returned.
116 /// </summary>
118 int itemId,
119 WarehouseReference warehouse)
120 {
121 ArgumentNullException.ThrowIfNull(warehouse);
122
123 Queries.GetRequiredInventory(
124 itemId,
125 warehouse);
126
127 return CreateCapacityProfile(
128 period =>
129 Queries.GetInventoryCapacity(
130 itemId,
131 warehouse,
132 period));
133 }
134
135 /// <summary>
136 /// Gets the complete global capacity profile
137 /// of a transport resource.
138 /// </summary>
139 public CapacityProfile
141 int transportResourceId)
142 {
143 Index.GetRequiredTransportResource(
144 transportResourceId);
145
146 return CreateCapacityProfile(
147 period =>
148 Queries.GetTransportResourceCapacity(
149 transportResourceId,
150 period));
151 }
152
153 /// <summary>
154 /// Gets the complete capacity profile applicable to
155 /// an item transported by a transport resource.
156 ///
157 /// An item-specific capacity is used when available.
158 /// Otherwise, the global transport-resource capacity
159 /// is returned.
160 /// </summary>
162 int itemId,
163 int transportResourceId)
164 {
165 Queries.GetRequiredTransportCharacteristic(
166 itemId,
167 transportResourceId);
168
169 return CreateCapacityProfile(
170 period =>
171 Queries.GetTransportCapacity(
172 itemId,
173 transportResourceId,
174 period));
175 }
176
177 #endregion
178
179 #region Production load
180
181 /// <summary>
182 /// Calculates the capacity required to produce a quantity
183 /// of an item on a work center during one period.
184 /// </summary>
186 int itemId,
187 WorkCenterReference workCenter,
188 int period,
189 double productionQuantity,
190 bool setupActivated)
191 {
192 ArgumentNullException.ThrowIfNull(workCenter);
193
194 ValidatePeriod(period);
195 ValidateQuantity(
196 productionQuantity,
197 nameof(productionQuantity));
198
199 ProductionCharacteristic characteristic =
200 Queries.GetRequiredProductionCharacteristic(
201 itemId,
202 workCenter);
203
204 double unitCapacity =
205 characteristic.UnitCapacityConsumption
206 ?.GetConsumption(period) ??
207 0.0;
208
209 double setupCapacity =
210 setupActivated
211 ? characteristic.SetupTime
212 ?.GetSetupTime(period) ??
213 0.0
214 : 0.0;
215
217 Queries.GetWorkCenterCapacity(
218 workCenter,
219 period);
220
221 return CreateLoadSnapshot(
222 quantity: productionQuantity,
223 unitCapacity: unitCapacity,
224 setupCapacity: setupCapacity,
225 setupActivated: setupActivated,
226 capacity: capacity);
227 }
228
229 #endregion
230
231 #region Storage load
232
233 /// <summary>
234 /// Calculates the capacity required to store a quantity
235 /// of an item in a warehouse during one period.
236 /// </summary>
238 int itemId,
239 WarehouseReference warehouse,
240 int period,
241 double inventoryQuantity,
242 bool setupActivated)
243 {
244 ArgumentNullException.ThrowIfNull(warehouse);
245
246 ValidatePeriod(period);
247 ValidateQuantity(
248 inventoryQuantity,
249 nameof(inventoryQuantity));
250
251 Inventory inventory =
252 Queries.GetRequiredInventory(
253 itemId,
254 warehouse);
255
256 double unitCapacity =
257 inventory.UnitCapacityConsumption
258 ?.GetConsumption(period) ??
259 0.0;
260
261 double setupCapacity =
262 setupActivated
263 ? inventory.SetupTime
264 ?.GetSetupTime(period) ??
265 0.0
266 : 0.0;
267
269 Queries.GetInventoryCapacity(
270 itemId,
271 warehouse,
272 period);
273
274 return CreateLoadSnapshot(
275 quantity: inventoryQuantity,
276 unitCapacity: unitCapacity,
277 setupCapacity: setupCapacity,
278 setupActivated: setupActivated,
279 capacity: capacity);
280 }
281
282 #endregion
283
284 #region Transport load
285
286 /// <summary>
287 /// Calculates the capacity required to transport a quantity
288 /// of an item using a transport resource during one period.
289 /// </summary>
291 int itemId,
292 int transportResourceId,
293 int period,
294 double transportedQuantity,
295 bool setupActivated)
296 {
297 ValidatePeriod(period);
298 ValidateQuantity(
299 transportedQuantity,
300 nameof(transportedQuantity));
301
302 TransportCharacteristic characteristic =
303 Queries.GetRequiredTransportCharacteristic(
304 itemId,
305 transportResourceId);
306
307 double unitCapacity =
308 characteristic.UnitCapacityConsumption
309 ?.GetConsumption(period) ??
310 0.0;
311
312 double setupCapacity =
313 setupActivated
314 ? characteristic.SetupTime
315 ?.GetSetupTime(period) ??
316 0.0
317 : 0.0;
318
320 Queries.GetTransportCapacity(
321 itemId,
322 transportResourceId,
323 period);
324
325 return CreateLoadSnapshot(
326 quantity: transportedQuantity,
327 unitCapacity: unitCapacity,
328 setupCapacity: setupCapacity,
329 setupActivated: setupActivated,
330 capacity: capacity);
331 }
332
333 #endregion
334
335 #region Helpers
336
337 private CapacityProfile CreateCapacityProfile(
338 Func<
339 int,
341 capacityProvider)
342 {
343 ArgumentNullException.ThrowIfNull(capacityProvider);
344
345 var regularCapacities =
346 new double?[SupplyChain.PlanningHorizon];
347
348 var additionalCapacities =
349 new double?[SupplyChain.PlanningHorizon];
350
351 bool isItemSpecific = false;
352
353 for (int period = 1;
355 period++)
356 {
358 capacityProvider(period);
359
360 regularCapacities[period - 1] =
361 snapshot.MaximumRegularCapacity;
362
363 additionalCapacities[period - 1] =
365
366 isItemSpecific |=
367 snapshot.IsItemSpecific;
368 }
369
370 return new CapacityProfile(
371 regularCapacities,
372 additionalCapacities,
373 isItemSpecific);
374 }
375
376 private static CapacityLoadSnapshot
377 CreateLoadSnapshot(
378 double quantity,
379 double unitCapacity,
380 double setupCapacity,
381 bool setupActivated,
383 {
384 ArgumentNullException.ThrowIfNull(capacity);
385
386 ValidateNonNegativeFiniteValue(
387 unitCapacity,
388 nameof(unitCapacity));
389
390 ValidateNonNegativeFiniteValue(
391 setupCapacity,
392 nameof(setupCapacity));
393
394 double quantityCapacity;
395
396 try
397 {
398 quantityCapacity = checked(
399 quantity * unitCapacity);
400 }
401 catch (OverflowException exception)
402 {
403 throw new InvalidOperationException(
404 "The calculated unit-capacity requirement " +
405 "exceeds the supported numerical range.",
406 exception);
407 }
408
409 double requiredCapacity =
410 quantityCapacity +
411 setupCapacity;
412
413 if (!double.IsFinite(requiredCapacity))
414 {
415 throw new InvalidOperationException(
416 "The calculated capacity requirement exceeds " +
417 "the supported numerical range.");
418 }
419
420 return new CapacityLoadSnapshot(
421 quantity,
422 unitCapacity,
423 setupCapacity,
424 setupActivated,
425 requiredCapacity,
426 capacity.MaximumRegularCapacity,
427 capacity.MaximumAdditionalCapacity,
428 capacity.IsItemSpecific);
429 }
430
431 private void ValidatePeriod(int period)
432 {
433 if (period < 1 ||
434 period > SupplyChain.PlanningHorizon)
435 {
436 throw new ArgumentOutOfRangeException(
437 nameof(period),
438 period,
439 $"The period must be between 1 and " +
440 $"{SupplyChain.PlanningHorizon}.");
441 }
442 }
443
444 private static void ValidateQuantity(
445 double quantity,
446 string parameterName)
447 {
448 ValidateNonNegativeFiniteValue(
449 quantity,
450 parameterName);
451 }
452
453 private static void ValidateNonNegativeFiniteValue(
454 double value,
455 string parameterName)
456 {
457 if (!double.IsFinite(value) ||
458 value < 0.0)
459 {
460 throw new ArgumentOutOfRangeException(
461 parameterName,
462 value,
463 "The value must be finite and non-negative.");
464 }
465 }
466
467 #endregion
468
469 /// <summary>
470 /// Represents the regular and additional capacity
471 /// available over a complete planning horizon.
472 ///
473 /// Period numbers are one-based.
474 /// </summary>
475 public sealed class CapacityProfile
476 {
477 private readonly double?[] _regularCapacities;
478 private readonly double?[] _additionalCapacities;
479
480 /// <summary>
481 /// Initializes a capacity profile over a complete
482 /// planning horizon.
483 /// </summary>
484 /// <param name="regularCapacities">
485 /// Regular-capacity limits for each planning period.
486 /// A null value means that no regular-capacity constraint
487 /// is defined for the corresponding period.
488 /// </param>
489 /// <param name="additionalCapacities">
490 /// Additional-capacity limits for each planning period.
491 /// A null value means that no additional capacity is defined.
492 /// </param>
493 /// <param name="isItemSpecific">
494 /// Indicates whether the profile comes from an
495 /// item-specific resource relationship.
496 /// </param>
498 IEnumerable<double?> regularCapacities,
499 IEnumerable<double?> additionalCapacities,
500 bool isItemSpecific)
501 {
502 ArgumentNullException.ThrowIfNull(
503 regularCapacities);
504
505 ArgumentNullException.ThrowIfNull(
506 additionalCapacities);
507
508 _regularCapacities =
509 regularCapacities.ToArray();
510
511 _additionalCapacities =
512 additionalCapacities.ToArray();
513
514 if (_regularCapacities.Length !=
515 _additionalCapacities.Length)
516 {
517 throw new ArgumentException(
518 "Regular and additional capacity series " +
519 "must have the same length.");
520 }
521
522 ValidateCapacitySeries(
523 _regularCapacities,
524 nameof(regularCapacities));
525
526 ValidateCapacitySeries(
527 _additionalCapacities,
528 nameof(additionalCapacities));
529
530 IsItemSpecific = isItemSpecific;
531 }
532
533 /// <summary>
534 /// Gets the number of periods in the profile.
535 /// </summary>
536 public int PlanningHorizon =>
537 _regularCapacities.Length;
538
539 /// <summary>
540 /// Gets a value indicating whether the capacity is
541 /// defined for a specific item-resource relationship.
542 /// </summary>
543 public bool IsItemSpecific { get; }
544
545 /// <summary>
546 /// Gets the regular capacity for a period.
547 ///
548 /// Null means that no regular-capacity constraint
549 /// is defined.
550 /// </summary>
551 public double? GetRegularCapacity(int period)
552 {
553 ValidateProfilePeriod(period);
554
555 return _regularCapacities[period - 1];
556 }
557
558 /// <summary>
559 /// Gets the additional capacity for a period.
560 ///
561 /// Null means that no additional capacity is defined.
562 /// </summary>
563 public double? GetAdditionalCapacity(int period)
564 {
565 ValidateProfilePeriod(period);
566
567 return _additionalCapacities[period - 1];
568 }
569
570 /// <summary>
571 /// Gets the total capacity for a period.
572 ///
573 /// Null means that no regular-capacity constraint
574 /// is defined.
575 /// </summary>
576 public double? GetTotalCapacity(int period)
577 {
578 double? regularCapacity =
579 GetRegularCapacity(period);
580
581 if (!regularCapacity.HasValue)
582 {
583 return null;
584 }
585
586 return regularCapacity.Value +
587 (GetAdditionalCapacity(period) ?? 0.0);
588 }
589
590 /// <summary>
591 /// Gets the sum of regular capacities over the horizon.
592 ///
593 /// Returns null when at least one period has no
594 /// regular-capacity constraint.
595 /// </summary>
596 public double? TotalRegularCapacity =>
597 SumNullableSeries(_regularCapacities);
598
599 /// <summary>
600 /// Gets the sum of additional capacities over the horizon.
601 ///
602 /// Undefined additional capacities are treated as zero.
603 /// </summary>
604 public double TotalAdditionalCapacity =>
605 _additionalCapacities.Sum(
606 value => value ?? 0.0);
607
608 /// <summary>
609 /// Gets the sum of total capacities over the horizon.
610 ///
611 /// Returns null when at least one period has no
612 /// regular-capacity constraint.
613 /// </summary>
614 public double? TotalCapacity
615 {
616 get
617 {
618 double? regular =
620
621 return regular.HasValue
622 ? regular.Value +
624 : null;
625 }
626 }
627
628 private static double? SumNullableSeries(
629 IEnumerable<double?> values)
630 {
631 double total = 0.0;
632
633 foreach (double? value in values)
634 {
635 if (!value.HasValue)
636 {
637 return null;
638 }
639
640 total += value.Value;
641
642 if (!double.IsFinite(total))
643 {
644 throw new InvalidOperationException(
645 "The capacity total exceeds the " +
646 "supported numerical range.");
647 }
648 }
649
650 return total;
651 }
652
653 private static void ValidateCapacitySeries(
654 IEnumerable<double?> capacities,
655 string parameterName)
656 {
657 foreach (double? capacity in capacities)
658 {
659 if (capacity.HasValue &&
660 (!double.IsFinite(capacity.Value) ||
661 capacity.Value < 0.0))
662 {
663 throw new ArgumentOutOfRangeException(
664 parameterName,
665 capacity,
666 "Capacity values must be finite " +
667 "and non-negative.");
668 }
669 }
670 }
671
672 private void ValidateProfilePeriod(int period)
673 {
674 if (period < 1 ||
675 period > PlanningHorizon)
676 {
677 throw new ArgumentOutOfRangeException(
678 nameof(period),
679 period,
680 $"The period must be between 1 and " +
681 $"{PlanningHorizon}.");
682 }
683 }
684 }
685
686 /// <summary>
687 /// Represents the capacity consumption and feasibility
688 /// of one activity during one planning period.
689 /// </summary>
690 public sealed class CapacityLoadSnapshot
691 {
692 /// <summary>
693 /// Initializes the result of a capacity-load calculation
694 /// for one activity and one planning period.
695 /// </summary>
696 /// <param name="quantity">
697 /// Quantity processed, stored or transported.
698 /// </param>
699 /// <param name="unitCapacity">
700 /// Capacity consumed per quantity unit.
701 /// </param>
702 /// <param name="setupCapacity">
703 /// Setup capacity included in the calculation.
704 /// </param>
705 /// <param name="setupActivated">
706 /// Indicates whether setup is activated.
707 /// </param>
708 /// <param name="requiredCapacity">
709 /// Total capacity required by the activity.
710 /// </param>
711 /// <param name="maximumRegularCapacity">
712 /// Maximum regular capacity, or null when unconstrained.
713 /// </param>
714 /// <param name="maximumAdditionalCapacity">
715 /// Maximum additional capacity, or null when unavailable.
716 /// </param>
717 /// <param name="isItemSpecificCapacity">
718 /// Indicates whether the capacity limit is item-specific.
719 /// </param>
721 double quantity,
722 double unitCapacity,
723 double setupCapacity,
724 bool setupActivated,
725 double requiredCapacity,
726 double? maximumRegularCapacity,
727 double? maximumAdditionalCapacity,
728 bool isItemSpecificCapacity)
729 {
730 ValidateNonNegativeFiniteValue(
731 quantity,
732 nameof(quantity));
733
734 ValidateNonNegativeFiniteValue(
735 unitCapacity,
736 nameof(unitCapacity));
737
738 ValidateNonNegativeFiniteValue(
739 setupCapacity,
740 nameof(setupCapacity));
741
742 ValidateNonNegativeFiniteValue(
743 requiredCapacity,
744 nameof(requiredCapacity));
745
746 ValidateNullableCapacity(
747 maximumRegularCapacity,
748 nameof(maximumRegularCapacity));
749
750 ValidateNullableCapacity(
751 maximumAdditionalCapacity,
752 nameof(maximumAdditionalCapacity));
753
754 Quantity = quantity;
755 UnitCapacity = unitCapacity;
756 SetupCapacity = setupCapacity;
757 SetupActivated = setupActivated;
758 RequiredCapacity = requiredCapacity;
759
761 maximumRegularCapacity;
762
764 maximumAdditionalCapacity;
765
767 isItemSpecificCapacity;
768 }
769
770 /// <summary>
771 /// Gets the processed quantity.
772 /// </summary>
773 public double Quantity { get; }
774
775 /// <summary>
776 /// Gets the capacity consumed per processed unit.
777 /// </summary>
778 public double UnitCapacity { get; }
779
780 /// <summary>
781 /// Gets the setup-capacity consumption included
782 /// in the calculation.
783 /// </summary>
784 public double SetupCapacity { get; }
785
786 /// <summary>
787 /// Gets a value indicating whether setup was activated.
788 /// </summary>
789 public bool SetupActivated { get; }
790
791 /// <summary>
792 /// Gets the total required capacity.
793 /// </summary>
794 public double RequiredCapacity { get; }
795
796 /// <summary>
797 /// Gets the maximum regular capacity.
798 ///
799 /// Null means that no capacity constraint is defined.
800 /// </summary>
801 public double? MaximumRegularCapacity { get; }
802
803 /// <summary>
804 /// Gets the maximum additional capacity.
805 /// </summary>
806 public double? MaximumAdditionalCapacity { get; }
807
808 /// <summary>
809 /// Gets a value indicating whether the capacity limit
810 /// belongs to an item-specific relationship.
811 /// </summary>
812 public bool IsItemSpecificCapacity { get; }
813
814 /// <summary>
815 /// Gets a value indicating whether a capacity
816 /// constraint is active.
817 /// </summary>
819 MaximumRegularCapacity.HasValue;
820
821 /// <summary>
822 /// Gets the maximum total capacity.
823 ///
824 /// Null means that no regular-capacity constraint exists.
825 /// </summary>
826 public double? MaximumTotalCapacity =>
827 MaximumRegularCapacity.HasValue
828 ? MaximumRegularCapacity.Value +
830 : null;
831
832 /// <summary>
833 /// Gets the additional capacity required beyond
834 /// the regular capacity.
835 /// </summary>
837 MaximumRegularCapacity.HasValue
838 ? Math.Max(
839 0.0,
842 : 0.0;
843
844 /// <summary>
845 /// Gets a value indicating whether regular capacity
846 /// is sufficient.
847 ///
848 /// An unconstrained resource is considered feasible.
849 /// </summary>
850 public bool FitsRegularCapacity =>
851 !MaximumRegularCapacity.HasValue ||
854
855 /// <summary>
856 /// Gets a value indicating whether additional capacity
857 /// must be used.
858 /// </summary>
860 MaximumRegularCapacity.HasValue &&
863
864 /// <summary>
865 /// Gets a value indicating whether the requirement fits
866 /// within regular plus additional capacity.
867 ///
868 /// An unconstrained resource is considered feasible.
869 /// </summary>
870 public bool FitsTotalCapacity =>
871 !MaximumTotalCapacity.HasValue ||
874
875 /// <summary>
876 /// Gets the capacity requirement exceeding the maximum
877 /// available capacity.
878 /// </summary>
879 public double CapacityExcess =>
880 MaximumTotalCapacity.HasValue
881 ? Math.Max(
882 0.0,
885 : 0.0;
886
887 /// <inheritdoc/>
888 public override string ToString()
889 {
891 {
892 return
893 $"Required capacity: {RequiredCapacity}; " +
894 "no capacity constraint";
895 }
896
897 return
898 $"Required: {RequiredCapacity}; " +
899 $"regular: {MaximumRegularCapacity}; " +
900 $"additional: " +
901 $"{MaximumAdditionalCapacity ?? 0.0}; " +
902 $"feasible: {FitsTotalCapacity}";
903 }
904
905 private static void ValidateNullableCapacity(
906 double? capacity,
907 string parameterName)
908 {
909 if (capacity.HasValue)
910 {
911 ValidateNonNegativeFiniteValue(
912 capacity.Value,
913 parameterName);
914 }
915 }
916 }
917}
Represents the capacity consumption and feasibility of one activity during one planning period.
double RequiredAdditionalCapacity
Gets the additional capacity required beyond the regular capacity.
bool IsCapacityConstrained
Gets a value indicating whether a capacity constraint is active.
bool UsesAdditionalCapacity
Gets a value indicating whether additional capacity must be used.
bool SetupActivated
Gets a value indicating whether setup was activated.
double UnitCapacity
Gets the capacity consumed per processed unit.
bool FitsRegularCapacity
Gets a value indicating whether regular capacity is sufficient.
bool FitsTotalCapacity
Gets a value indicating whether the requirement fits within regular plus additional capacity.
double? MaximumAdditionalCapacity
Gets the maximum additional capacity.
CapacityLoadSnapshot(double quantity, double unitCapacity, double setupCapacity, bool setupActivated, double requiredCapacity, double? maximumRegularCapacity, double? maximumAdditionalCapacity, bool isItemSpecificCapacity)
Initializes the result of a capacity-load calculation for one activity and one planning period.
double SetupCapacity
Gets the setup-capacity consumption included in the calculation.
double CapacityExcess
Gets the capacity requirement exceeding the maximum available capacity.
bool IsItemSpecificCapacity
Gets a value indicating whether the capacity limit belongs to an item-specific relationship.
Represents the regular and additional capacity available over a complete planning horizon.
double? TotalCapacity
Gets the sum of total capacities over the horizon.
double TotalAdditionalCapacity
Gets the sum of additional capacities over the horizon.
double? TotalRegularCapacity
Gets the sum of regular capacities over the horizon.
double? GetRegularCapacity(int period)
Gets the regular capacity for a period.
bool IsItemSpecific
Gets a value indicating whether the capacity is defined for a specific item-resource relationship.
double? GetAdditionalCapacity(int period)
Gets the additional capacity for a period.
int PlanningHorizon
Gets the number of periods in the profile.
double? GetTotalCapacity(int period)
Gets the total capacity for a period.
CapacityProfile(IEnumerable< double?> regularCapacities, IEnumerable< double?> additionalCapacities, bool isItemSpecific)
Initializes a capacity profile over a complete planning horizon.
SupplyChainQueries Queries
Gets the query service used to resolve relationships and applicable capacity parameters.
CapacityProfile GetWorkCenterCapacityProfile(WorkCenterReference workCenter)
Gets the complete capacity profile of a work center.
CapacityAnalyzer(SupplyChain supplyChain)
Initializes a capacity analyzer and creates a new supply-chain index.
void RebuildIndex()
Rebuilds the underlying entity index.
CapacityProfile GetTransportCapacityProfile(int itemId, int transportResourceId)
Gets the complete capacity profile applicable to an item transported by a transport resource.
CapacityLoadSnapshot CalculateInventoryLoad(int itemId, WarehouseReference warehouse, int period, double inventoryQuantity, bool setupActivated)
Calculates the capacity required to store a quantity of an item in a warehouse during one period.
CapacityProfile GetWarehouseCapacityProfile(WarehouseReference warehouse)
Gets the complete global capacity profile of a warehouse.
SupplyChainIndex Index
Gets the entity index used by the analyzer.
SupplyChain SupplyChain
Gets the analyzed supply chain.
CapacityLoadSnapshot CalculateProductionLoad(int itemId, WorkCenterReference workCenter, int period, double productionQuantity, bool setupActivated)
Calculates the capacity required to produce a quantity of an item on a work center during one period.
CapacityAnalyzer(SupplyChainIndex index)
Initializes a capacity analyzer using an existing index.
CapacityLoadSnapshot CalculateTransportLoad(int itemId, int transportResourceId, int period, double transportedQuantity, bool setupActivated)
Calculates the capacity required to transport a quantity of an item using a transport resource during...
CapacityProfile GetTransportResourceCapacityProfile(int transportResourceId)
Gets the complete global capacity profile of a transport resource.
CapacityProfile GetInventoryCapacityProfile(int itemId, WarehouseReference warehouse)
Gets the complete capacity profile applicable to an item stored in a warehouse.
Provides fast access to the entities contained in a supply chain.
SupplyChain SupplyChain
Gets the indexed supply chain.
Represents a serializable reference to a warehouse.
Represents a serializable reference to a work center.
Represents the maximum regular and additional capacity available during one planning period.
bool IsItemSpecific
Gets a value indicating whether the capacity is defined specifically for an item-resource relationshi...
Provides high-level read-only queries over a supply-chain model.
Represents the inventory of an item in a warehouse.
Definition Inventory.cs:20
Represents the production characteristics of an item on a specific work center.
Represents the transport characteristics of an item for a specific transport resource.
Represents the complete supply-chain data model.
int PlanningHorizon
Gets or sets the number of periods in the global planning horizon.