Sumo urban traffic simulation and traffic flow control method based on matlab
1. A sumo urban traffic simulation and traffic flow control method based on matlab is characterized by comprising the following steps: which comprises the following steps:
s1, on-site investigation is carried out to obtain vehicle quantity information of roads and main intersections, and perfection and supplementation are carried out to form investigation data which has the same recording starting time and is recorded once every appointed time, and meanwhile, the turning rate of each intersection and the number of vehicles passing through each road every appointed time are calculated, and each intersection is made into an excel file;
s2, exporting an osm file of the urban road of the target urban area from the OpenStreetMap, converting the osm file into a network file, and modifying the network file by using a sumo self-contained netedit based on the investigation data;
s3, reading each excel file of the field investigation data through the matlab, generating a vehicle file required for testing whether the network has met requirements and a turning rate file of a main intersection at each time interval, and simultaneously configuring a turning rate and an end point road section of a non-main intersection in the turning rate file, wherein the turning rate file of the intersection comprises the turning rate of the main intersection, the turning rate of the non-main intersection and the end point road section;
s4, sumo generates a route file required by the route based on the vehicle file and the turning rate file, matlab reads the route file to find the vehicles which do not disappear on the destination road section, and modifies the nodes in the network file so as to reduce the number of the vehicles which do not disappear on the destination road section;
s5, reading each excel file of the field investigation data through the matlab, and generating vehicle files required by each road time point of the urban road network;
and S6, combining the turning rate file and the vehicle file to generate a routing file, adding the output in the configuration file according to requirements, and running sumo software to finish simulation.
2. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 1, characterized in that: s1 specifically includes the following steps:
s1-1, inspecting the main road junction, recording the number of the lanes and the change rule of the traffic lights, and recording the number of the vehicles driven by each road in a period every specified time;
s1-2, the vehicle quantity of the road junction under examination on the spot is collated, supplemented and perfected so that the vehicle quantity is recorded once at specified time intervals; and for the time nodes which are not counted before, the average value of the time nodes before and after is counted, the turning rate and the total vehicle quantity of each road are calculated, and each intersection is made into an excel file.
3. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 1, characterized in that: in S2, a target urban road is directly imported from the OpenStreetMap, and a network file of the required target urban road is output by using a command netconvert-osm-files. And modifying the network file by using a netexit function carried in the sumo, removing unnecessary roads and buildings, and sequentially modifying the number of lanes, the properties of nodes, the connection modes among different roads and the change rule of traffic lights.
4. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 1, characterized in that: modeling using sumo networks requires the following subfiles: xml, vehicle file, flow, xml, turn rate file, turns, xml, additional file, add.
5. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 1, characterized in that: turning rate of each intersection and a terminal road section are required to be set in a turning rate file required by sumo network modeling in S3, and a turning rate is set at a certain time interval according to investigation data; the step of setting the turning rate file includes the following:
s3-1, reading an excel file of each field investigation intersection data through a matlab code;
s3-2, judging whether the data is a time node; if yes, reading the id attributes of all the entering intersection roads under the time node, simultaneously reading the id attributes and corresponding probabilities of all the exiting intersection roads which are corresponding to each entering intersection road and are capable of turning left, going straight and turning right, writing the corresponding time node, the entering intersection road id attributes, the exiting intersection road id attributes and the corresponding turning rates into an intersection turning rate file according to a turning rate file format, and continuously searching the next time node; otherwise, continuing to search the time node;
s3-3, sorting the turning rate files of each intersection into a turning rate file according to the time sequence;
s3-4, for the non-main road junction, setting all the turning rates of the non-main road from the main road to the non-main road at the value between the intervals [0,1] according to the actual condition of the considered road junction, and adding the turning rates into all the time nodes;
and S3-5, setting an end road section, and setting roads entering other areas outside the export target urban area from the export target urban area and road sections entering the main road from the non-main road as the end road sections, namely completing the configuration of the turning rate file.
6. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 1, characterized in that: s4, reading all the id attributes of the end point road in the turning rate file by using matlab, and then reading the id attributes of the end point road where each vehicle disappears at last in the routing file; comparing the end point road id attribute in the turning rate file, if the end point road id attribute does not exist in the end point road id attribute in the turning rate file, recording the name of the vehicle and the road id attribute of the last vehicle disappearance, and if the end point road id attribute does exist, searching the next vehicle; after counting all vehicles which do not sink on the terminal road section, sequentially finding the vehicles in sumo and displaying the driving paths of the vehicles; judging whether the vehicle disappears in the specified destination road section because the destination road is lacked in the network file or the road connection mode is set unreasonably; if so, adding or modifying the road; otherwise, the next vehicle is searched.
7. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 1, characterized in that: s5, reading the number of vehicles of each road entering the export target urban area from other areas except the export target urban area by using matlab, and then adjusting the number of vehicles of each road and the turning rate of the main road entering the non-main road; the step of S5 includes the following:
s5-1, reading each road id attribute entering the export target urban area from the area outside the export target urban area and the vehicle number of the first time node corresponding to the road id attribute, setting the vehicle number written in the vehicle file as the vehicle number for field investigation divided by the traffic light time of one period and then multiplied by the time interval for field investigation, and taking seconds as a unit; the starting time of the departure of the vehicle is set as the starting time of each time period corresponding to the field investigation time, the ending time is set as the time node plus the field investigation time interval, the departure road is written as the id attribute of the lane, and simultaneously, the vehicle name is flow plus the Chinese pinyin plus-sum number of the intersection name to represent the difference with other vehicles;
(S5-2) using a jtrroutter-flow =:. flows.xml-turns =. turns.xml-net =. net.xml-output-file =. round.xml-connection-on-unbuild command at the terminal, inputting a network file, a turning rate file and a route file required by a vehicle file to generate a route;
s5-3, configuring a network operation configuration file cfg, and outputting an additional file taking a field investigation time interval as a time unit by operating the configuration file cfg in sumo-gui;
s5-4, reading the output additional file and the actual number of vehicles at the network intersection by the matlab, comparing the actual number of vehicles with the data of the time interval of the riding investigation in one period, and judging whether the number of vehicles leaving the road in the time period meets the requirement; if yes, modifying the number of main road vehicles entering the export target urban area in other areas except the non-export target urban area; otherwise, modifying the vehicle quantity, regenerating a routing file, routing to obtain a new output additional file, and comparing whether the vehicle quantity meets the requirement again until the vehicle quantity of each road reaches the maximum vehicle sending quantity of the road;
s5-5, comparing whether the number of main road vehicles entering the derived map area in other areas except the non-derived map area meets the requirement or not by the matlab; when the requirement is met, entering the next time period; and when the requirement is not met, increasing the vehicle quantity or modifying the turning rate of the non-main intersection influencing the road according to the actual situation.
8. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 7, wherein: in the S5-4, when the road reaches the maximum departure amount but still does not meet the requirements, whether the traffic lights, the number of lanes and the connection mode among the roads are consistent with the reality or not and whether the departure lane setting is reasonable or not are observed; if so, adding an departure road to output the additional file again and then comparing; otherwise, modifying the non-conforming contents, re-outputting the additional files, and comparing until the road traffic entering the export map area from other areas except the export map area all meets the requirements.
9. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 7, wherein: when the cfg parameters of the file are configured, an addition-file value = add.
10. The sumo urban traffic simulation and traffic flow control method based on matlab according to claim 9, wherein: and the configured input additional file outputs a file by taking the actual investigation time interval as a frequency, the actual investigation starting time of each time interval as the starting time, the actual investigation starting time plus the time interval as the ending time, and the file name by taking the flow _ number plus the output starting time as the file name, thereby finishing the configuration of the additional file.
Background
With the acceleration of the urbanization process, the urban traffic network is increasingly complicated, so that embarrassment is brought to urban development, and modeling and reproduction of the traffic flow of the urban traffic network are necessary when the urban development plan is not effectively formulated. And meanwhile, the traffic network modeling and the traffic flow control can provide a model for automatic driving. However, at present, network modeling mainly models a single intersection, or establishes a network by respectively setting nodes, road sections and traffic light files, but the method expands the field investigation data volume and the modeling data volume. Meanwhile, when sumo is used for urban network modeling, turning rate files and vehicle file files are needed, but the data volume of the two files is particularly large, if manual editing needs a large amount of time and has a high error rate, and the turning rate files and the vehicle files have respective specific formats, so that the error probability and the time consumed by manual editing can be greatly reduced by processing field-investigation data by matlab to generate the turning rate files and the vehicle files.
Disclosure of Invention
The invention aims to provide a sumo urban traffic simulation and traffic flow control method based on matlab.
The technical scheme adopted by the invention is as follows:
a sumo urban traffic simulation and traffic flow control method based on matlab uses sumo network modeling and needs the following subfiles: xml, vehicle file, flow, xml, turn rate file, turns, xml, additional file, add. The steps of constructing the network model and the vehicle model are as follows:
s1, on-site investigation is carried out to obtain vehicle quantity information of roads and main intersections, and perfection and supplementation are carried out to form investigation data which has the same recording starting time and is recorded once every appointed time, the turning rate of each intersection and the number of vehicles passing through each road every appointed time are calculated, and each intersection is made into an excel file, wherein the method comprises the following steps:
s1-1, the main road junction is inspected on the spot, the number of the lanes and the change rule of the traffic lights are recorded, and the number of the vehicles driven by each road in one period every specified time is recorded.
S1-2, the vehicle quantity of the road junction under the field examination is cleared up, supplemented and perfected, so that the vehicle quantity is recorded once at every appointed time interval, and the average value of the previous time node and the next time node is counted for the time node which is not recorded before. And meanwhile, the turning rate of each road and the total quantity of vehicles leaving the road in each time interval are calculated, and an excel table is prepared.
S2, using netedit to modify the urban network of the specified urban area derived from the OpenStreetMap. The required network file is output using the command netconvert command. And modifying the network by using the self-carried netexit in the sumo, deleting unnecessary roads and buildings, and then sequentially modifying the number of lanes, the properties of the nodes and the change rule of the traffic lights.
S3, reading each excel file of the field investigation data through the matlab, generating a vehicle file and a turning rate file of a main intersection, wherein the vehicle file and the turning rate file are required for testing whether the network meets requirements, and meanwhile, configuring the turning rate and the end point road section of the non-main intersection in the turning rate file, wherein the turning rate file of the intersection comprises the turning rate of the main intersection, the turning rate of the non-main intersection and the end point road section. The steps of generating the turning rate file are as follows:
s3-1, reading an excel file of each field investigation data through a matlab code.
S3-2, judging whether the data is a time node; if yes, reading the id attributes of all the entering intersection roads under the time node, simultaneously reading the id attributes and corresponding probabilities of all the exiting intersection roads which are corresponding to each entering intersection road and are capable of turning left, going straight and turning right, writing the corresponding time node, the entering intersection road id attributes, the exiting intersection road id attributes and the corresponding turning rates into an intersection turning rate file according to a turning rate file format, and continuously searching the next time node; otherwise, continuing to search the time node;
s3-3, sorting the turning rate files of each intersection into a turning rate file according to the time sequence;
s3-4, for the non-main road junction, setting all the turning rates of the non-main road from the main road to the non-main road at the value between the intervals [0,1] according to the actual condition of the considered road junction, and adding the turning rates into all the time nodes;
and S3-5, setting an end road section, and setting roads entering other areas outside the export target urban area from the export target urban area and road sections entering the main road from the non-main road as the end road sections, namely completing the configuration of the turning rate file.
S4, sumo generates a routing file required by the routing based on the vehicle file and the turning rate file, the matlab reads the routing file to find the vehicles which do not disappear on the destination road section, and modifies the network file so as to reduce the number of the vehicles which do not disappear on the destination road section; the steps for modifying the network are as follows:
and reading all the id attributes of the end point road in the turn rate file by using matlab, then reading the id attribute of the end point road which is disappeared by each vehicle in the route file, comparing the end point road id attributes in the turn rate file, if the end point road id attributes do not exist in the end point road id attributes in the turn rate file, recording the name of the vehicle and the road id attribute which is disappeared by the last vehicle, and if the end point road id attributes exist, searching the next vehicle. And after counting all vehicles which do not sink in the destination road section, sequentially finding the vehicles in the sumo, displaying the driving paths of the vehicles, observing whether the vehicles do not disappear in the specified destination road section due to the fact that the destination road is lacked in the network file or the road connection mode is set unreasonably, if so, adding or modifying the road, and otherwise, searching for the next vehicle.
S5, reading each excel file of the field investigation data through matlab, generating vehicle files required by each road time point of the urban road network, and specifically generating the vehicle files as follows:
s5-1, reading each road id attribute entering the export target urban area from the area outside the export target urban area and the vehicle number of the first time node corresponding to the road id attribute, and setting the vehicle number written in the vehicle file as the time interval of dividing the vehicle number for field investigation by the traffic light time of one period and then multiplying the vehicle number for field investigation, wherein the time interval is second. The starting time of the departure of the vehicle is set as the starting time of each time period corresponding to the field investigation time, the ending time is set as the time node plus the field investigation time interval, the departure road is written as the id attribute of the lane, and simultaneously, the vehicle name is flow plus the Chinese pinyin plus-sum number of the intersection name to represent the difference with other vehicles;
(S5-2) using a jtrroutter-flow =:. flows.xml-turns =. turns.xml-net =. net.xml-output-file =. round.xml-connection-on-unbuild command at the terminal, inputting a network file, a turning rate file and a route file required by a vehicle file to generate a route;
s5-3, configuring a network to run a configuration file cfg, wherein when configuring parameters of the configuration file cfg, an addition-file value = add, xml/> needs to be additionally added to input parameters so that a sumo can output an additional file during running, and by running the configuration file cfg in a sumo-gui, outputting an additional file taking a field investigation time interval as a time unit, wherein the format of the configured additional file is as follows: and outputting a file by taking the actual investigation time interval as a frequency, taking the initial time of each actually investigated time period as the initial time, taking the initial time of each actually investigated time period plus the time interval as the termination time, and taking the file name by taking the flow _ number plus the output initial time as the file name to complete the additional file configuration. (ii) a
S5-4, reading the output additional file and the actual number of vehicles at the network intersection by the matlab, comparing the actual number of vehicles with the data of the time interval of the riding investigation in one period, and judging whether the number of vehicles leaving the road in the time period meets the requirement; if yes, modifying the number of main road vehicles entering the export target urban area in other areas except the non-export target urban area; if not, modifying the number of vehicles, regenerating a routing file, routing to obtain a new output additional file, and then re-comparing whether the number of vehicles meets the requirement or not until the number of vehicles on each road reaches the maximum departure amount of the road, if the road reaches the maximum departure amount but still does not meet the requirement, observing whether the connection mode between traffic lights, the number of lanes and the roads is consistent with the reality or not and whether the departure lane setting is reasonable or not, if so, adding a departure road to re-output the additional file for comparison, and if not, modifying the inconsistent content to re-output the additional file for comparison until the traffic flow of the roads entering the derivation map area in other areas except the derivation map area all meets the requirement;
s5-5, comparing whether the number of main road vehicles entering the derived map area in other areas except the non-derived map area meets the requirement or not by the matlab; when the requirement is met, entering the next time period; and when the requirement is not met, increasing the vehicle quantity or modifying the turning rate of the non-main intersection influencing the road according to the actual situation.
And S6, combining the turning rate file and the vehicle file to generate a routing file, adding the output in the configuration file according to requirements, and running sumo software to finish simulation.
By adopting the technical scheme, compared with the prior art, the invention has the beneficial effects that: 1. the network model is directly extracted from the OpenStreetMap, and then the network is modified according to the specific network parameters obtained through actual investigation, so that the time required for building the network is reduced. 2. The method for constructing the large-scale traffic network uses matlab as an auxiliary tool, reduces the labor cost for writing vehicle files flows and turn files, improves the speed of constructing the network and achieves the purpose of controlling the traffic flow.
Drawings
The invention is described in further detail below with reference to the accompanying drawings and the detailed description;
FIG. 1 is an example of data at an intersection;
FIG. 2 is an example of a road network model;
FIG. 3 is an example of an intersection model;
FIG. 4 is a flow chart of traffic flow adjustment;
fig. 5 is a general flow chart.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
As shown in fig. 1 to 5, the present invention discloses a sumo urban traffic simulation and traffic flow control method based on matlab, which comprises the following steps:
s1, on-site investigation is carried out to obtain vehicle quantity information of roads and main intersections, and perfection and supplementation are carried out to form investigation data which has the same recording starting time and is recorded once every appointed time, the turning rate of each intersection and the number of vehicles passing through each road every appointed time are calculated, and each intersection is made into an excel file;
s1-1, inspecting the main road junction, recording the number of the lanes and the change rule of the traffic lights, and recording the number of the vehicles driven by each road in a period every specified time;
s1-2, the vehicle quantity of the road junction under examination on the spot is collated, supplemented and perfected so that the vehicle quantity is recorded once at specified time intervals; and for the time nodes which are not counted before, the average value of the time nodes before and after is counted, the turning rate and the total vehicle quantity of each road are calculated, and each intersection is made into an excel file. As shown in fig. 1, the attribute of each road id is located below the "first record", and in order to ensure that the corresponding relationship between each time point and the intersection is maintained, all the time points are located on the left side of the "first record", and the left turn, the right turn, and the left column of the straight data is the turning rate.
S2, the network derived from the OpenStreetMap is modified by using netedit. As shown in fig. 2 and 3, the required network file is output by importing the city road in fuzhou city directly from OpenStreetMap and outputting it using the command netconvert. And modifying the network by using the self-carried net bit in the sumo, wherein the objects of modification are the number of lanes, the properties of nodes, the connection between the roads and the change rule of traffic lights in sequence. In the third figure, the number of the lanes of each road at the intersection, whether the intersection is a traffic light, the lane of the road entering the intersection can turn left, and if the lane is the traffic light, the change rule of the traffic light is how.
S3, reading each excel file of the field investigation data through the matlab, generating a vehicle file and a turning rate file of a main intersection, wherein the vehicle file and the turning rate file are required for testing whether a network meets requirements, and meanwhile, configuring the turning rate and an end point road section of a non-main intersection in the turning rate file, wherein the turning rate file of the intersection comprises the turning rate of the main intersection, the turning rate of the non-main intersection and the end point road section;
s3-1, reading an excel file of each field investigation data through a matlab code; the first diagram is one of the intersections.
S3-2, judging whether the data is a time node; if so, reading the id attributes of all the entering intersection roads under the time node, simultaneously reading the id attributes and the corresponding probabilities of all the exiting intersection lanes of the left-turn straight-going right-turn corresponding to each entering intersection road, writing the corresponding time node, the entering intersection road id attribute, the exiting intersection road id attribute and the corresponding turning rate into an intersection turning rate file according to a turning rate file format, and continuously searching the next time node; otherwise, continuing to search the time node;
s3-3, sorting the turning rate files of each intersection into a turning rate file according to the time sequence;
s3-4, for the non-main road junction, setting all the turning rates of the non-main road from the main road to the non-main road at the value between the intervals [0,1] according to the actual condition of the considered road junction, and adding the turning rates into all the time nodes;
and S3-5, setting an end road section, and setting roads entering other areas outside the export target urban area from the export target urban area and road sections entering the main road from the non-main road as the end road sections, namely completing the configuration of the turning rate file.
S4, sumo generates a routing file required by the routing based on the vehicle file and the turning rate file, the matlab reads the routing file to find the vehicles which do not disappear on the destination road section, and modifies the network file so as to reduce the number of the vehicles which do not disappear on the destination road section; the steps for modifying the network are as follows:
and reading all the id attributes of the end point road in the turn rate file by using matlab, then reading the id attribute of the end point road which is disappeared by each vehicle in the route file, comparing the end point road id attributes in the turn rate file, if the end point road id attributes do not exist in the end point road id attributes in the turn rate file, recording the name of the vehicle and the road id attribute which is disappeared by the last vehicle, and if the end point road id attributes exist, searching the next vehicle. And after counting all vehicles which do not sink in the destination road section, sequentially finding the vehicles in the sumo, displaying the driving paths of the vehicles, observing whether the vehicles do not disappear in the specified destination road section due to the fact that the destination road is lacked in the network file or the road connection mode is set unreasonably, if so, adding or modifying the road, and otherwise, searching for the next vehicle.
S5, reading each excel file of the field investigation data through matlab, generating vehicle files required by each road time point of the urban road network, and specifically generating the vehicle files as follows:
s5-1, reading each road id attribute entering the export target urban area from the area outside the export target urban area and the vehicle number of the first time node corresponding to the road id attribute, and setting the vehicle number written in the vehicle file as the time interval of dividing the vehicle number for field investigation by the time length of one period traffic light and then multiplying the field investigation, and taking the second as the unit. The starting time of the departure of the vehicle is set as the starting time of each time period corresponding to the field investigation time, the ending time is set as the time node plus the field investigation time interval, the departure road is written as the id attribute of the lane, and simultaneously, the vehicle name is flow plus the Chinese pinyin plus-sum number of the intersection name to represent the difference with other vehicles;
(S5-2) using a jtrroutter-flow =:. flows.xml-turns =. turns.xml-net =. net.xml-output-file =. round.xml-connection-on-unbuild command at the terminal, inputting a network file, a turning rate file and a route file required by a vehicle file to generate a route;
s5-3, when the configuration network runs the configuration file cfg file, it needs to add an addition-file value = add. Configuring an input additional file, outputting a file by taking an actual investigation time interval as a frequency, taking the initial time of each actually investigated time period as an initial time, taking the initial time of each actually investigated time period plus a time interval as an end time, taking the flow _ number plus the output initial time as a file name, completing allocation of the addition file, and operating a configuration file cfg in sumo-gui to obtain an output additional file by taking the actual investigation time interval as a time unit;
s5-4, reading the output additional file and the actual number of vehicles at the network intersection by the matlab, comparing the actual number of vehicles with the data of the time interval of the riding investigation in one period, and judging whether the number of vehicles leaving the road in the time period meets the requirement; if yes, modifying the number of main road vehicles entering the export target urban area in other areas except the non-export target urban area; if not, modifying the number of vehicles, regenerating a routing file, routing to obtain a new output additional file, and then re-comparing whether the number of vehicles meets the requirement or not until the number of vehicles on each road reaches the maximum departure amount of the road, if the road reaches the maximum departure amount but still does not meet the requirement, observing whether the traffic lights, the number of lanes, the lane connection mode are consistent with the reality or not and whether the departure lane is set reasonably or not, if so, adding a departure road section to re-output the additional file for comparison, and if not, modifying the inconsistent content, re-outputting the additional file for comparison;
s5-5, comparing whether the number of main road vehicles entering the derived map area in other areas except the non-derived map area meets the requirement or not by the matlab; when the requirement is met, entering the next time period; and when the requirement is not met, increasing the number of vehicles according to the actual situation.
And S6, combining the turning rate file and the vehicle file to generate a routing file, adding the output in the configuration file according to requirements, and running sumo software to finish simulation.
As shown in fig. 1, the data examined in the field are respectively saved in excel tables of a folder by taking one intersection as a unit, then the total amount of each intersection and the turning rate of each road are calculated, and then the data arrive earlier at the id attribute corresponding to each road and replace the direction in the tables, thereby forming the pattern in fig. 1.
Downloading a Fuzhou city traffic map from an OpenStreetMap, converting the osm type into the xml type by using a netconvert command, opening the map as shown in figure 2 in sumo-gui, starting a netedit to edit the network, firstly modifying the number of lanes at the intersection, then modifying the node attribute, modifying the road connecting line and finally modifying the traffic light change rule.
And reading the modified data by using the matlab code, writing the road id attribute of each intersection to be inspected in the field, the road id attribute of the left turn, the straight run and the right turn of the exit intersection corresponding to the road and the corresponding turning rate into a turning rate file, and setting the probability of all main intersections entering non-main intersections at all time points as a certain value in (0, 1). And then setting all roads of the roads which enter the main intersection from the non-main intersection and enter other areas outside the export target urban area from the export target urban area as sinking road sections.
And reading a part of the field investigation data as a test result to determine whether the network is completely modified or not by using the matlab code, generating a vehicle file, generating a routing file by using a command, observing whether a warning is generated when the routing file is generated or not, and if the warning quantity is not in an expected range, finding a corresponding vehicle by using the matlab to modify the network until the warning quantity is in a reasonable range.
And reading the road traffic entering the export target urban area from other areas except the export target urban area at the first time point by using matlab, and generating a vehicle file, a turning rate file and a network file to generate a routing file. The file cfg is then configured and additional files are added in the input. The configuration file cfg is then run in sumo-gui and additional files are output after all time nodes have been run. And then, running the code to observe whether the vehicle meets the requirement or not, if the number of the vehicle dispatches reaches the maximum vehicle dispatches but does not meet the requirement of vehicle field inspection, adding another road capable of driving into the road as a vehicle dispatches starting point or modifying the turning rate of the road driving into a non-main road, rerouting after the modification is finished, and observing whether the vehicle flow meets the requirement or not. The flow chart shown in fig. 4 is how the traffic flow modifies the departure amount so that the departure amount and the intersection traffic flow under field investigation are within a certain error range.
By adopting the technical scheme, compared with the prior art, the invention has the beneficial effects that: 1. the network model is directly extracted from the OpenStreetMap, and then specific network parameters are obtained according to actual investigation, so that the time for constructing the network is shortened. 2. The method for constructing the large-scale traffic network uses matlab as an auxiliary tool, reduces the labor cost of vehicle files and turning rate files, and improves the network construction speed.
It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. The embodiments and features of the embodiments in the present application may be combined with each other without conflict. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the detailed description of the embodiments of the present application is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种基于贝叶斯网络的交通健康诊断方法