Simulation Model for Railway Optimization in the Brazil Southern Network

Simulation Model for Railway Optimization in the Brazil Southern Network

In the world of railway business and networks, understanding tracks and terminal connections is crucial. So, proper railway optimization makes the system, in general, work better. Simulation models provide rail companies with endless opportunities to experiment and improve their operations, test different hypotheses in a risk-free environment, and find the best solution.

Genoa is a consulting firm that helps businesses make better decisions and streamline their operations. Their approach is a combination of advanced tools, big data analysis, and simulation.

Rumo is a logistics company that operates in the railway sector. They manage a significant part of southern rail transport in Brazil, which spans 7,223 km and serves 150 terminals and 3 ports. The company moves different kinds of cargo across the country. Notably, approximately 80% of the freight transported is sourced from the agricultural sector.


For railway optimization, Genoa’s goal was to assess Rumo's rail network and quarterly planning. The solution needed to cover every detail, from the trains’ movements to a detailed map of the railway network, including loading and unloading at terminals.

Three key points to consider in the project:

  1. Each section of the network has specific characteristics that limit train sizes, maximum loads, and the number of locomotives.
  2. The railway network age, through the overall Rumo rail analysis, requires a detailed look.
  3. Seasonality in agricultural transportation directly impacts volumes and types of shipped products. Handling various agricultural goods at specific times leads to logistical challenges.


Railway frontier organization visualization

Railway frontier (click to enlarge)

Terminal agent frontier organization visualization

Terminal agent frontier (click to enlarge)

Port agent frontier organization visualization

Port agent frontier (click to enlarge)

Once Genoa's analytics team got to work, they outlined several objectives to achieve the main goal. They aimed to have a clear view of each step in the process and to determine the necessary software required for successful completion of the task.

Objectives in Rumo’s railway optimization project:

Genoa approached the railway lines as sets of block sections, with each functioning as a resource. Using AnyLogic discrete-event and agent-based simulation, they modeled the movement of trains between these sections. Discrete-event simulation helped Genoa simplify the processes into sequential events, and with agent-based modeling, they identified active entities (trains), set their behavior, and established connections.

Loaded trains depart from terminals, traveling to ports or other terminals. Different material batches are segmented between different trains due to varied factors: gross tonnage, maximum speed per track segment, and maximum train length. Upon reaching their destination, the trains unload and then return along the same route.

Railway lines as block sections

The model incorporates rules for train overtaking based on priority for different train types. For example, the Genoa team added crossing yards so trains within the same block section can travel in two opposite directions. This additional rule enables trains to pass each other safely.

Each rectangle represents a real rail line, with parallel rectangles indicating a crossing point. Each train can occupy only one block section at a time and reserves all block sections for the next crossing yard to enable safe actions with oncoming trains. After Genoa analyzed the model outputs, they highlighted two main challenges that required extra focus.

Train type issue

Due to the rail age, each train type must be carefully considered and verified in the simulation before allowing entry to a track. In each segment, railway operators set specific train chains based on track conditions. At the beginning of the move, trains attach cars and then go to the next connection point.

The Genoa team enabled train verification. At these junctions, the railway optimization model checks the train type to ensure it meets the requirements. The approach’s implementation resulted in an increase in route length and gross tonnage capacity with the minimum number of rail blocks in use.

Service gap issue

The model must calculate a service gap to pick the train yard, considering the lag between the expected volume in the terminals and the volume of loading and unloading trains.

Genoa added a GIS map to the AnyLogic model to address the issue. So, the simulation was enriched with real-to-life visualization and animation of rail transport movements in Brazil. It helped the consultants explore various strategies and develop a final algorithm to address the service gap issue.

The model of Rumo’s southern rail network in Brazil

To select the loading and unloading terminals, the model considers the gap between the expected and actual volume of goods. The load flow algorithm begins with empty trains arriving at loading terminals. Starting from an origin point, it identifies the destination terminal with the highest service gap to balance calls at unloading terminals.

For more insights on GIS maps in AnyLogic, check out the video, which offers a step-by-step guide to linking maps with models.


With the help of simulation, Genoa visualized the operational consequences of decisions. Rumo used the output data to implement new tactics for railway optimization:

Charts with the experiment output

Simulation output in charts (click to enlarge)

Moreover, thanks to the flexibility of AnyLogic, the model interface is fully customizable, allowing Rumo to design their desired network layout and amend it due to network changes.

The model helped Rumo S.A. assess the capacity of the rail network in different scenarios, get rid of structural bottlenecks, analyze the current utilization rate, and set directions for further railway optimization.

The case study was presented by Gustavo Nakano, of Genoa, at the AnyLogic Conference 2023.

The slides are available as a PDF.

Similar case studies

More case studies

Get a brochure with industry case studies