4using System.Threading.Tasks;
5using LotSizingDataModel.Core.PhysicalModel;
6using LotSizingDataModel.Core.Relationships;
7using LotSizingDataModel.Instance;
24 "transportResourceCapacity";
31 LotSizingInstance instance,
34 ArgumentNullException.ThrowIfNull(instance);
35 ArgumentNullException.ThrowIfNull(options);
38 options.IncludeTransport &&
39 instance.SupplyChain.TransportResources.Any(
41 resource.CapacityConstraint is not
null);
48 LotSizingInstance instance,
51 CancellationToken cancellationToken)
53 foreach (TransportResource resource
54 in instance.SupplyChain.TransportResources)
56 if (resource.CapacityConstraint is
null)
61 TransportCharacteristic[] characteristics =
62 instance.SupplyChain.TransportCharacteristics
65 characteristic.TransportResourceId ==
70 period <= instance.PlanningHorizon;
73 cancellationToken.ThrowIfCancellationRequested();
78 foreach (TransportCharacteristic characteristic
81 foreach (AssignedTransportLane lane
in instance.SupplyChain.GetTransportLanes(resource.Id))
86 characteristic.ItemId,
92 context.GetVariable(transportKey),
93 characteristic.UnitCapacityConsumption?[period] ??
97 characteristic.SetupTime?[period] ??
106 characteristic.ItemId,
111 if (context.VariableRegistry.TryGet(
114 setupVariable is not
null)
124 string additionalKey =
127 .TransportResourceAdditionalCapacity)
136 if (context.VariableRegistry.TryGet(
139 additionalVariable is not
null)
147 $
"transportResourceCapacity_r{resource.Id}" +
151 resource.CapacityConstraint[period],
153 "Global transport-resource capacity " +
158 return ValueTask.CompletedTask;
161 private static string CreateKey(
165 AssignedTransportLane lane,
Provides a fluent builder for linear expressions.
Builds stable business-domain keys for mathematical variables and constraints.
string Build()
Builds the immutable domain-key text.
MathematicalDomainKeyBuilder Add(string name, string value)
Adds a text segment.
Provides the shared state required while constructing a solver-independent mathematical model.
Creates canonical domain-key fragments shared by standard formulation builders and provides warehouse...
static MathematicalDomainKeyBuilder AddDestinationWarehouse(MathematicalDomainKeyBuilder builder, WarehouseReference warehouse)
Adds a destination warehouse reference.
static MathematicalDomainKeyBuilder AddOriginWarehouse(MathematicalDomainKeyBuilder builder, WarehouseReference warehouse)
Adds an origin warehouse reference.
Provides the canonical mathematical domain-key categories used to identify lot-sizing decision famili...
const string Transport
Identifies transported-quantity decision variables.
Provides the canonical mathematical domain-key segment names used by lot-sizing variables and constra...
const string TransportResource
Transport-resource identifier segment.
const string Item
Item or product identifier segment.
const string Period
Period index segment.
Represents one decision variable in a mathematical optimization model.
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.