© noelsch / Pixabay
Образователни технологии
SIMULATION-BASED MODELING OF URBAN TRAFFIC INTERSECTIONS: METHODOLOGY, EDUCATIONAL APPLICATIONS AND EXPERIMENTAL SCENARIOS
https://doi.org/10.53656/math2027-1-4-sbm
Резюме. This paper presents a comprehensive study on simulation-based modeling of urban traffic intersections, with emphasis on methodology, experimental scenarios, and educational applications. Building upon a detailed AnyLogic agent-based model, the research investigates the impact of traffic light cycles and varying vehicle arrival rates on congestion and traffic flow. Three experimental scenarios were simulated, revealing the relationships between interarrival rates, average travel times, vehicle stops, and traffic throughput. The findings demonstrate that simulation provides a cost-effective and risk-free method for analyzing complex urban traffic systems and for testing optimization strategies. The results show that increasing the vehicle arrival-rate parameter from 10 to 100 reduced the average vehicle speed from approximately 15 km/h to 3 km/h and increased the average travel time from about 200 s to 350 s, indicating the onset of traffic saturation. Vehicle stops and congestion levels also increased, indicating that the system approaches saturation at high demand levels. Beyond its engineering contribution, the study highlights significant educational value: students and educators can conduct experiments that would be impossible in real traffic networks due to safety or logistic constraints, thereby linking mathematical theory with practical applications and fostering analytical and critical thinking.
Ключови думи: optimization; simulation; agent-based modeling; traffic light control; AnyLogic; educational applications.
1. Introduction
Modeling and simulation are widely used in science and engineering to analyze and predict the behavior of complex real-world systems. Simulation is a computer-based representation of dynamic processes that enables safe and cost-effective experimentation and the evaluation of alternative solutions (Banks et al., 2010; Law, 2015). In urban mobility, simulation is an essential tool for s tudying traffic flow, congestion, and emissions, supporting both research and education (Fellendorf & Vortisch, 2010).
Urban intersections are key points in a city’s transport infrastructure where different traffic streams meet. Vehicle and pedestrian movement are influenced by traffic signal control, road design, traffic demand, and priority rules, which affect travel time, fuel consumption, and road safety. However, because of the complexity of traffic systems – including different road users, changing traffic conditions, and coordinated signal control—real-world experimentation is difficult, costly, and potentially disruptive. Classical analytical methods rarely capture this complexity, whereas simulation provides a flexible and repeatable environment for testing traffic control strategies without disrupting the real network or endangering its users (Helbing et al., 2001; Lopez et al., 2018).
Agent-based modeling has become an important simulation approach in which vehicles, pedestrians, and traffic control devices are represented as autonomous agents with their own behavior. This bottom-up approach allows complex system dynamics to emerge from simple local interactions (Macal & North, 2010). Multi-method platforms such as AnyLogic combine agent-based modeling, discrete-event simulation, and system dynamics, enabling realistic modeling at different levels of abstraction. Previous studies have demonstrated the applicability of AnyLogic to queueing systems, healthcare processes, and other complex dynamic systems (Stojkovikj et al., 2017; Stojkovikj et al., 2022; Stojkovikj et al., 2018).
Beyond its engineering applications, simulation has significant educational value. It is widely recognized as an effective tool for STEM education because it promotes active learning, critical thinking, and the connection between mathematical concepts and real-world applications (De Jong & Van Joolingen, 1998; Alessi & Trollip, 2001; Prince & Felder, 2006). Through virtual experiments, students can investigate “what-if” scenarios, observe the effects of parameter changes, and develop interdisciplinary skills (Makransky et al., 2019). Traffic simulation is particularly valuable because it allows safe testing of scenarios that would be difficult or impossible to study in real traffic, such as changes in vehicle arrival rates, traffic light timing, or large-scale disruptions.
This paper presents a simulation model of a four-way urban intersection developed in AnyLogic to investigate the effects of traffic light timing and vehicle interarrival rates on average travel time, average speed, number of stops, and traffic throughput. Three experimental scenarios are analyzed and compared. In addition to the technical results, the paper discusses the educational value of traffic simulation and its integration into mathematics and informatics curricula for training future professionals in smart-city and intelligent transport systems.
2. Methodology and Model Description
2.1 Introduction to the Model
The traffic simulation model balances realism and simplicity, providing credible results while remaining efficient for repeated experiments. It represents typical urban infrastructure, models each vehicle as an autonomous agent with individual characteristics, allows real-time adjustment of traffic signal timings, and automatically records key performance indicators such as average travel time, average speed, vehicle stops, and intersection throughput.
The model was developed in AnyLogic 8.9.5, using its agent-based capabilities, Road Traffic library, experiment management, visualization, and statistical tools. Vehicles are generated by CarSource blocks and removed by CarDispose blocks. Traffic lights are coordinated through a Traffic Light Controller with adjustable red-light durations (pX_WE, pX_NO, pX_LE, pX_DE, pX_DSD). Performance is evaluated using TimeMeasureStart/End, Dataset, Dynamic Chart, and Count components.
2.2 Physical Layout and Infrastructure
The model represents two interconnected four-way intersections linked by a short arterial segment where vehicles can accumulate under heavy traffic. The first (upper) intersection includes a west-to-east one-way street, a parking area generating pedestrian traffic, a north-south two-way street connecting to the second intersection, an east-to-west one-way street, and a south approach from the main road. Straight and right turns are permitted, and a traffic light controls the pedestrian crossing. The second (lower) intersection consists of the continuation of the north-south two-way street, an east-to-west one-way street with left, right, and straight movements, a south approach allowing straight and left turns, and a west entry.
This configuration, illustrated in Fig. 1, captures key features of an urban crossroads while remaining compact enough for controlled simulati on experiments.
Figure 1. Layout of the simulated urban road network with two connected intersections in AnyLogic
2.3 Detailed Description of Model Elements
• Vehicle Generators (CarSource Blocks)
Each entry point of the simulated road network is represented by a CarSource block that generates cars, trucks, and buses. Vehicle arrivals are modeled either by an ex ponential distribution, representing stochastic and independent traffic demand, or by fixed interarrival times, providing controlled traffic conditions for comparing different signal-control strategies.
• Traffic Light Control (TrafficLight)
Traffic lights regulate vehicle and pedestrian movement through a synchronized five-phase signal-control strategy applied to both intersections. The phase sequence and permitted movements are presented in Table 1, while Figure 2 illustrates the corresponding signal cycle. The model includes TrafficLight objects for each intersection approach and pedestrian crossing. Green, yellow, and red times are initially set to 30 s, 5 s, and 30 s, respectively, and can be adjusted using slider controls to evaluate different signal-timing strategies and their effects on traffic flow and congestion.
Table 1. Signal phases applied to both intersections.
Figure 2. Five-phase traffic signal cycle used at both intersections.
The phase plan is simplified and represents the implemented control logic used for experimental comparison rather than a complete real-world signal-control program. The yellow interval represents a clearance phase between conflicting traffic movements and does not include an additional all-red interval.
• Pedestrian Agents (Pedestrian, PedestrianSource, Delay)
Pedestrian agents are generated in the parking area using the PedestrianSource block. Each pedestrian moves autonomously toward the crosswalk, where the control logic temporarily stops the cor responding vehicle traffic to simulate pedestrian–vehicle interactions. The crossing time follows a Uniform(5,10) s distribution, representing typical variability in pedestrian walking speeds and crossing behavior.
• Parking Logic
The parking area is modeled with a Delay block (“ waiting”), where parking duration follows a Triangular(15, 30, 35) min distribution. After this period, vehicles either re-enter the road network through a SelectOutput block or leave the system. Pedestrians are generated from vehicles that temporarily stop in the parking area.
• Road Network (RoadNetworkDescriptor)
The RoadNetworkDescriptor object defines the road network geometry, lane configuration, and permitted movement directions. It also provides the road-segment coordinates used by MoveTo blocks to guide vehicles to their next destinations. Vehicle arrivals, pedestrian crossing times, and parking durations were modeled using probability distributions selected according to the characteristics of each process. The distributions, their parameters, and the rationale for their selection are summarized in Table 2.
Table 2. Probability Distributions and Parameters
The specific vehicle arrival-rate values used in the experimental scenarios are presented in Section 3. Higher values indicate higher traf fic inflow intensity.
2.4 Logical Connectivity
Vehicles generated by each CarSource follow MoveTo blocks through the road network. Depending on traffic conditions, they may queue at traffic lights, stop for pedestrians, enter or leave the parking area, or continue along the main road. Due to the close prox imity of the two intersections, congestion at one quickly affects the other. Figure 3 shows the CarSource and PedestrianSource blocks, TrafficLight controls, parking logic, and measurement components used to record key performance indicators.
Figure 3. Process logic of vehicle and pedestrian flows in AnyLogic
2.5 Congestion Phenomena and Mitigation Measures
Traffic congestion in the model emerges from the interactions between high vehicle arrival rates, limited traffic light capacity, pedestrian interruptions, and slow-moving heavy vehicles.
Key causes: High vehicle density with short green-signal durations – queues exceed the available green time, causing spillback; pedestrian priority interruptions – frequent pedestrian crossings force vehicles to stop even during the green signal; influence of trucks and buses – their larger size and lower speed reduce lane capacity; coupled intersections – congestion at one intersection propagates to the other.
Mitigation measures tested in the model: Optimization of signal cycles by extending green-signal durations for dominant traffic flows and implementing adaptive traffic control strategies; Coordination of traffic lights – establishing “green waves” across both intersections; Regulation of pedestrian inflow – limiting pedestrian priority windows to reduce interruptions; Limiting heavy vehicle frequency – reducing the proportion of trucks and buses to increase throughput; Alternative routing – diverting specific traffic streams to alleviate load on the main road.
The specific model parameters modified for each mitigation measure are summarized in Table 3.
Table 3. Mitigation Measures and Corresponding Model Changes
These changes were implemented through the corresponding AnyLogic parameters and sliders, allowing comparison between the baseline configuration and the modified mitigation scenarios.
3. Results and Discussion
This section analyzes the effect of different vehicle arrival rates on overall traffic performance.
The simulation implements an exponential arrival proce ss, where interarrivalRate1 represents the vehicle arrival rate controlling the intensity of traffic inflow. Higher values of this parameter correspond to higher traffic demand and a larger number of vehicles entering the network during the simulation period.
Three scenarios were tested:
Scenario 1 – interarrivalRate1 = 10, Scenario 2 – interarrivalRate1 = 50, and Scenario 3 – interarrivalRate1 = 100
3.1 Scenario 1 – interarrivalRate1 = 10
This scenario serves as the baseline configuration for comparison with the remaining experimental scenarios.
Figure 4. System indicators for Scenario 1: a) Number of Vehicles, b) Stops per Vehicle, c) Average Speed (km/h), d) Average Time in System (seconds)
Key observations: The number of vehicles gradually increases from about 160 to over 220, indicating sufficient network capacity without congestion. The average number of stops remains nearly constant, decreasing slightly from 3.15 to 3.14. Average speed increases from about 4 km/h to nearly 15 km/h, while average travel time decreases from around 300 s to about 200 s, indicating efficient traffic flow and improved network performance.
Conclusion for Scenario 1: The network operates stably with minimal to moderate delays. Traffic light timing is adequate to sustain smooth flow without critical congestion.
3.2 Scenario 2 – interarrivalRate1 = 50
Figure 5. System indicators for Scenario 2: a) Number of Vehicles, b) Stops per Vehicle, c) Average Speed (km/h), d) Average Time in System (seconds)
This scenario represents increased traffic demand through a higher vehicle arrival rate. The total number of vehicles increases from approximately 210 to over 250, but the network remains operationally stable without critical congestion. The average number of stops remains nearly constant at around 3.42. Average speed increases from about 4 km/h to 11–12 km/h, although more slowly than in Scenario 1 because of the higher traffic density. At the same time, average travel time decreases from about 320 s to 220 s, indicating improved traffic flow, although the improvement is smaller than in Scenario 1.
Conclusion for Scenario 2
The traffic system is under greater operational pressure compared to Scenario 1, but it still has sufficient capacity to process the incoming flow without severe congestion.
Further optimization of the traffic light cycles could enhance throughput and help maintain stable operation as demand grows.
3.3 Scenario 3 – interarrivalRate1 = 100
Figure 6. System indicators for Scenario 3: a) Number of Vehicles, b) Stops per Vehicle, c) Average Speed (km/h), d) Average Time in System (seconds)
This scenario represents the highest traffic demand conditions examined in the study and illustrates the onset of network saturation. The increased vehicle arrival rate results in a substantial growth of traffic volume, causing congestion, lower travel speeds, and longer travel times throughout the network.
Key observations: The number of vehicles increases to about 260 before falling to around 180, indicating that the system reaches saturation and then partially clears. The average number of stops rises slightly from about 3.42 to 3.46, reflecting more frequent interruptions. Average speed drops sharply from about 8–9 km/h to 3 km/h, indicating severe congestion, while average travel time increases from about 200 s to nearly 350 s, almost twice that observed in Scenario 1.
Conclusion for Scenario 3
This experiment clearly demonstrates traffic system saturation. The high vehicle arrival rate causes long delays, lower speeds, and increased travel times, highlighting the limits of the current intersection configuration and the need for adaptive traffic control or infrastructure improvements.
3.4 Comparative Analysis
A comparison of the three simulated scenarios leads to the following conclusions:
Scenario 1 remains stable and optimal.
Scenario 2 is at the edge of stability but still functions acceptably.
Scenario 3 exceeds the stability threshold, resulting in severe congestion. Increasing interarrivalRate1 raises the number of vehicles in the system, reducing average speed and increasing travel time as the intersections reach capacity.
3.5 Recommendations
To avoid the congestion observed in Scenario 3, the following measures are recommended: optimizing traffic light timings to match traffic demand, implementing adaptive signal control, limiting vehicle inflow during peak periods, and redirecting traffic to alternative routes.
4. Educational Value and Applications
4.1. Educational Role of Simulation
The AnyLogic simulation model presented in this study was developed by the authors and subsequently used as an educational platform for student experimentation and learning activities.
Simulation is a powerful educational tool in mathematics, informatics, and engineering because it enables students to investigate complex real-world systems in a safe and controlled environment. By constructing, running, and modifying simulation models, students can explore system behavior, test hypotheses, and develop analytical and problem-solving skills that are difficult to achieve through traditional teaching alone. Research has shown that simulation-based learning promotes active learning and supports collaborative and competency-based education (Popel et al., 2018; Nikolova et al., 2024).
The proposed traffic simulation demonstrates how mathematical models and informatics methods can be transformed into interactive learning experiences. Students can modify vehicle arrival rates (10, 50, and 100), traffic light timing, and pedestrian-crossing conditions, and observe their effects on average travel time, average speed, vehicle stops, and intersection throughput. These experiments help students better understand probability distributions, queuing theory, traffic flow dynamics, and traffic control strategies while gaining practical experience with agent-based modeling, discrete-event simulation, and data analysis.
Since real-world traffic experiments are often expe nsive, unsafe, and disruptive, simulation provides an effective alternative for education and research. Previous studies have also shown that AnyLogic-based simulation environments improve students' understanding of dynamic systems and support active, interdisciplinary learning in STEM education (Stojkovikj et al., 2024; Markova et al. , 2018; Popel et al., 2018).
4.2. Advantages of Simulation-Based Learning in Traffic Engineering
The educational benefits of simulation in traffic engineering extend beyond theoretical modeling:
• Safety and Risk-Free Experimentation.
Students can reproduce critical traffic scenarios, such as extreme congestion or signal-timing failures, without endangering people or property.
• Cost Efficiency.
Running hundreds of scenarios requires only computational resources, avoiding the financial and logistical burdens of field experiments.
• Precise Control of Variables.
Simulation allows for accurate manipulation of parameters (arrival rates, signal timings, network topology) and repeated trials, supporting rigorous experimental and statistical analysis.
• Immediate Visual Feedback.
Animated and interactive models help students visualize traffic flow, queue formation, and congestion, reinforcing theoretical concepts through practical exploration. These features make simulation an effective tool for teaching urban traffic systems and preparing future transportation engineers and data scientists.
In addition to its safety, cost-effectiveness, and controlled environment, simulation offers several educational advantages.
• Rich Laboratory Experience.
University courses can integrate simulation as a laboratory component, where students design, test, and optimize traffic networks. Such labs cultivate experimental design and data analysis skills, aligning with contemporary STEM education goals (Clark & Mayer, 2016; Ma & Nickerson, 2006).
• Support for Inquiry-Based Projects.
Students can develop their own scenarios, such as emergency rerouting or adaptive signal control, collect data, and compare alternative strategies, fostering creativity and independent research (Smetana & Bell, 2012).
• Bridging Theory and Practice.
Mathematical models of queuing, probability distributions, and network flow are transformed into interactive environments that connect theory with real-world transport systems.
Thus, simulation is more than a visualization tool – it promotes critical thinking, experimentation, and interdisciplinary skills essential for students in mathematics, informatics, and engineering.
4.3. Integration into Mathematics and Informatics Education
Simulation is a valuable tool for integrating mathematics and informatics education. By developing and testing models, students apply mathematical concepts, such as stochastic processes and optimization, together with informatics skills, including algorithm design, agent-based modeling, and data analysis. Research has shown that simulation-based learning improves conceptual understanding and promotes active learning (Rutten, van Joolingen & van der Veen, 2012).
Simulation can be integrated into education through semester projects, workshops, or blended courses that combine theory with practical modeling activities. Previous studies have demonstrated the successful use of AnyLogic in teaching queueing systems, agent-based models, and other complex dynamic processes (Stojkovikj et al., 2017; Stojkovikj et al., 2018; Stojkovikj et al., 2024). In addition, simulation enables students to safely explore scenarios that would be impractical or unsafe to test in real life, such as severe traffic congestion or signal failures (De Jong & Van Joolingen, 1998).
5. Conclusion
The urban-intersection simulation model proved to be an effective tool for analyzing traffic behavior under different vehicle arrival rates. Using exponentially distributed arrivals, it identified a clear capacity threshold beyond which traffic performance rapidly declined. Under low demand, the network operated efficiently with average speeds of about 15 km/h and travel times of around 200 s. Under the highest demand, speeds dropped to approximately 3 km/h, while travel times increas ed to about 350 s, indicating severe congestion and the limitations of fixed-cycle signal control. These results highlight the need for adaptive traffic management or infrastructure improvements under heavy traffic conditions.
Beyond traffic analysis, the model supports the evaluation of traffic control strategies and provides valuable educational opportunities by allowing students to explore complex systems through simulation. Future work will include additional real-world factors, integration of real-time traffic data, machine-learning-based adaptive signal control, and the extension of the model to networks of multiple intersections.
REFERENCES
Alessi, S. M., Trollip, S. R. (2001). Multimedia for learning: Methods and development. 3rd ed. Boston: Allyn and Bacon.
Banks, J., Carson, J. S., Nelson, B.L., Nicol, D. M. (2010). Discrete-Event System Simulation. 5th ed. Upper Saddle River, NJ: Prentice Hall.
Clark, R. C., Mayer, R. E. (2016). E-Learning and the Science of Instruction. 4th ed. Hoboken: Wiley.
De Jong, T., Van Joolingen, W.R. (1998). Scientific discovery learning with computer simulations of conceptual domains. Review of Educational Research, 68(2), 179 – 201.
Djahel, S., Doolan, R., Muntean, G.-M., Murphy, J. (2015). A communications-oriented perspective on traffic management systems for smart cities: challenges and innovative approaches. IEEE Communications Surveys & Tutorials, 17(1), 125 – 151.
Fellendorf, M., Vortisch, P. (2010). Microscopic Traffic Flow Simulator VISSIM. In: J. Barceló (ed.). Fundamentals of Traffic Simulation. New York: Springer, 63 – 93.
Helbing, D., Farkas, I., Vicsek, T. (2001). Simulating dynamical features of escape panic. Nature, 407 (6803), 487 – 490.
Law, A. M. (2015). Simulation Modeling and Analysis. 5th ed. New York: McGraw-Hill.
Lopez, P. A., Behrisch, M., Bieker-Walz, L., Erdmann, J., Flötteröd, Y.-P., Hilbrich, R., Lücken, L., Rummel, J., Wagner, P., Wießner, E. (2018). Microscopic traffic simulation using SUMO. 2018 21st International IEEE Conference on Intelligent Transportation Systems (ITSC) , 2575 – 2582.
Macal, C., North, M. (2010). Tutorial on agent-ba sed modelling and simulation. Journal of Simulation, 4(3), 151 – 162.
Ma, J., Nickerson, J. V. (2006). Hands-on, simulated, and remote laboratories: A comparative literature review. ACM Computing Surveys, 38 (3), Article 7.
Makransky, G., Terkildsen, T. S., Mayer, R. E. (2019). Adding immersive virtual reality to a science lab simulation causes more presence but less learning. Learning and Instruction, (60), 1 – 12.
Markova, O., Semerikov, S., Popel, M. (2018). CoCalc as a Learning Tool for Neural Network Simulation in the Special Course “Foundations of Mathematical Informatics”. arXiv preprint arXiv:1807.00795.
Nikolova, N., Zafirova-Malcheva, T., et al. (2024). Development of digital competences in the Bulgarian secondary school context – a literature review of good practices. Frontiers in Education, 9, 1434797.
Popel, M., Shokalyuk, S., Shyshkina, M. (2018). The Learning Technique of the SageMathCloud Use for Students Collaboration Support. arXiv preprint arXiv:1807.01120.
Prince, M. J., Felder, R. M. (2006) . Inductive teaching and learning methods: Definitions, comparisons, and research bases. Journal of Engineering Education, 95(2), 123 – 138.
Rutten, N., Van Joolingen, W. R., Van Der Veen, J. T. (2012). The learning effects of computer simulations in science education. Computers & Education, 58(1), 136 – 153.
Smetana, L. K., Bell, R. L. (2012). Computer simulations to support science instruction and learning: A critical review of the literature. International Journal of Science Education, 34(9), 1337 – 1370.
Stojkovikj, N., Stojanova, A., Kocaleva, M., Zlatanovska, B., Karamazova Gelova, E. (2017). Simulation of Queuing System based on AnyLogic. In: ITRO 2017, Zrenjanin, Serbia, 22 June 2017.
Stojkovikj, N., Stojanova Ilievska, A., Koceva Lazarova, L., Martinovska Bande, C. (2018). Modeling of Some Chaotic Systems with AnyLogic Software. TEM Journal, 7(2), 465 – 470.
Stojkovikj, N., Koceva Lazarova, L., Dimitrievska Ristovska, V., Kukuseva, M., Stojanova Ilievska, A. (2022). Analysis, Modeling and Simulation of Emergency Department. In: Proceedings of the VI International Scientific Conference Mathematical Modeling, Borovets, Bulgaria.
Stojkovikj, N. , Koceva Lazarova, L., Stojanova Ilievska, A., Martinovska Bande, C. (2024). Application of Agent-Based Modelling in Learning Process. Informatica, 48(17), 11 – 20.