AI and Simulation for Container Yard Planning

AI and Simulation for Container Yard Planning


Today, around 80% of global trade by volume is carried by sea and handled by intermodal ports and terminals worldwide. With the increase of global transportation, intermodal facilities are being redesigned to expand capacity and fulfill demand. At the same time, it is necessary to keep the facilities safe and efficient, which is why operating companies are looking for ways to test changes before implementation.

Terminal San Giorgio in Genoa, Italy, planned the reorganization of their facility’s layout and operations, aiming to increase its throughput and make the terminal safer. They needed a port simulator – a digital twin of the terminal, which would serve as a testbed for container yard planning and help predict how the changes would affect the current operations.

As simulation is a natural technology for creating such digital copies of complex environments, the management contracted this project to container terminal simulation engineers from MEVB Consulting, a Swiss developer of simulation-based decision support systems. Using the container terminal simulation approach, the contractors would be able to mirror both physical and operational activities in an interactive environment and capture detailed dynamic workflows.

For the container terminal simulation, the engineers chose AnyLogic modeling software for the following reasons:


To create the digital twin, the engineers needed to collect information on how people, containers, and vehicles moved around the terminal. For that, they equipped employees with mobile phones to track their position in the terminal continuously. This way, it was possible to see people entering and leaving certain areas, as well as their movement between them. For containers and trailers, they provided beacons that transmitted their exact locations through GPS to an in-house tracking system.

Simulation of a port with AnyLogic

The container terminal simulation engineers used this information to build an accurate digital twin that was fed with data gathered from the environment. In total, they were able to display in the port simulator the movement of 20,000 interconnected objects, including ships and cargo trains. To speed up simulation, they used AnyLogic Material Handling Library and its ready-to-use elements.

The last step of model building was to connect the container terminal simulation model to Microsoft Project Bonsai. This AI platform allowed for easier deep reinforcement learning based on data from the simulation models. The engineers hoped that the AI brain would make decisions for the managers, or, at least, propose solutions using simulation data at different steps of cargo processing.

Testing evacuation scenario

When the container terminal simulation model was ready, the engineers wanted to stress-test the current layout and operations. The engineers split the model into zones, and in some of them, initiated possible evacuation scenarios which could happen in case of fire propagation or an explosion.

To find optimal evacuation paths, they relied on the model’s AI opportunities. The algorithm analyzed all possible paths from the dangerous zone to safe ones, considering the evolution of the emergency and the ongoing processes in the port. A variety of emergency evolution scenarios were run with AnyLogic Cloud to speed up the simulation. As a result, the algorithm proposed optimal evacuation paths to safe areas and assigned them to each agent.

Port simulator with AnyLogic

Then, the engineers used the output data to test the evacuation paths in real life. They simulated a dangerous situation in one of the zones and communicated the signal to the evacuation system connected with the container terminal digital twin. In response, the digital twin found the safe zones nearby and communicated their locations to the system. The system then sent a phone alert to people in the evacuation area with a personalized evacuation plan guiding them to safe areas.

Area management using AI

The container terminal simulation model was also used to improve terminal throughput. When trucks arrive at the parking area to collect or pass on a container, managers assign them a parking spot. Their decisions, however, are usually based on the current situation at the port and do not consider possible breakages, truck latencies, or emergency situations. This might result in inefficient usage of parking space and decreased throughput.

To improve management decisions, the engineers simulated and optimized truck boarding and disembarking operations – one of the cargo processing steps – using AI capabilities. Improvements in this area would help increase terminal throughput by minimizing processing time and making the operations more fluid.

Container terminal simulation with AnyLogic

Container terminal simulation with AnyLogic

The engineers proposed that the AI brain could orchestrate truck allocation and make simulation-based decisions autonomously. Gaining input from the digital twin of the terminal, it would rely on aggregated data and predict where to best allocate the trucks with regards to the planned shipments.

Terminal throughput depended heavily on other terminal operations, which is why the engineers expanded the current digital twin with the model of the parking area. In particular, in the model of the truck-related logistics operations, the engineers reflected:

It took some time for the AI brain to learn the historic data from the container terminal simulation model and what policies were implemented for truck allocation. When the learning phase was over, the model was continuously fed with new data related to the shipments, and the brain decided where to allocate the incoming trucks.


The engineers created a decision-support system which helped them build a reliable evacuation strategy for emergency situations and improve the safety of the terminal. The system can recalculate paths to safe zones on the fly when accidents occur and communicate the paths to the in-house alert tool, which, in turn, sends direction notifications to employees in the field.

The engineers also showed that AI capabilities coupled with simulation would improve the overall terminal throughput by 20%. The learning AI algorithms can make use of aggregated historic data to improve truck allocation strategies and provide more insights for terminal throughput optimization. When the engineers looked at the decisions made by the algorithms, they were similar to those made by the managers. This proves the fact that AI-based decision making can be later implemented at the terminal and propagated across other cargo processing steps for their further improvement.

Project presentation by Roberto Revetria from MEVB at the AnyLogic Conference 2021:

Similar case studies

More case studies

Get a brochure with industry case studies