LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
SupplyChain.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Xml.Serialization;
11
13
14/// <summary>
15/// Represents the complete supply-chain data model.
16///
17/// This class is the XML root of the model. It contains:
18/// - the global planning horizon;
19/// - the logical subsystem;
20/// - the physical subsystem;
21/// - the relationships between both subsystems;
22/// - the associated decision-model parameters.
23/// </summary>
24[Serializable]
25[XmlRoot("supplyChain")]
26[XmlType(TypeName = "supplyChain")]
27public sealed partial class SupplyChain :
30{
31 private int _planningHorizon;
33 _periodicOperatingExpenditureBudget;
35 _objectivePolicy;
36
37 /// <summary>
38 /// Initializes an empty supply chain.
39 ///
40 /// This public parameterless constructor is required
41 /// by <see cref="XmlSerializer"/>.
42 /// </summary>
43 public SupplyChain()
44 {
45 }
46
47 /// <summary>
48 /// Initializes an empty supply chain with the specified
49 /// planning horizon.
50 /// </summary>
51 /// <param name="planningHorizon">
52 /// Non-negative number of planning periods.
53 /// </param>
54 public SupplyChain(int planningHorizon)
55 {
56 PlanningHorizon = planningHorizon;
57 }
58
59 /// <summary>
60 /// Gets or sets the number of periods in the global
61 /// planning horizon.
62 ///
63 /// Changing this value resizes every period-dependent
64 /// parameter already contained in the supply chain.
65 /// </summary>
66 [XmlAttribute("planningHorizon")]
67 public int PlanningHorizon
68 {
69 get => _planningHorizon;
70 set => ResizeTimeSeries(value);
71 }
72
73 /// <summary>
74 /// Gets or sets the period operating-expenditure budget.
75 /// </summary>
76 [XmlElement("periodicOperatingExpenditureBudget")]
79 {
80 get => _periodicOperatingExpenditureBudget;
81 set
82 {
83 if (ReferenceEquals(
84 _periodicOperatingExpenditureBudget,
85 value))
86 {
87 return;
88 }
89
90 if (_periodicOperatingExpenditureBudget is not null)
91 {
92 _periodicOperatingExpenditureBudget.PropertyChanged -=
93 OnFinancialParameterPropertyChanged;
94 }
95
96 _periodicOperatingExpenditureBudget = value;
97
98 if (_periodicOperatingExpenditureBudget is not null)
99 {
100 if (PlanningHorizon > 0)
101 {
102 _periodicOperatingExpenditureBudget
103 .ResizeTimeSeries(PlanningHorizon);
104 }
105
106 _periodicOperatingExpenditureBudget.PropertyChanged +=
107 OnFinancialParameterPropertyChanged;
108 }
109
110 OnPropertyChanged(
112 OnPropertyChanged(
114 }
115 }
116
117 /// <summary>
118 /// Gets or sets the explicit business objective policy.
119 /// Null preserves the historical single economic objective.
120 /// </summary>
121 [XmlElement("objectivePolicy")]
123 {
124 get => _objectivePolicy;
125 set
126 {
127 if (ReferenceEquals(_objectivePolicy, value))
128 {
129 return;
130 }
131
132 value?.EnsureValid();
133 _objectivePolicy = value;
134 OnPropertyChanged(nameof(ObjectivePolicy));
135 }
136 }
137
138 #region Logical subsystem
139
140 /// <summary>
141 /// Gets the items present in the supply chain.
142 /// </summary>
143 [XmlArray("items")]
144 [XmlArrayItem("item")]
145 public List<Item> Items { get; } = new();
146
147 /// <summary>
148 /// Gets the bill-of-material component requirements.
149 /// </summary>
150 [XmlArray("componentRequirements")]
151 [XmlArrayItem("componentRequirement")]
152 public List<ComponentRequirement> ComponentRequirements
153 {
154 get;
155 } = new();
156
157 #endregion
158
159 #region Physical subsystem
160
161 /// <summary>
162 /// Gets the plants in the supply chain.
163 ///
164 /// Each plant contains its own warehouse and work centers.
165 /// </summary>
166 [XmlArray("plants")]
167 [XmlArrayItem("plant")]
168 public List<Plant> Plants { get; } = new();
169
170 /// <summary>
171 /// Gets the warehouses that are not attached to a plant.
172 /// </summary>
173 [XmlArray("standaloneWarehouses")]
174 [XmlArrayItem("standaloneWarehouse")]
175 public List<StandaloneWarehouse> StandaloneWarehouses
176 {
177 get;
178 } = new();
179
180 /// <summary>
181 /// Gets the suppliers in the supply chain.
182 /// </summary>
183 [XmlArray("suppliers")]
184 [XmlArrayItem("supplier")]
185 public List<Supplier> Suppliers { get; } = new();
186
187 /// <summary>
188 /// Gets the distribution centers in the supply chain.
189 /// </summary>
190 [XmlArray("distributionCenters")]
191 [XmlArrayItem("distributionCenter")]
192 public List<DistributionCenter> DistributionCenters
193 {
194 get;
195 } = new();
196
197 /// <summary>
198 /// Gets the transport resources in the supply chain.
199 ///
200 /// Authorized lanes are defined by the central transport assignments.
201 /// </summary>
202 [XmlArray("transportResources")]
203 [XmlArrayItem("transportResource")]
204 public List<TransportResource> TransportResources
205 {
206 get;
207 } = new();
208
209 #endregion
210
211 #region Logical-physical relationships
212
213 /// <summary>
214 /// Gets the production routings.
215 /// </summary>
216 [XmlArray("productionRoutings")]
217 [XmlArrayItem("productionRouting")]
218 public List<ProductionRouting> ProductionRoutings
219 {
220 get;
221 } = new();
222
223 /// <summary>
224 /// Gets the item-work-center production characteristics.
225 /// </summary>
226 [XmlArray("productionCharacteristics")]
227 [XmlArrayItem("productionCharacteristic")]
228 public List<ProductionCharacteristic> ProductionCharacteristics
229 {
230 get;
231 } = new();
232
233 /// <summary>
234 /// Gets the item-warehouse inventories.
235 /// </summary>
236 [XmlArray("inventories")]
237 [XmlArrayItem("inventory")]
238 public List<Inventory> Inventories { get; } = new();
239
240 /// <summary>
241 /// Gets the item-transport-resource characteristics.
242 /// </summary>
243 [XmlArray("transportCharacteristics")]
244 [XmlArrayItem("transportCharacteristic")]
245 public List<TransportCharacteristic> TransportCharacteristics
246 {
247 get;
248 } = new();
249
250 /// <summary>
251 /// Gets the demands expressed by distribution centers.
252 /// </summary>
253 [XmlArray("demands")]
254 [XmlArrayItem("demand")]
255 public List<Demand> Demands { get; } = new();
256 /// <summary>
257 /// Gets optional additional-sales opportunities.
258 /// </summary>
259 [XmlArray("salesOptions")]
260 [XmlArrayItem("salesOption")]
261 public List<SalesOption> SalesOptions { get; } = new();
262
263 /// <summary>
264 /// Gets the warehouse sourcing options available
265 /// to distribution centers.
266 /// </summary>
267 [XmlArray("distributionCenterSourcings")]
268 [XmlArrayItem("distributionCenterSourcing")]
269 public List<DistributionCenterSourcing>
271 {
272 get;
273 } = new();
274
275 /// <summary>
276 /// Gets the supplier delivery possibilities.
277 /// </summary>
278 [XmlArray("supplierDeliveries")]
279 [XmlArrayItem("supplierDelivery")]
280 public List<SupplierDelivery> SupplierDeliveries
281 {
282 get;
283 } = new();
284
285 #endregion
286
287 #region Calculated properties
288
289 /// <summary>
290 /// Enumerates every warehouse in the supply chain,
291 /// including plant warehouses and standalone warehouses.
292 /// </summary>
293 [XmlIgnore]
294 public IEnumerable<Warehouse> Warehouses
295 {
296 get
297 {
298 foreach (Plant plant in Plants)
299 {
300 yield return plant.Warehouse;
301 }
302
303 foreach (StandaloneWarehouse warehouse
305 {
306 yield return warehouse;
307 }
308 }
309 }
310
311 /// <summary>
312 /// Enumerates every work center in the supply chain.
313 /// </summary>
314 [XmlIgnore]
315 public IEnumerable<WorkCenter> WorkCenters =>
316 Plants.SelectMany(plant => plant.WorkCenters);
317
318 /// <summary>
319 /// Gets a value indicating whether all active time series
320 /// use the global planning horizon.
321 ///
322 /// A local horizon of zero means that the corresponding
323 /// object does not currently contain any active time series.
324 /// </summary>
325 [XmlIgnore]
327 GetPlanningHorizonAwareObjects().All(
328 modelObject =>
329 modelObject.PlanningHorizon == 0 ||
330 modelObject.PlanningHorizon ==
332
333 #endregion
334
335 #region Add methods
336
337 /// <summary>
338 /// Adds an item and rejects duplicate item identifiers.
339 /// </summary>
340 public void AddItem(Item item)
341 {
342 AddUnique(
343 Items,
344 item,
345 existing => existing.Id == item.Id,
346 nameof(Items),
347 $"An item with identifier {item.Id} already exists.");
348 }
349
350 /// <summary>
351 /// Adds a bill-of-material component requirement.
352 /// </summary>
354 ComponentRequirement requirement)
355 {
356 AddUnique(
358 requirement,
359 existing =>
360 existing.ParentItemId ==
361 requirement.ParentItemId &&
362 existing.ComponentItemId ==
363 requirement.ComponentItemId,
364 nameof(ComponentRequirements),
365 "A component requirement already exists for " +
366 "this parent-item/component-item pair.");
367 }
368
369 /// <summary>
370 /// Adds a plant and synchronizes its time-dependent data
371 /// with the global planning horizon.
372 /// </summary>
373 public void AddPlant(Plant plant)
374 {
375 AddUnique(
376 Plants,
377 plant,
378 existing => existing.Id == plant.Id,
379 nameof(Plants),
380 $"A plant with identifier {plant.Id} already exists.");
381 }
382
383 /// <summary>
384 /// Adds a standalone warehouse.
385 /// </summary>
387 StandaloneWarehouse warehouse)
388 {
389 AddUnique(
391 warehouse,
392 existing => existing.Id == warehouse.Id,
393 nameof(StandaloneWarehouses),
394 "A standalone warehouse with identifier " +
395 $"{warehouse.Id} already exists.");
396 }
397
398 /// <summary>
399 /// Adds a supplier.
400 /// </summary>
401 public void AddSupplier(Supplier supplier)
402 {
403 AddUnique(
404 Suppliers,
405 supplier,
406 existing => existing.Id == supplier.Id,
407 nameof(Suppliers),
408 $"A supplier with identifier {supplier.Id} already exists.");
409 }
410
411 /// <summary>
412 /// Adds a distribution center.
413 /// </summary>
415 DistributionCenter distributionCenter)
416 {
417 AddUnique(
419 distributionCenter,
420 existing =>
421 existing.Id == distributionCenter.Id,
422 nameof(DistributionCenters),
423 "A distribution center with identifier " +
424 $"{distributionCenter.Id} already exists.");
425 }
426
427 /// <summary>
428 /// Adds a transport resource.
429 /// </summary>
431 TransportResource transportResource)
432 {
433 AddUnique(
435 transportResource,
436 existing =>
437 existing.Id == transportResource.Id,
438 nameof(TransportResources),
439 "A transport resource with identifier " +
440 $"{transportResource.Id} already exists.");
441 }
442
443 /// <summary>
444 /// Adds a production routing.
445 /// </summary>
447 ProductionRouting routing)
448 {
449 AddUnique(
451 routing,
452 existing => existing.Id == routing.Id,
453 nameof(ProductionRoutings),
454 "A production routing with identifier " +
455 $"{routing.Id} already exists.");
456 }
457
458 /// <summary>
459 /// Adds an item-work-center production characteristic.
460 /// </summary>
462 ProductionCharacteristic characteristic)
463 {
464 AddUnique(
466 characteristic,
467 existing =>
468 existing.ItemId == characteristic.ItemId &&
469 SameWorkCenter(
470 existing.WorkCenter,
471 characteristic.WorkCenter),
473 "A production characteristic already exists " +
474 "for this item and work center.");
475 }
476
477 /// <summary>
478 /// Adds an inventory relationship.
479 /// </summary>
480 public void AddInventory(Inventory inventory)
481 {
482 AddUnique(
484 inventory,
485 existing =>
486 existing.ItemId == inventory.ItemId &&
487 SameWarehouse(
488 existing.Warehouse,
489 inventory.Warehouse),
490 nameof(Inventories),
491 "An inventory already exists for this item " +
492 "and warehouse.");
493 }
494
495 /// <summary>
496 /// Adds an item-transport-resource characteristic.
497 /// </summary>
499 TransportCharacteristic characteristic)
500 {
501 AddUnique(
503 characteristic,
504 existing =>
505 existing.ItemId == characteristic.ItemId &&
506 existing.TransportResourceId ==
507 characteristic.TransportResourceId,
509 "A transport characteristic already exists " +
510 "for this item and transport resource.");
511 }
512
513 /// <summary>
514 /// Adds a demand relationship.
515 /// </summary>
516 public void AddDemand(Demand demand)
517 {
518 AddUnique(
519 Demands,
520 demand,
521 existing =>
522 existing.ItemId == demand.ItemId &&
523 existing.DistributionCenterId ==
525 nameof(Demands),
526 "A demand already exists for this item " +
527 "and distribution center.");
528 }
529 /// <summary>
530 /// Adds an optional additional-sales relationship.
531 /// </summary>
532 public void AddSalesOption(SalesOption salesOption)
533 {
534 AddUnique(
536 salesOption,
537 existing =>
538 existing.ItemId == salesOption.ItemId &&
539 existing.DistributionCenterId ==
540 salesOption.DistributionCenterId,
541 nameof(SalesOptions),
542 "A sales option already exists for this item " +
543 "and distribution center.");
544 }
545
546 /// <summary>
547 /// Adds a distribution-center sourcing relationship.
548 /// </summary>
551 {
552 AddUnique(
554 sourcing,
555 existing =>
556 existing.DistributionCenterId ==
557 sourcing.DistributionCenterId &&
558 existing.ItemId == sourcing.ItemId &&
559 SameWarehouse(
560 existing.Warehouse,
561 sourcing.Warehouse),
563 "A sourcing relationship already exists for " +
564 "this distribution center, item and warehouse.");
565 }
566
567 /// <summary>
568 /// Adds a supplier delivery relationship.
569 /// </summary>
571 SupplierDelivery delivery)
572 {
573 AddUnique(
575 delivery,
576 existing =>
577 existing.SupplierId == delivery.SupplierId &&
578 existing.ItemId == delivery.ItemId &&
579 SameWarehouse(
580 existing.Warehouse,
581 delivery.Warehouse),
582 nameof(SupplierDeliveries),
583 "A supplier delivery already exists for this " +
584 "supplier, item and warehouse.");
585 }
586
587 #endregion
588
589 #region Planning-horizon management
590
591 /// <summary>
592 /// Changes the global planning horizon and resizes every
593 /// active time series contained in the supply chain.
594 ///
595 /// Existing values are preserved whenever possible.
596 /// </summary>
597 /// <param name="periodCount">
598 /// New non-negative number of planning periods.
599 /// </param>
600 public void ResizeTimeSeries(int periodCount)
601 {
602 if (periodCount < 0)
603 {
604 throw new ArgumentOutOfRangeException(
605 nameof(periodCount),
606 periodCount,
607 "The planning horizon cannot be negative.");
608 }
609
610 // Cascade the resize to every period-dependent object.
611 foreach (IPlanningHorizonAware modelObject
612 in GetPlanningHorizonAwareObjects())
613 {
614 modelObject.ResizeTimeSeries(periodCount);
615 }
616
617 bool horizonChanged =
618 _planningHorizon != periodCount;
619
620 // Update the internal field.
621 _planningHorizon = periodCount;
622
623 if (horizonChanged)
624 {
625 OnPropertyChanged(nameof(PlanningHorizon));
626 }
627
628 OnPropertyChanged(
630 }
631
632 /// <summary>
633 /// Forces every active time series to use the current
634 /// global planning horizon.
635 ///
636 /// This method is useful after XML deserialization or after
637 /// direct modifications of the exposed collections.
638 /// </summary>
640 {
641 foreach (IPlanningHorizonAware modelObject
642 in GetPlanningHorizonAwareObjects())
643 {
644 modelObject.ResizeTimeSeries(
646 }
647
648 OnPropertyChanged(
650 }
651
652 /// <summary>
653 /// Enumerates every object containing period-dependent data.
654 /// </summary>
655 private IEnumerable<IPlanningHorizonAware>
656 GetPlanningHorizonAwareObjects()
657 {
659 {
661 }
662
663 foreach (Plant plant in Plants)
664 {
665 yield return plant.Warehouse;
666
667 foreach (WorkCenter workCenter
668 in plant.WorkCenters)
669 {
670 yield return workCenter;
671 }
672 }
673
674 foreach (StandaloneWarehouse warehouse
676 {
677 yield return warehouse;
678 }
679
680 foreach (TransportResource resource
682 {
683 yield return resource;
684 }
685
686 foreach (ProductionSetupFamily setupFamily
688 {
689 yield return setupFamily;
690 }
691
692 foreach (ProductionRouting routing
694 {
695 yield return routing;
696 }
697
698 foreach (ProductionCharacteristic characteristic
700 {
701 yield return characteristic;
702 }
703
704 foreach (Inventory inventory in Inventories)
705 {
706 yield return inventory;
707 }
708
709 foreach (TransportCharacteristic characteristic
711 {
712 yield return characteristic;
713 }
714
715 foreach (Demand demand in Demands)
716 {
717 yield return demand;
718 }
719 foreach (SalesOption salesOption in SalesOptions)
720 {
721 yield return salesOption;
722 }
723 if (CashFlowPolicy is not null)
724 {
725 yield return CashFlowPolicy;
726 }
727
728 foreach (DistributionCenterSourcing sourcing
730 {
731 yield return sourcing;
732 }
733
734 foreach (SupplierDelivery delivery
736 {
737 yield return delivery;
738 }
739 }
740
741 #endregion
742
743 #region Private helpers
744
745 private void OnFinancialParameterPropertyChanged(
746 object? sender,
747 System.ComponentModel.PropertyChangedEventArgs e)
748 {
749 OnPropertyChanged(
751 OnPropertyChanged(
753 }
754
755
756
757 /// <summary>
758 /// Adds an object to a collection after checking uniqueness
759 /// and synchronizing its period-dependent data.
760 /// </summary>
761 private void AddUnique<T>(
762 List<T> collection,
763 T value,
764 Func<T, bool> duplicatePredicate,
765 string propertyName,
766 string duplicateMessage)
767 where T : class
768 {
769 ArgumentNullException.ThrowIfNull(value);
770
771 // Reject duplicates based on the supplied predicate.
772 if (collection.Any(duplicatePredicate))
773 {
774 throw new InvalidOperationException(
775 duplicateMessage);
776 }
777
778 // Synchronize period-dependent data with the global horizon.
779 SynchronizeNewObject(value);
780
781 collection.Add(value);
782
783 OnPropertyChanged(propertyName);
784 OnPropertyChanged(
786 }
787
788 /// <summary>
789 /// Synchronizes a newly added object with the current
790 /// planning horizon.
791 /// </summary>
792 private void SynchronizeNewObject(object value)
793 {
794 /*
795 * A zero horizon represents an uninitialized model.
796 * Existing parameter values are therefore preserved
797 * until a positive horizon is explicitly assigned.
798 */
799 if (PlanningHorizon == 0)
800 {
801 return;
802 }
803
804 // Special handling for Plant: resize its warehouse and all work centers.
805 if (value is Plant plant)
806 {
807 plant.Warehouse.ResizeTimeSeries(
809
810 foreach (WorkCenter workCenter
811 in plant.WorkCenters)
812 {
813 workCenter.ResizeTimeSeries(
815 }
816
817 return;
818 }
819
820 // General case: resize any IPlanningHorizonAware object.
821 if (value is IPlanningHorizonAware
822 planningHorizonAware)
823 {
824 planningHorizonAware.ResizeTimeSeries(
826 }
827 }
828
829 private static bool SameWarehouse(
830 WarehouseReference? first,
831 WarehouseReference? second)
832 {
833 // Null-safe: both null = equal, only one null = not equal.
834 if (first is null || second is null)
835 {
836 return first is null && second is null;
837 }
838
839 return first.Kind == second.Kind &&
840 first.ReferenceId == second.ReferenceId;
841 }
842
843 private static bool SameWorkCenter(
844 WorkCenterReference? first,
845 WorkCenterReference? second)
846 {
847 // Null-safe: both null = equal, only one null = not equal.
848 if (first is null || second is null)
849 {
850 return first is null && second is null;
851 }
852
853 return first.PlantId == second.PlantId &&
854 first.WorkCenterId == second.WorkCenterId;
855 }
856
857 #endregion
858}
int Id
Gets or sets the numerical identifier of the entity.
Base class for model objects that notify listeners when one of their properties changes.
Represents the maximum modeled operating expenditure allowed in each planning period.
Declares the business objective policy independently from any particular mathematical scalarization i...
Represents a bill-of-materials relationship between two items.
int ParentItemId
Gets or sets the identifier of the item being manufactured.
int ComponentItemId
Gets or sets the identifier of the required component.
Represents a finished or semi-finished item handled by the supply chain.
Definition Item.cs:15
Represents a distribution center in the supply chain.
Represents a production plant.
Definition Plant.cs:19
List< WorkCenter > WorkCenters
Gets or sets the work centers belonging to the plant.
Definition Plant.cs:88
PlantWarehouse Warehouse
Gets or sets the warehouse attached to the plant.
Definition Plant.cs:65
Represents a standalone warehouse that is not attached to a plant.
int Id
Gets or sets the numerical identifier of the standalone warehouse.
Represents a supplier in the supply chain.
Definition Supplier.cs:16
A transport resource with its own shared capacities and costs.
int ReferenceId
Gets or sets the referenced identifier.
Represents a production work center belonging to a plant.
Definition WorkCenter.cs:15
void ResizeTimeSeries(int periodCount)
Resizes every active period-dependent parameter.
int WorkCenterId
Gets or sets the identifier of the referenced work center.
Represents the demand for an item issued by a distribution center.
Definition Demand.cs:22
int ItemId
Gets or sets the identifier of the requested item.
Definition Demand.cs:70
int DistributionCenterId
Gets or sets the identifier of the distribution center issuing the demand.
Definition Demand.cs:96
Represents the ability of a distribution center to source a given item from a given warehouse invento...
int DistributionCenterId
Gets or sets the identifier of the distribution center that can obtain the item from the referenced i...
WarehouseReference Warehouse
Gets or sets the warehouse holding the inventory from which the distribution center can obtain the it...
int ItemId
Gets or sets the identifier of the item contained in the referenced inventory.
Represents the inventory of an item in a warehouse.
Definition Inventory.cs:20
int ItemId
Gets or sets the identifier of the item stored in the warehouse.
Definition Inventory.cs:115
WarehouseReference Warehouse
Gets or sets the warehouse storing the item.
Definition Inventory.cs:141
Represents the production characteristics of an item on a specific work center.
WorkCenterReference WorkCenter
Gets or sets the referenced work center.
int ItemId
Gets or sets the identifier of the item manufactured on the referenced work center.
Represents a production routing used to manufacture an item in a plant through one or more work cente...
Represents optional additional sales beyond mandatory demand.
Represents the ability of a supplier to deliver a given item to a given warehouse inventory.
int SupplierId
Gets or sets the identifier of the supplier.
int ItemId
Gets or sets the identifier of the delivered item.
WarehouseReference Warehouse
Gets or sets the warehouse receiving the item.
Represents the transport characteristics of an item for a specific transport resource.
int ItemId
Gets or sets the identifier of the item transported by the referenced transport resource.
int TransportResourceId
Gets or sets the identifier of the transport resource associated with the item.
List< Inventory > Inventories
Gets the item-warehouse inventories.
PeriodicOperatingExpenditureBudget? PeriodicOperatingExpenditureBudget
Gets or sets the period operating-expenditure budget.
void AddInventory(Inventory inventory)
Adds an inventory relationship.
void AddPlant(Plant plant)
Adds a plant and synchronizes its time-dependent data with the global planning horizon.
List< TransportResource > TransportResources
Gets the transport resources in the supply chain.
List< SupplierDelivery > SupplierDeliveries
Gets the supplier delivery possibilities.
List< DistributionCenterSourcing > DistributionCenterSourcings
Gets the warehouse sourcing options available to distribution centers.
void AddSalesOption(SalesOption salesOption)
Adds an optional additional-sales relationship.
void AddDemand(Demand demand)
Adds a demand relationship.
void AddTransportCharacteristic(TransportCharacteristic characteristic)
Adds an item-transport-resource characteristic.
List< ProductionCharacteristic > ProductionCharacteristics
Gets the item-work-center production characteristics.
List< SalesOption > SalesOptions
Gets optional additional-sales opportunities.
int PlanningHorizon
Gets or sets the number of periods in the global planning horizon.
void AddSupplierDelivery(SupplierDelivery delivery)
Adds a supplier delivery relationship.
bool HasConsistentPlanningHorizon
Gets a value indicating whether all active time series use the global planning horizon.
void ResizeTimeSeries(int periodCount)
Changes the global planning horizon and resizes every active time series contained in the supply chai...
void SynchronizePlanningHorizon()
Forces every active time series to use the current global planning horizon.
void AddDistributionCenter(DistributionCenter distributionCenter)
Adds a distribution center.
List< TransportCharacteristic > TransportCharacteristics
Gets the item-transport-resource characteristics.
CashFlowPolicy? CashFlowPolicy
Gets or sets optional cash-flow and solvency semantics.
void AddProductionRouting(ProductionRouting routing)
Adds a production routing.
List< ProductionRouting > ProductionRoutings
Gets the production routings.
IEnumerable< WorkCenter > WorkCenters
Enumerates every work center in the supply chain.
List< StandaloneWarehouse > StandaloneWarehouses
Gets the warehouses that are not attached to a plant.
List< Plant > Plants
Gets the plants in the supply chain.
void AddSupplier(Supplier supplier)
Adds a supplier.
SupplyChain(int planningHorizon)
Initializes an empty supply chain with the specified planning horizon.
void AddItem(Item item)
Adds an item and rejects duplicate item identifiers.
IEnumerable< Warehouse > Warehouses
Enumerates every warehouse in the supply chain, including plant warehouses and standalone warehouses.
List< ComponentRequirement > ComponentRequirements
Gets the bill-of-material component requirements.
void AddStandaloneWarehouse(StandaloneWarehouse warehouse)
Adds a standalone warehouse.
List< Item > Items
Gets the items present in the supply chain.
void AddComponentRequirement(ComponentRequirement requirement)
Adds a bill-of-material component requirement.
void AddProductionCharacteristic(ProductionCharacteristic characteristic)
Adds an item-work-center production characteristic.
void AddDistributionCenterSourcing(DistributionCenterSourcing sourcing)
Adds a distribution-center sourcing relationship.
OptimizationObjectivePolicy? ObjectivePolicy
Gets or sets the explicit business objective policy. Null preserves the historical single economic ob...
List< DistributionCenter > DistributionCenters
Gets the distribution centers in the supply chain.
List< Supplier > Suppliers
Gets the suppliers in the supply chain.
SupplyChain()
Initializes an empty supply chain.
List< Demand > Demands
Gets the demands expressed by distribution centers.
void AddTransportResource(TransportResource transportResource)
Adds a transport resource.
Defines a model object containing data indexed by planning period.
void ResizeTimeSeries(int periodCount)
Resizes every time-dependent series contained in the object.
@ StandaloneWarehouse
The reference identifies a standalone warehouse through its own warehouse identifier e.