This section is structured into two main parts. First, the conceptual model of the adaptive real-time planning framework is introduced, highlighting its integration of Industry 4.0 technologies with mathematical optimization. This section outlines the cyber–physical decision-support loop, data flow, and predictive analytics that form the foundation of the system. Second, the mathematical model is presented in detail, including the formal definitions of sets, parameters, decision variables, constraints, and the objective function. Together, these sections provide both the theoretical foundations and the formalized optimization framework necessary for the adaptive assignment of trailers to docks in high-throughput cross-docking terminals.
3.1. Conceptual Model
Figure 5 illustrates the conceptual framework of the proposed adaptive real-time planning system, which integrates Industry 4.0 technologies with mathematical optimization (MILP solved with Matlab R2025b). The system is designed as a cyber–physical decision-support loop, where digital data streams from the physical environment are continuously collected, processed, and transformed into actionable operational decisions.
At the first stage, IoT and sensor networks deployed throughout the cross-docking terminal monitor key operational parameters, such as trailer arrivals, dock occupancy, gate availability, handling progress, and unexpected disruptions (e.g., vehicle delays or equipment breakdowns). These data are transmitted in real time into a centralized data stream management system, ensuring that the decision-support layer always has the most recent information.
In the second stage, machine learning models are applied to generate predictive insights from the incoming data. For example, expected times of arrival (ETA) for inbound trailers can be estimated based on live traffic conditions, while the probability of delays or disruptions can be inferred from historical patterns. These predictive outputs provide a forward-looking dimension to the decision-making process, enabling the system not only to react to events as they occur but also to anticipate and prepare for potential disruptions.
The third stage is the mathematical optimization layer, where the updated and enriched data serve as input to a Mixed-Integer Linear Programming (MILP) model implemented in Matlab. The MILP formulation captures the trailer-to-dock assignment problem with constraints such as dock capacity, time windows, processing times, precedence relations between inbound and outbound flows, and resource availability. Depending on the operational priorities, the model can minimize trailer idle times, reduce delays, maximize dock utilization, or balance multiple performance criteria. Matlab solves the optimization problem under strict time limits, producing feasible and near-optimal solutions within seconds. Warm-start techniques and rolling-horizon optimization further ensure that the solver can be re-executed frequently as new data arrive, maintaining real-time responsiveness.
The output of the optimization step is a set of dynamic dock assignments, specifying in real time which trailer should be allocated to which dock and when. These assignments are communicated to the operational floor via terminal information systems such as large-screen displays, mobile applications for drivers, or automated gate-control systems. This creates a closed feedback loop. When new events occur in the physical system (e.g., a trailer arriving late), the sensors update the data stream, predictions are recalculated, the optimization is re-run, and revised dock assignments are generated almost instantly.
This tight integration between Industry 4.0 technologies (IoT, real-time data analytics, machine learning) and optimization methods (MILP solved in Matlab) provides a robust and adaptive decision-support system for high-throughput cross-docking terminals. By continuously sensing, predicting, and optimizing in real time, the system embodies the principles of Industry 4.0 and offers a pathway toward significantly enhanced operational efficiency, responsiveness, and resilience in next-generation logistics hubs.
The Data & Intelligence Layer (
Figure 6) plays a central role in transforming heterogeneous Industry 4.0 data streams into structured, actionable information that can be used by the optimization engine. It ensures that the optimization model is not only driven by raw sensor data but also enriched with predictive insights derived from advanced analytics and machine learning techniques. This layer can be divided into five sequential steps.
Raw Data Sources: The process begins with the continuous acquisition of raw data from multiple origins. IoT sensors monitor dock occupancy, door status, and the availability of handling equipment in real time. GPS and RFID systems provide updates on trailer locations and expected arrivals. In addition, external feeds such as traffic congestion reports and weather forecasts supply contextual information that often affects arrival reliability and handling performance. While this diversity of sources ensures a holistic view of the terminal environment, it also introduces heterogeneity and noise.
Data Preprocessing: Since raw operational data is often incomplete or inconsistent, preprocessing is essential. At this stage, erroneous signals are filtered out, missing values are estimated or imputed, and data are normalized to align different scales and units. Through these transformations, the system ensures that subsequent analytics operate on consistent and reliable inputs.
Feature Extraction: Once cleaned, the data is enriched with engineered features that capture higher-level operational characteristics. From GPS trajectories, trailer speed profiles are derived, while traffic data is used to estimate congestion levels. Historical logs provide insights into recurring delay patterns, and operational records yield workload indicators such as trailer density per dock or operator utilization across shifts. These abstractions allow predictive models to detect complex patterns that cannot be inferred from raw data alone.
Machine Learning Predictions: Using the extracted features, specialized machine learning models generate predictive insights that extend the time horizon of situational awareness. These models forecast estimated times of arrival for inbound trailers, quantify the probability of delays under varying conditions, and estimate handling times based on workload intensity and historical performance. The predictive layer thus converts static operational snapshots into forward-looking intelligence, enabling the system not only to react but also to anticipate.
Model Inputs to MILP: Finally, the predictions are translated into structured parameters for the optimization model. Forecasted arrival times are represented as time-window constraints, expected handling times become service-duration parameters, dock availability is modeled as resource capacity, and delay risk indicators are incorporated either as penalty coefficients or robustness terms in the objective function. In this way, the MILP optimization layer receives inputs that are simultaneously current and predictive, equipping it to generate adaptive and resilient trailer-to-dock assignment plans.
3.2. Mathematical Model
This section presents a detailed mathematical model for the adaptive real-time assignment of trailers to docks in high-throughput cross-docking terminals. For each set of constraints and the objective function, we provide both the formal mathematical formulation and an explanatory interpretation.
Sets and indices used in the model are the followings:
: set of inbound trailers (index i),
: set of outbound trailers (index o),
: set of inbound docks (index d),
: set of outbound docks (index d),
: discrete time slots (index t), each slot has a length , e.g., 5 min,
Parameters used in the model are the followings:
: arrival time slot of inbound trailer i,
: processing duration of inbound trailer i (in slots),
: arrival time slot of outbound trailer o,
: processing duration of outbound trailer o (in slots),
: availability of inbound dock d at time t,
: availability of outbound dock d at time t,
: precedence relation ( if outbound o requires inbound i to be completed first),
: deadline (latest desired completion) for inbound i,
: deadline for outbound o,
: maximum allowed waiting time for inbound i,
: maximum allowed waiting time for outbound o,
: maximum allowed tardiness for inbound i,
: maximum allowed tardiness for inbound o,
: compatibility ( if inbound i can be processed at dock d),
: compatibility ( if outbound o can be processed at dock d),
: weights for the objective function,
: length of a time slot (in minutes).
The decision variables of the optimization problem are the followings:
: if inbound i starts processing at dock d in time slot t, otherwise ,
: if outbound o starts processing at dock d in time slot t, otherwise ,
: start time of inbound i,
: completion time of inbound i,
: start time of outbound o,
: completion time of outbound o,
: tardiness of inbound i,
: tardiness of outbound o.
The objective balances three operational goals: minimizing the waiting time of inbound trailers, minimizing tardiness of inbound trailers, and minimizing tardiness of outbound trailers. By tuning the weights α and β, operators can emphasize inbound efficiency or outbound service level.
where
is the weighting factor for inbound delays,
is the starting time slot of inbound operation i,
is the arrival time slot of inbound trailer i,
is the tardiness of inbound i,
is the weighting factor for outbound delays,
is the starting time slot of outbound operation o,
is the arrival time slot of outbound trailer o,
is the tardiness of outbound o,
and
.
The first summation penalizes inbound trailers that remain idle after their arrival, representing under-utilization of resources. The second term measures inbound tardiness, capturing late completion of inbound operations relative to deadlines. The third term measures outbound tardiness, directly affecting the service level for outbound deliveries. The objective is additive, so each trailer contributes independently, which makes the trade-offs transparent and tunable.
Constraint 1 defines the single start constraint. Each trailer can only start processing once, either at a single dock and a single time slot. This constraint prevents multiple assignments of the same trailer.
where decision variable
indicated, whether inbound trailer
i starts processing at dock d in time slot t,
is the set of inbound docks, decision variable
indicated, whether inbound trailer
o starts processing at dock
d in time slot
t, and
is the set of outbound docks.
These inequalities ensure that each inbound trailer is assigned to at most one inbound dock and each outbound trailer to at most one outbound dock.
Constraint 2 defines the start, completion, and arrival related conditions. The start and completion times of each trailer are defined as linear functions of the binary assignment variables. Trailers cannot begin processing before their arrival time.
where
is the completion time slot of inbound
i,
is the processing duration of inbound trailer
i (in time slots), where
is the completion time slot of outbound
o,
is the processing duration of outbound trailer
o (in time slots).
These constraints tie the abstract decision variables to real operations. For example, if an inbound trailer starts at time t, its completion is determined by its processing duration. The ‘−1’ ensures correct inclusive counting of discrete slots.
Constraint 3 focuses on dock capacity. Each dock can serve at most one trailer at a time, and only if it is available. The coverage-based formulation accounts for ongoing processing across multiple slots.
where
is the availability of inbound dock
d at time
t, and
is the availability of outbound dock
d at time
t.
If a trailer starts earlier and overlaps with the current slot t, it is considered active. The dock availability parameter u enforces planned closures or pre-reservations, preventing usage during those slots.
Constraint 4 considers the precedence-relations. Some outbound trailers depend on the completion of specific inbound trailers. These precedence constraints capture synchronization of material flows across docks.
where
is the precedence relation.
If trailer o requires trailer i, then o cannot start until i has finished. This ensures logical consistency between inbound unloading and outbound loading activities.
Constraint 5 focuses on tardiness. Tardiness variables measure the extent to which a trailer misses its deadline. They are defined relative to completion time and due date.
where
: is the deadline (latest desired completion) for inbound i,
is the deadline for outbound
o,
is the tardiness of inbound
i, and
is the tardiness of outbound
o.
If completion occurs before the due date, tardiness is zero. Otherwise, tardiness is the positive difference. This formulation linearizes the function.
Constraint 6 takes the maximum waiting time into consideration. Waiting time is the difference between trailer arrival and actual start. This constraint enforces an upper bound to avoid excessive queuing in the yard.
where
is the maximum allowed waiting time slot for inbound
i, and
is the maximum allowed waiting time slot for outbound
o.
By restricting waiting, the model reflects operational policies such as limited yard space or customer service commitments.
Constraint 7 focuses on maximum tardiness. Besides penalizing tardiness in the objective, hard upper bounds may be set to enforce service level guarantees.
where
is the maximum allowed tardiness for inbound
i, and
is the maximum allowed tardiness for inbound
o.
This ensures that no trailer can exceed its maximum permissible delay, regardless of trade-offs in the objective.
Constraint 8 focuses on the compatibility of docks. Not every trailer can be served at every dock. Compatibility matrices restrict assignments to feasible dock-trailer pairs.
where
is the compatibility of inbound trailer
i and inbound dock
d,
is the compatibility of outbound trailer
o and outbound dock
d.If a trailer is not compatible with a dock, the binary parameter A forces all assignment variables for that pair to zero. This captures real-world constraints such as size limits, equipment requirements, or hazardous material handling.
In the proposed MILP formulation, the transportation phase is considered external to the scheduling process. Accordingly, the arrival time (ETA) of each trailer is used as an input parameter rather than being derived from distance or travel speed. This design choice allows the model to operate in real time: as soon as an updated ETA becomes available, reflecting traffic congestion, routing decisions, or time-of-day effects; the scheduling is re-optimized without modifying the underlying formulation.