Time Based Demand Carrier
Demand carrier that delays each shipment by a per-DemandSenderIfc random transport time. Senders without a configured time are either rejected with NoCarrierOptionException or, if immediateTransportFlag is true, shipped and delivered immediately (zero simulated time).
Statistics: numInTransitResponse (time-weighted by SupplyChainModel.Demand.amountFilled) and transitTimeResponse (per-shipment transit time) are updated for every shipment.
Parameters
the parent model element
optional model-element name
See sc.transportlayer.TimeBasedDemandCarrier
Inheritors
Properties
When true, demands whose sender has no configured transport time are shipped and delivered immediately (zero simulated time) instead of throwing NoCarrierOptionException. Default false.
Read-only view of the amount-in-transit response.
Read-only view of the per-shipment transit-time response.
Functions
Side-effect-free probe: returns true iff demand would route successfully under the carrier's current configuration. A false result indicates transportDemand would either throw or silently drop the demand. Useful as a self-guard inside carrier implementations and as a configuration test from external code.
True if a transport time has been configured for sender.
Per-destination demand-shipment count, or 0 if sender is unregistered.
Record that a shipment carrying amountInTransit units has arrived after transitTime in transit: decrements the in-transit response and observes the transit time. Pairs with recordShipmentDeparture.
Record that a shipment carrying amountInTransit units has departed: increments this carrier's in-transit response. A hook for subclasses (e.g. TimeBasedLoadCarrier) that dispatch through their own path but should still feed the inherited numInTransitResponse / transitTimeResponse. Pair every call with a later recordShipmentArrival of the same amount.
Create the per-destination shipment / weight / cube counters for sender if they do not yet exist. KSL forbids new ModelElements after the executive starts, so this is a construction-time operation. Call it for any destination that may receive a shipment under immediateTransportFlag without a configured transport time — otherwise the per-destination counters never get created and the increments in transportDemand silently no-op (audit finding D). setTransportTime already calls this.
Register (or replace) the transport-time distribution used for sender. The supplied distribution is wrapped in a new RandomVariable (per porting plan §4.1) the first time the sender is added; subsequent calls swap the underlying source.
Per-destination cumulative weight of all shipments sent to sender in the current replication (post-warmup), or null if sender is unregistered. In this base class, the shipment unit is a single demand, so the accumulator sums demand.weight across every transportDemand(demand) call. Subclasses (TimeBasedLoadCarrier) override to attribute load-level weight instead.
Transport demand from its origin to its destination.
Lookup hook for subclasses that need to schedule shipments on the same per-sender distributions (e.g. TimeBasedLoadCarrier dispatching load shipments).