Research on simulation and optimization of road traffic flow based on Anylogic

. With the development of urban roads and the growth of traffic flow, large-scale congestion often occurs. The long time-consuming urban road traffic makes drivers very annoying. This is the main reason for using simulation tools to analyze and optimize urban road traffic flow. Intelligent body modeling and simulation has been regarded as a reliable and powerful tool in the field of traffic simulation. This paper uses Anylogic software based on intelligent modeling and simulation to solve the traffic flow optimization problem in a congested area in Tianjin. The simulation results show that by changing the display time of the traffic lights in the road network, the vehicle travel time in the system is reduced from 145.46 seconds to 132.31 seconds. After 300 iterations of experiments, it was determined that the vehicle's travel time in the system reached the optimum when iterated 73 times.


Introduction
Urban traffic infrastructure plays an important role in the development of any city.The good operation of urban traffic flow has a positive impact on the lives of residents in congested areas.In the past decade, many scholars have proposed a wide range of problems based on intelligent traffic planning.The literature proves that agent based modeling can reproduce the complexity of urban area and predict the emergency of the area.For the field of traffic simulation, agent based modeling and simulation has been considered as a reliable and powerful tool, which can be used by urban planners to establish and evaluate the scenario of urban traffic simulation.
The advantages of computer simulation technology in the field of transportation are becoming more and more prominent.In the application of traffic simulation, the traffic simulation scene built by computer is becoming more and more complex, and the basic data model created is huge and complex, which makes the simulation application require a fast increase in the computing power of the computer processor [1].Mohsen Kamrani et al. used Arena simulation software to simulate the traffic flow of two adjacent T-junctions without signal lights during peak hours [2].Hu Haibo studied the signal light setting basis of Y-shaped multi Lane intersection, and simulated it with VISSIM software [3].Kong Junwei used VISSIM software to study the influence of signal light duration on the queue length of road traffic vehicle flow [4].Ma Shengtao studied the influence of different traffic accident types on the propagation law of traffic jam by using Anylogic simulation software [5].In this paper, the agent is established by using Anylogic simulation software to study the influence of traffic signal duration setting on the micro characteristics of Congestion Propagation Law, and analyze the average shortest time of vehicles driving in the traffic system.
Anylogic is an innovative modeling tool that can virtual prototype environment.The modeling language has been successfully applied to the modeling of large-scale and complex systems.The main module of the model is agent.Agent based modeling is a new way in the field of simulation, which has been gradually developed in recent years.Individual entities play a role in the system.Each entity has a unique ability to learn and adapt to the environment and these entities are called agents.In agent based modeling and simulation, the results of agent behavior interaction form the behavior of the whole system.Because it can quickly create visual and flexible active objects, including Java objects, and can use a variety of methods for modeling, it can directly analyze and use optimization tools in the running environment.Moreover, when the actual system changes, the system can be changed only through effective change of the model, so as to increase the service cycle of the model.Agent based modeling and simulation has been widely used.Discrete event modeling and simulation provides a possibility of real-time processing discrete system model for urban road traffic flow simulation and optimization.

Case study
This paper studies the simulation and optimization case of urban road traffic flow and selects a congested area in Tianjin as the research object.We use Baidu map to download highdefinition satellite map.A road in this city is the only way to Tianjin Binhai International Airport, which will be blocked during peak hours.With the increase of road network traffic flow, urban traffic mobility decreases.
In order to solve the optimization problem, the simulation model is established by using Anylogic software.Anylogic is a visual tool that can create dynamic model and supports almost all current discrete event and continuous modeling methods.It has the characteristics of supporting agent-based, object-oriented, powerful data analysis and optimization, strong interactivity and so on.The following steps are required to complete the simulation experiment.

Create road network
First, a new model was created with the name "traffic optimization".Download the highdefinition satellite map of the designated area from the website of Baidu maps, as shown in Figure 1.Select analysis and optimization experiments and load them into Anylogic software.In order to display the effect, the scale of the simulation model should be consistent with the satellite map.Then, create a road and intersection model and adjust the intersection to accommodate the number of lanes and turning conditions.

Determine traffic flow logic
The road network created in the previous step is divided into specific sections to establish a traffic flow diagram, as shown in Figure 2. Consider the traffic flow in all directions.Traffic flow includes: "car source" module, "car move to" module, "car dispose" module and their logical connection, "car source" module generates vehicles and places them at the specified location in the road network, "car move to" module determines the path of vehicles from the current location to the specified destination, "car dispose" module simulates vehicles leave the system."Select output" has two or five connectors.In order to make the vehicle pass through each intersection, adjust the model to adapt to the actual situation and determine the number of lanes in the traffic flow.If a car can go straight, turn right and left, select "select output5" of five connectors.Another possibility is to select the "select output" of the two connectors if the vehicle travels along the specified path.Referring to relevant papers, obtain the traffic flow data of a congested area in Tianjin as the simulation input data.These data form different samples according to road sections and road conditions.

Set and optimize traffic lights
After the traffic flow is created, the model needs to be run in order to make sure it is correct.The intersection needs to add traffic lights, otherwise the Anylogic software will give a warning.As shown in the figure 3, this simulation experiment optimizes the driving time of the vehicle in the system by adjusting the signal time, and parameterizes the time of the traffic signal in each stage.P1 and P2 are the parameters of traffic signal 0, P3 and P4 are the parameters of traffic signal 1, and the initial default values of the four parameters are set to 30 seconds.The duration of traffic lights at each stage changes in the same frequency as the given parameters.In order to optimize the urban traffic system, it is necessary to create and run optimization experiments.The optimization goal is the average residence time of vehicles in the system.The optimization experiment looks for a set of optimal parameters suitable for a given objective function to minimize the average residence time of the system.In order to improve the reliability of optimization experiments, multiple groups of repeated experiments need to be done.Anylogic simulation software can use line chart to show the number of repeated experiments.
In order to optimize the traffic simulation experiment, all parameters are changed from fixed values to discrete values.The time variation range of traffic lights is 15-35 seconds, and the step length is 5 seconds.The parameter settings are shown in Table 1.Then create a visual user interface to show the simulation experiment, as shown in Figure 4.With the new values obtained from the traffic simulation optimization experiment, the parameter values become: P1 = 15 seconds, P2 = 30 seconds, P3 = 20 seconds, P4 = 30 seconds.At this time, after optimization, the average residence time of the vehicle in the system is reduced from 145.463 seconds to 132.31 seconds.The chart visually illustrates the optimization process.The x-axis represents the simulation process, and the y-axis represents the current goal, the best feasible goal and the best infeasible goal.The next step is to copy the best feasible targets of each parameter and paste them into the original simulation experiment.After 300 repeated iterative simulation experiments, it is found that the total running time of the vehicle in the system tends to be stable at the 73rd time.

Conclusion
At present, vehicle traffic flow optimization is an important research direction, which generally appears in crowded urban areas.Agent based modeling and simulation is a new modeling and simulation method including autonomous and interactive behavior agents.By using the agent modeling and simulation method, we adjust the display time of traffic lights.After appropriate simulation iteration, the urban traffic system can be simulated and analyzed.The residence time of vehicles in a congested area will also decrease, so as to provide a scenario for urban planners to establish and evaluate urban traffic simulation.Other factors of urban transportation system will also affect the simulation model and experiment.Parking lots, bus stops, vehicle types and pedestrians of urban transportation system will also affect the optimization results.

Table 1 .
Discrete parameter value of traffic signal.
Fig. 4. Optimization diagram of signal lamp duration.