Intersection modeling and signal lamp control optimization method based on fuzzy neural Petri network
By introducing a fuzzy neural Petri network into traffic light control, combining backpropagation algorithm and SUMO simulation software, the signal light control strategy is optimized, and the problem of real-time traffic flow changes in the existing technology is solved, and control stability and efficiency are improved.
Patent Information
- Application Number
- CN202411329870.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The existing traffic light control methods are difficult to effectively deal with real-time traffic flow changes, resulting in unstable control and inefficient control, especially in complex traffic situations.
The intersection modeling and signal light control optimization method based on fuzzy neural Petri network are adopted. By extending the continuous Petri network and fuzzy Petri network, combining the backpropagation algorithm, the adaptive control strategy of signal light is optimized, and the model training and verification is used for SUMO simulation software. .
It improves the stability, traffic efficiency and system robustness of signal light control, can handle complex traffic situations more intelligently and efficiently, and reduces vehicle waiting time.
Smart Images

Figure CN119207137A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an intersection modeling and signal light control optimization method based on fuzzy neural Petri net, belonging to the technical field of traffic signal light control. Background Art
[0002] As a modeling tool that combines graphics and mathematics, Petri nets can model and analyze discrete event systems and continuous event systems. It has outstanding capabilities in describing asynchrony, concurrency, and conflict, and has strong expansion capabilities. Therefore, it is an effective tool for modeling and analyzing information-physical systems with mixed characteristics of continuous and discrete events.
[0003] Traffic cyber-physical system is a classic cyber-physical system with characteristics such as complexity, concurrency, and conflict, and intersections are key nodes of traffic cyber-physical system. The control of traffic lights has always been a difficult and focused research point, and the fuzzy control algorithm can effectively solve the contradiction between real-time traffic flow changes and fixed signal timing. At the same time, the introduction of neural learning algorithms improves the problem that fuzzy algorithms do not have adaptive capabilities.
[0004] The advantage of continuous Petri nets is that they can naturally represent the continuity of traffic flow and capture the dynamic characteristics of vehicles in different directions through changes in flow rate. This model is suitable for intersection modeling because the traffic flow at intersections has significant time-varying and uncertainty.
[0005] Fuzzy Petri nets can dynamically adjust the control strategy of traffic lights based on real-time traffic data. Traditional methods usually rely on preset timing strategies and are difficult to effectively respond to real-time changing traffic conditions. Fuzzy Petri nets can evaluate traffic flow in real time and adjust control strategies instantly, thereby improving traffic efficiency. By combining back-propagation neural networks and fuzzy Petri nets, intersection signal control systems can be significantly improved in many aspects, including control stability, traffic efficiency, system intelligence, ability to handle complex traffic conditions, and system robustness. This combination makes full use of the powerful learning and prediction capabilities of back-propagation neural networks and the flexible and powerful rule management capabilities of fuzzy Petri nets, allowing signal control systems to operate more intelligently, efficiently, and robustly.
[0006] In summary, the Petri net combining fuzzy control algorithm and neural learning algorithm is of great significance for describing, controlling and optimizing intersection signal control system.
[0007] The technology of this invention is funded by the Yunnan Provincial Major Science and Technology Special Plan (202302AD080002); the Industrial Innovation Talent Project of the "Xingdian Talent Support Plan" (Yunnan Development and Reform Personnel
[2019] No. 1096); and the Yunnan Provincial Key Laboratory of Computer Technology Application Open Fund (CB22144S073A). Summary of the invention
[0008] The technical problem to be solved by the present invention is to realize intersection modeling and signal light control optimization based on Petri net.
[0009] The technical scheme of the present invention is: a method for intersection modeling and signal light control optimization based on fuzzy neural Petri nets. Firstly, the basic attributes of directed arcs of continuous Petri nets are extended, and the extended continuous Petri nets are used to construct intersection traffic flow and road section models and intersection signal light models; secondly, fuzzy Petri nets are introduced, and the basic attributes of fuzzy Petri net transitions are extended, and the fuzzy control model of intersection signal lights is constructed by using the extended fuzzy Petri nets; thirdly, an adaptive control intersection model based on continuous Petri nets and fuzzy Petri nets is constructed by substitution operation to realize adaptive control of signal lights; on this basis, a fuzzy neural Petri net intersection signal light control optimization algorithm is proposed in combination with a back propagation algorithm to optimize the confidence, threshold and weight of the fuzzy Petri net; finally, an experimental environment is built using SUMO simulation software, and the model is trained with training sample data obtained by simulating road network operation, and the accuracy of the model is verified by comparing the simulation sample data with the green light duration after training.
[0010] The specific steps are:
[0011] Step 1: Extend the read-only attribute on the basis of the definition of the directed arc in the continuous Petri net. The extended directed arc is called the read-only arc. When the transition pointed by the read-only arc meets the triggering condition, the transition only reads the number of tokens in the library place without removing the tokens in the library place. The continuous Petri net with extended read-only attribute is used to construct the intersection traffic flow and road section model.
[0012] Step 2: Based on the continuous Petri net with extended read-only arc attributes, the directed arc attributes are further extended. The extended directed arcs are defined as inhibition arcs. Inhibition arcs are used to check transition triggering conditions and prevent transition triggering that does not meet the conditions. The intersection signal light model is constructed using the continuous Petri net with extended read-only and inhibition attributes. The replacement operation of the continuous Petri net is introduced to realize the replacement of the control library in the intersection signal light model and the intersection traffic flow and road section model. A complete continuous Petri net intersection model is constructed to realize the signal light control of traffic flow.
[0013] Step 3: Introduce fuzzy Petri nets to optimize traffic light control, expand the basic attributes of transitions in fuzzy Petri nets, define the expanded transitions as operation transitions, which have the function of calculating the number of tokens in the library, and then define their fuzzy rules. Use the fuzzy Petri nets with expanded transition operation attributes and defined fuzzy rules to build a fuzzy control model for intersection traffic lights. Use replacement operations to realize the combination of the fuzzy control model of intersection traffic lights and the complete continuous Petri net intersection model. Construct an adaptive control intersection model based on continuous Petri nets and fuzzy Petri nets to realize adaptive control of traffic lights.
[0014] Step 4: Based on the fuzzy control model of intersection traffic lights, a fuzzy neural Petri net traffic light control optimization algorithm is proposed according to the back propagation algorithm, and a fuzzy neural Petri net control optimization model is constructed.
[0015] Step 5: In the SUMO simulation software, build a simulated road network based on the intersection layout and mixed traffic flow data, set up simulation detectors and run the simulated road network.
[0016] Step 6: The traffic flow data and the corresponding phase signal light timing data obtained by running the simulation road network are used as training sample data, and input into the fuzzy neural Petri net control optimization model for training, and the confidence, threshold, and weight between the library and the transition in the adaptive control intersection model are optimized to correct the parameters in the training to achieve the expected goal. By comparing the simulation sample data and the green light duration after training, the accuracy of the optimization algorithm for the training of transition parameters is verified. At the same time, through simulation experiments, compared with the fixed timing scheme and the linear control scheme, the evaluation index results show that the algorithm can effectively improve the control effect of intersection signal lights.
[0017] Furthermore, the Step 1 includes:
[0018] Step 1.1: In the basic continuous Petri net CPN = (P, T, A, W, θ, M0), the read-only attribute RA is extended on the basic definition of the directed arc A. The read-only arc RA provides a way to check the number of tokens for the continuous Petri net transition. The read-only arc reads the detection area library. The number of tokens in the above place is unchanged. The enabling condition of the read-only arc RA is the same as that of the common arc, but the excitation rule is different.
[0019] The read-only arc firing rules are defined as follows:
[0020] For any transition t in the set T, if there exists a read-only arc a(p×t)∈RA, and the number of tokens in the input place p, the read-only arc weight W(p,t) and the transition threshold θ(t) satisfy M(p)×W(p,t)≥θ(t), then M'(p)=M(p), where M'(p) is the number of output place tokens; RA is a finite set of read-only arcs, which is a mapping from places to transitions.
[0021] The continuous Petri net with extended read-only attribute is defined as a seven-tuple CPN = (P, T, A, RA, W, θ, M0);
[0022] Step 1.2: Use the places, transitions and directed arcs in the continuous Petri net seven-tuple CPN = (P, T, A, RA, W, θ, M0) with extended read-only attributes to graphically represent the state changes and interaction relationships of the system and construct a continuous Petri net intersection vehicle and road section model.
[0023] In the continuous Petri net intersection vehicle and road segment model, the library and The superscript indicates the traffic state or stage of the traffic flow in the intersection, and the subscript indicates whether the road section and lane of the traffic flow in the intersection belong to straight or left turn; the number of tokens M in the library p indicates the number of vehicles in the traffic flow at this stage; transition Indicates changes in the traffic flow state or phase at an intersection.
[0024] The continuous Petri net intersection vehicle and road section model has the function of detecting the number of tokens read in the library, specifically: and change Indicates that traffic flow enters the waiting state from the detection state. A read-only arc is used at this transition. and Make the change and After stimulation and Implementing Waiting Places and For testing library and Read the number of tokens.
[0025] Furthermore, the Step 2 includes:
[0026] Step 2.1: Continue to extend the inhibition attribute IA based on the definition of the directed arc A in the continuous Petri net CPN = (P, T, A, RA, W, θ, M0) with extended read-only attribute. If there is a mark in the library place connected by the inhibition arc IA, the transition cannot be triggered. Only when there is no mark in the library place connected by the inhibition arc can the transition be triggered.
[0027] The inhibition arc firing rule is defined as: for any transition t in the set T, if there exists an inhibition arc a(p×t)∈IA, and the number of tokens M(p) in the input library p, the read-only arc weight W(p,t) and the transition threshold θ(t) satisfy M(p)×W(p,t)<θ(t), then the transition t is called fired; IA is a finite set of inhibition arcs, which is a mapping from positions to transitions.
[0028] The continuous Petri net with extended read-only attribute and inhibition attribute is defined as an octet CPN = (P, T, A, RA, IA, W, θ, M0).
[0029] Step 2.2: Use the places, transitions and directed arcs in the continuous Petri net octet CPN = (P, T, A, RA, IA, W, θ, M0) with extended read-only and inhibition attributes to graphically represent the state changes and interaction relationships of the system and construct a continuous Petri net intersection signal light model.
[0030] In the continuous Petri net intersection signal model, the library p x , and They represent the signal light phase stage, the current phase green light time and the signal light control library, library p x When the number of tokens is 0, it indicates the end of the phase stage, and when the number of tokens is 1, it indicates the beginning of the phase stage; the transition t x→x+1 , and They represent the switching phase stage, the reset phase green light time and the reading green light time respectively.
[0031] The continuous Petri net intersection signal model includes three functions: phase switching, green light time resetting and green light time reading.
[0032] Among them, the phase switching function is: directed arc To suppress the arc, when the library The number of tokens is 0, and the place p x When the token number is 1, it means that the current phase green light time has ended. With p x In the inhibition arc Under the action of jointly triggering transition t x→x+1 , to achieve phase switching.
[0033] The green light time reset function is: directed arc and To suppress the arc, when the library and When the number of tokens in the middle is 0, it means that the green light time of the previous phase has ended. and In the inhibition arc and Under the influence of Reset the green light time of the current phase.
[0034] Green light time reading function: directed arc For read-only arcs, read the library location The token number is stored in the signal light control library Realize the reading of green light time.
[0035] Step 2.3: Introduce the replacement operation of continuous Petri nets. The replacement operation is: for any two subnets N1 = (P1, T1, A1) and N2 = (P2, T2, A2), perform replacement operation. After replacement, N' = (P', T', A') satisfies P' = (P-P1) ∪P2, T' = (T-T1) ∪T2.
[0036] The continuous Petri net intersection signal model is simplified to a library after replacement operation. Replaced library The same as the library in the intersection traffic flow and road section model in Step 1 Inspiring change together Construct a complete continuous Petri net intersection model to realize signal light control of traffic flow.
[0037] Furthermore, the Step 3 includes:
[0038] Step 3.1: Introduce fuzzy Petri net to optimize traffic light control. In the fuzzy Petri net FPN = (P, T, D, A, F, θ, μ, λ, r, Ac, M0), the operation attributes are extended on the basic definition of transition to realize complex calculation logic. The operation transition allows arithmetic operations on the marked number during the transition excitation process.
[0039] The triggering rule of operation transition is: for any transition t in the set T, there is an input place p∈P, which defines addition and subtraction operations and ratio operations. The triggering rule of addition operation transition is: M'(p O )=Op(t)=M(p1)+M(p2)+…+M(p n ); the triggering rule for the subtraction operation transition is: M'(p O )=Op(t)=M(p1)-M(p2)-…-M(p n ); The triggering rule for the ratio operation transition is: M'(p O )=Op(t)=M(P i ) / M(P j); The ratio operation transition is used to calculate the proportion of heavy vehicles, the addition operation transition is used to calculate the phase green light time, and the input layer transition Subtraction operation transition and ratio operation transition are used to realize input fuzzification and defuzzification transition t df The addition operation transition and ratio operation transition are used to realize the centroid method of defuzzification. Op:T→"operation" is a mapping from transition to operation.
[0040] The expanded fuzzy Petri net is defined as a twelve-tuple FPN = (P, T, D, A, F, θ, μ, λ, r, Ac, Op, M0).
[0041] Step 3.2: Define fuzzy rules for the extended fuzzy Petri net. r is a fuzzy rule composed of "and" and "or" judgment logic. Each transition t is mapped to the corresponding fuzzy rule. The transition rule is obtained according to the minimum-maximum reasoning method: Let the i-th place and the j-th transition in the fuzzy Petri net be equal. For the enabled transition t j , take all its input locations p i Calculation result Ac ij =m i ×f ij ×λ j The minimum value in the transition t j The excitation output value; for a multiple input transition t j Place p i+1 , take all input transitions t j The maximum value among the excitation values is taken as the output location p i+1 The number of tokens updated.
[0042] Step 3.3: Using the places, transitions and directed arcs in the fuzzy Petri net twelve-tuple FPN = (P, T, D, A, F, θ, μ, λ, r, Ac, Op, M0) with expanded operation attributes and complete fuzzy rule definitions, the state changes and interaction relationships of the system are represented graphically, and a fuzzy Petri net intersection signal fuzzy control model is constructed.
[0043] In the fuzzy Petri intersection network signal light fuzzy control model, the library p VN and p PHV Respectively represent the number of vehicles and the proportion of heavy vehicles in the fuzzy input; and They represent the fuzzy subsets of fuzzy input and output under the triangular membership function; GT Indicates the result of defuzzification of output quantity. Green light increases the time; transition The input quantity is fuzzified using the triangle membership function, and the input library p VNand p PHV Through operational changes Points to its corresponding fuzzy subset and
[0044] change The input places come from the fuzzified subset and change After the triggering conditions are met, the minimum inference method in Step 3.2 is executed to obtain the corresponding fuzzy rule transition Output of The input transition comes from the corresponding rule Changes to rules that meet the conditions Execute the maximum inference method in Step 3.2 to infer the green light increase time.
[0045] Change df Using the center of gravity method, the library p out The output quantity in is defuzzified and the green light increase time is output, which is added to the basic green light time to be the green light time of this phase and stored in the green light time library p GT , to achieve the green light time output of the corresponding phase signal light.
[0046] Step 3.4: The fuzzy control model of the signal light at the fuzzy Petri intersection network includes two modules: input and output. The input module reads the reading library of each phase in the complete continuous Petri net intersection model. Replaced with the input library p of the corresponding phase of the fuzzy control model of the fuzzy Petri intersection network signal light VN and p PHV The output module simplifies the network structure of the fuzzy Petri intersection network signal light fuzzy control model into a library after replacement operation. Replaced library Complete continuous Petri net intersection model library Inspiring change together The fuzzy control model of intersection traffic lights is combined with the complete continuous Petri net intersection model in Step 2, and an adaptive control intersection model based on continuous Petri nets and fuzzy Petri nets is constructed to realize adaptive control of traffic lights.
[0047] Furthermore, the Step 4 includes:
[0048] Step 4.1: The optimization algorithm includes initializing transition parameters, designing transition activation functions, updating parameters through gradient descent method, calculating losses, iterative training and outputting results.
[0049] Initialize the initial parameters of the transition within the range that can be triggered; initialize the transition parameters. Assuming that the fuzzy rules are set to an average distribution, the parameter initialization formula is as follows:
[0050]
[0051] Where n in and n out are the number of nodes in the input layer and the output layer respectively.
[0052] Step 4.2: Design the transition activation function. According to the characteristics of the intersection signal control system, set the Sigmoid type excitation function with relatively stable gradient changes, define the relationship between the fuzzy input value and the transition confidence, threshold and fuzzy weight, and nonlinearly map the input and output of the fuzzy Petri intersection network signal fuzzy control model, and determine whether the transition is enabled. Specifically:
[0053]
[0054] Where Ac is the rule transition in the fuzzy control model of traffic lights in fuzzy Petri intersection network The calculation result is Ac=M(p)×F(p,t)×λ(t), where M(p) is the number of tokens in the input place, F(p,t) is the transition fuzzy weight, and λ(t) is the transition confidence.
[0055] Input simulation sample data, and calculate the fuzzy membership range of each set of input data, the triggered rules and their activation values through the fuzzy control system; for each set of simulation sample data, only the changes corresponding to the rules triggered by it are trained and the activation values are calculated.
[0056] Step 4.3: Use the mean square error to calculate the loss, and use the gradient descent method to update the weight, confidence and threshold of the transition. According to the designed excitation function, the gradient calculation formula of the transition, confidence and threshold is as follows:
[0057]
[0058] Step 4.4: Loss function calculation formula, specifically:
[0059]
[0060] In the formula, y i is the true value, is the algorithm prediction value.
[0061] Step 4.5: Use the same data to iteratively train the transition until the transition cannot be triggered. Keep the last set of parameters that can trigger the transition as temporary parameters. Compare the error between the activation value and the standard activation value under the new and old temporary parameters. Take the one with the smallest error as the new temporary parameter. Repeat these steps until all transition parameters are stable or the simulation sample data is used up, and output the trained transition parameters.
[0062] Furthermore, the Step 5 includes:
[0063] Step 5.1: Use the simulation software SUMO to build an intersection simulation road network, using the open source global map project OpenStreetMap as the map data source; use SUMO's built-in tool netconvert to convert OpenStreetMap map data into a .net.xml file that can be used by SUMO; create a traffic flow .rou.xml file to define vehicle types, routes and their traffic.
[0064] Step 5.2: In the SUMO simulation software, set up a simulated detector to simulate the induction coil or camera in reality. The detector output file type is XML. Use Python to develop the API provided by SUMO and use the traci.start() method to connect to SUMO for real-time interaction. Set up lane area detectors and induction coil detectors and run the simulated road network.
[0065] Furthermore, the Step 6 includes:
[0066] Step 6.1: Use the traffic flow data and the corresponding phase signal light timing data obtained by running the simulation road network as training sample data; train the transition parameters according to the fuzzy neural Petri net intersection signal light control optimization algorithm in Step 4, optimize the transition confidence, threshold, and the weight between the library and the transition, so as to correct the parameters in the training to achieve the expected goal; bring the transition parameters trained by the fuzzy neural Petri net intersection signal light control optimization algorithm into the adaptive control intersection model based on continuous Petri net and fuzzy Petri net, and verify the accuracy of the algorithm in training the transition parameters by comparing the simulation sample data and the green light duration after training;
[0067] Step 6.2: Use SUMO simulation software to conduct a comparative experiment on traffic light control strategies. By comparing with the fixed timing scheme and the linear control scheme, the evaluation index results show that the algorithm can effectively improve the control effect of intersection signal lights.
[0068] The beneficial effects of the present invention are:
[0069] 1. Compared with the traditional intersection signal control method, the fuzzy neural Petri net of the present invention combines the advantages of Petri net and fuzzy logic, can manage complex rules and relationships in a graphical structure, and make decisions through a fuzzy reasoning mechanism. It can perform fuzzy neural graphical modeling for factors such as the driving speed of different types of vehicles and the cross-interference between mixed traffic flows.
[0070] 2. The fuzzy neural Petri net traffic light control optimization method involved in the present invention combines the back propagation neural network to train the fuzzy Petri net transition parameters, and through real-time monitoring and prediction of traffic flow in all directions, reasonably allocates traffic light cycles, reduces vehicle waiting time, ensures control stability, and improves intersection traffic efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 It is an implementation flow chart of the present invention;
[0072] Figure 2 is a continuous Petri net intersection traffic flow and road section model diagram in an embodiment of the present invention;
[0073] Figure 3 is a continuous Petri net intersection signal light model diagram in an embodiment of the present invention;
[0074] Figure 4 is a complete continuous Petri net intersection model diagram in an embodiment of the present invention;
[0075] Figure 5 is a diagram of a fuzzy control model of a fuzzy Petri net intersection signal light in an embodiment of the present invention;
[0076] Figure 6 It is a model diagram of an adaptive control intersection based on a continuous Petri net and a fuzzy Petri net in an embodiment of the present invention;
[0077] Figure 7 is a flow chart of the fuzzy neural Petri net intersection signal light control optimization algorithm in an embodiment of the present invention;
[0078] Figure 8 It is a simulation road network operation diagram of an actual intersection in an embodiment of the present invention;
[0079] Fig. 9 It is a diagram of the accuracy verification experiment results of the fuzzy neural Petri net intersection signal light control optimization algorithm in an embodiment of the present invention. DETAILED DESCRIPTION
[0080] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods.
[0081] Example 1: Figure 1As shown in FIG. 1 , a method for intersection modeling and signal light control optimization based on fuzzy neural Petri net is shown in FIG. 1 , and the specific steps are as follows:
[0082] Step 1: Extend the read-only attribute on the basis of the directed arc definition of the continuous Petri net. The extended directed arc is called the read-only arc. After the transition pointed to by the read-only arc meets the triggering condition, the transition only reads the number of tokens in the library place without removing the tokens in the library place. The continuous Petri net with extended read-only attribute is used to build the intersection traffic flow and road section model.
[0083] Step 1.1: The basic continuous Petri net can be defined as a six-tuple, specifically:
[0084] CPN=(P,T,A,W,θ,M0)
[0085] Where:
[0086] P={p1,p2,…,p m} is a finite non-empty set of places;
[0087] T={t1,t2,…,t n} is a finite non-empty set of transitions;
[0088] is a finite set of directed arcs;
[0089] is a positive real-valued weight assigned to each arc, which is a positive real number;
[0090] θ→[0,1] is the mapping of transition threshold;
[0091] is the initial token set of the system, which is the mapping from place tokens to non-negative real numbers;
[0092] The difference from ordinary Petri nets is that continuous Petri nets have real number labels, real number excitations and continuous flow characteristics to describe continuous systems.
[0093] The read-only attribute is extended on the basis of the directed arc definition of the continuous Petri net. The read-only arc provides a way for the transition to check the number of tokens without changing the number of tokens in the place. Therefore, the enabling conditions of the read-only arc are the same as those of the ordinary arc, but the triggering rules are different. The transition pointed to by the read-only arc enables only reading the number of tokens in the place without removing the place tokens. Through the read-only arc, the transition can make a judgment without affecting the state of the input place.
[0094] Here is the definition of read-only arc firing rules:
[0095] Step 1.2: For a transition t∈T, p×t∈RA, the input place p satisfies M(p)≥W(p,t), then M'(p)=M(p), where M'(p) is the output place token.
[0096] Step 1.3: The continuous Petri net with extended read-only arc attribute can be defined as a seven-tuple, specifically:
[0097] CPN=(P,T,A,RA,W,θ,M0)
[0098] Where:
[0099] The definitions and syntax of P, T, A, θ, and M0 are the same as those of the basic continuous Petri net, so they will not be repeated here.
[0100] RA is a finite set of read-only arcs, which is a mapping from locations to transitions; the graphical representation of read-only arcs is a dotted arrow pointing from the library to the transition.
[0101] The intersection is divided into four intersection sections A, B, C, and D in a clockwise direction, so as to clearly study the movement of vehicles when they cross the intersection. For section A, after vehicles enter section A from the west, vehicles that need to go straight will cross the intersection and enter the exit lane of section C and drive to the east; after vehicles enter section A from the west, vehicles that need to turn left will cross the intersection and enter the exit lane of section B and drive to the north. Similarly, the movement of traffic flows in other sections after entering the intersection is similar to that in section A.
[0102] According to the above intersection traffic flow behavior and road section layout, a continuous Petri net intersection traffic flow and road section model is constructed as follows: Figure 2 As shown, some symbols are introduced to better describe the stage and significance of traffic flow at each intersection in the road section:
[0103] The section that the traffic flow enters is "x"; the superscript "in" indicates entering the section, and the superscript "out" indicates leaving the section; the subscript "xL" indicates the left turn lane of section x, and the subscript "xS" indicates the straight turn lane of section x; the place and transition with the superscript "det" indicate that the vehicle enters the intersection monitoring area and the detector monitors the vehicle; the superscript of the transition indicates the specific effect achieved after the transition is triggered.
[0104] To explain the continuous Petri net intersection traffic flow and road segment model library and transition definitions in more detail, see Table 1 below:
[0105] Table 1 Definition of continuous Petri net cross traffic flow and road segment model library and transition
[0106]
[0107] In the continuous Petri net intersection vehicle and road segment model, the library The superscript indicates the traffic state or stage of the traffic flow in the intersection, and the subscript indicates whether the road section and lane of the traffic flow in the intersection belong to straight or left turn; the number of tokens M in the library p indicates the number of vehicles in the traffic flow at this stage; transition Indicates changes in the traffic flow state or phase at an intersection.
[0108] The continuous Petri net intersection vehicle and road section model has the function of detecting the number of tokens read in the library. The design is as follows: and change Indicates that traffic flow enters the waiting state from the detection state. A read-only arc is used at this transition. and Make the change and After stimulation and Implementing Waiting Places and For testing library and Read the number of tokens.
[0109] Step 2: Continue to extend the inhibition attribute IA based on the definition of the directed arc A in the continuous Petri net CPN = (P, T, A, RA, W, θ, M0) with extended read-only attribute. If there is a mark in the library place connected by the inhibition arc IA, the transition cannot be triggered. Only when there is no mark in the library place connected by the inhibition arc can the transition be triggered. Inhibition arcs are often used to implement mutually exclusive conditions or specific control logic.
[0110] Here is the definition of the inhibition arc excitation rule:
[0111] Step 2.1: For any transition t in the set T, if there exists an inhibition arc a(p×t)∈IA, and the number of tokens M(p) in the input library p, the read-only arc weight W(p,t) and the transition threshold θ(t) satisfy M(p)×W(p,t)<θ(t), then the transition t is called excited. IA is a finite set of inhibition arcs, which is a mapping from positions to transitions.
[0112] Step 2.2: The continuous Petri net with extended read-only and inhibition attributes is defined as an octet:
[0113] CPN=(P,T,A,RA,IA,W,θ,M0)
[0114] Where:
[0115] The definitions and syntax of P, T, A, θ, M0, and RA are the same as those of the continuous Petri net with extended read-only attributes, so they will not be described in detail.
[0116] IA is a finite set of inhibition arcs, which is a mapping from positions to transitions; the graphical representation of inhibition arcs is a solid arrow with a hollow circle at the end, pointing from the library to the transition.
[0117] The phase action process of the intersection signal light is: go straight in the east-west direction → turn left in the east-west direction → go straight in the north-south direction → go straight in the north-south direction, and then return to the east-west direction to cycle in sequence; because the traffic flow can still pass through the intersection during the yellow light time, the present invention includes the yellow light time in the green light time, and the sum of the green light time of all phases is the signal light cycle length.
[0118] According to the above-mentioned intersection signal light phase action, a continuous Petri net intersection signal light model is constructed as follows: Figure 3 As shown, some symbols are introduced to better describe the stage and meaning of the signal light process action at each intersection in the road section:
[0119] In the continuous Petri net intersection signal model, the place superscript "GT" is the green light time of the phase, and the subscripts "1, 2, 3 and 4" are the phase numbers of the phase; the transition subscript "x→x+1" indicates the phase x stage switch; the transition superscript "re" indicates resetting the green light time of the phase.
[0120] To explain in more detail the location and transition definitions of the continuous Petri net intersection signal model are shown in Table 2:
[0121] Table 2 Continuous Petri net intersection signal model library and transition definitions
[0122]
[0123] In the continuous Petri net intersection signal model, the library p x , and They represent the signal light phase stage, the current phase green light time and the signal light control library, library p x When the number of tokens is 0, it indicates the end of the phase stage, and when the number of tokens is 1, it indicates the beginning of the phase stage; the transition t x→x+1 , and They represent the switching phase stage, the reset phase green light time and the reading green light time respectively.
[0124] The continuous Petri net intersection signal light model mainly includes three functions: phase switching, green light time resetting and green light time reading.
[0125] The design of the phase switching function is as follows: the directed arc To suppress the arc, when the library The number of tokens is 0, and the library place px When the token number is 1, it means that the current phase green light time has ended. With p x In the inhibition arc Under the action of jointly triggering transition t x→x+1 , to achieve phase switching;
[0126] The design of the green light time reset function is as follows: directed arc and To suppress the arc, when the library and When the number of tokens in the middle is 0, it means that the green light time of the previous phase has ended. and In the inhibition arc and Under the influence of Reset the green light time of the current phase.
[0127] The design of the green light time reading function is as follows: directed arc For read-only arcs, read the library location The token number is stored in the signal light control library Realize the reading of green light time.
[0128] The following example takes the east-west direction of phase 1 as an example: In phase 1, the number of tokens in place p1 is 1. The number of tokens in the phase is the green light time of phase 1; after the green light time of phase 1 is completed, the library The number of tokens in is 0, To suppress the arc, Together with p1, it triggers transition t 1→2 , then the number of tokens in place p1 decreases by 1, the number of tokens in place p2 increases by 1, and the phase switches to phase 2; when place p1 The number of tokens is 0 and the library When the number of tokens is also 0, and To suppress the arc, the transition Trigger transitions together with p1 Reset Library The number of tokens is set to start timing the green light time of phase 2. Similarly, the actions of other phases can mirror the action flow of phase 1.
[0129] The replacement operation of continuous Petri nets is introduced to decompose complex systems into smaller modular components, making them easier to understand and modify, and improving the readability of the model.
[0130] Here is the definition of the substitution operation:
[0131] Step 2.3: For any two subnets N1 = (P1, T1, A1) and N2 = (P2, T2, A2), perform replacement operation. After replacement, N' = (P', T', A') satisfies P' = (P-P1) ∪ P2, T' = (T-T1) ∪ T2.
[0132] The continuous Petri net intersection signal model is simplified to a library after replacement operation. Replaced library The same as the library in the intersection traffic flow and road section model in Step 1 Inspiring change together Construct a complete continuous Petri net intersection model to realize traffic light control. Figure 4 shown.
[0133] Step 3:
[0134] Step 3.1: The basic fuzzy Petri Net can be defined as an eleven-tuple, specifically:
[0135] FPN=(P,T,D,A,F,θ,μ,λ,r,Ac,M0)
[0136] Where:
[0137] P={p1,p2,…,p m} is a finite non-empty set of places;
[0138] T={t1,t2,…,t n} is a finite non-empty set of transitions;
[0139] D={d1,d2,…,d m} is a finite non-empty set of propositions;
[0140] P∩T∩D=Φ,|P|=|D|;
[0141] is a finite set of directed arcs;
[0142] is the fuzzy arc weight set, F(a) represents the fuzzy weight of the arc, and a is the corresponding arc;
[0143] θ→[0,1] is the mapping of transition threshold;
[0144] μ is a set of membership functions used to calculate fuzzy weights, F(a) = μ(m; y), m = (m1, m2, ... is the input value, which is the system state or the number of tokens on the arc, y is the parameter set of the membership function;
[0145] λ:T→[0,1] is a confidence set that maps each T to the interval [0,1];
[0146] r=(r1,r2,...r n ) is a set of rules, each T is mapped to a corresponding fuzzy rule, and the fuzzy rule can be defined as:
[0147] r i :IF(x1 is AND(x2 is AND…AND(x i yes THEN(τ is μ τ
[0148] Where m1, m2, …, m i is the fuzzy input quantity, is the fuzzy membership function corresponding to the input quantity, τ is the excitation result of the transition, μ τ is the membership function of the result;
[0149] m:P→D is a mapping from places to propositions;
[0150] Ac is the set of activated states of fuzzy rule transitions;
[0151] is the place P to a non-negative real number The mapping of
[0152] According to fuzzy reasoning logic, the enabling rules of fuzzy Petri nets and continuous Petri nets are different. Here is the definition of fuzzy Petri net transition enabling:
[0153] Step 3.2: For a transition t, Ac=M(p)×F(p,t)×λ(t)≥θ(t), then the transition t is called enabled.
[0154] Extend the basic properties of transitions in fuzzy Petri nets to implement complex calculation logic. Operational transitions allow arithmetic operations on tag numbers during transition activation, which is very useful in scenarios where you need to dynamically adjust resource allocation, perform proportional calculations, or handle complex conditions.
[0155] Here is the definition of the triggering rules for operation transitions:
[0156] Step 3.3: For changes and places p×t∈Op has M(p)>0, and the addition, subtraction and ratio operations are defined respectively:
[0157]
[0158] Among them, the library p O is the output place, {p1,p2,…,p n} are all input locations of the operation transition.
[0159]
[0160] Where:
[0161] Op(t)=M(P i ) / M(P j ) is the transition operation definition, transition t calculates the library place P i and P j and assign it to the place P k ;
[0162] M(P j )≠0 is the transition triggering condition. The triggering condition of transition t is M(P j )≠0;
[0163] M'(p O )=Op(t)=M(P i ) / M(P j ) is the result of transition activation. When transition t is activated, it will O ) is updated to the result of Op(t);
[0164] Step 3.4: The fuzzy Petri net after expanding the operation attributes can be defined as a twelve-tuple:
[0165] FPN=(P,T,D,A,F,θ,μ,λ,r,Ac,Op,M0)
[0166] Among them, the definitions and syntax of P, T, A, θ, M0, F, θ, μ, λ, r, and Ac are the same as those of the basic fuzzy Petri net and will not be repeated here.
[0167] Op:T→"Operation" is a mapping from transition to operation; the graphical representation of operation transition is a dotted rectangle.
[0168] Some basic calculations are defined through the extended fuzzy Petri net, including the calculation of the proportion of heavy vehicles, the defuzzification operation and the calculation of the phase green light time, specifically:
[0169] Calculate the proportion of heavy vehicles in the corresponding phase, specifically:
[0170]
[0171] Where N H is the number of heavy vehicles, N T is the total number of vehicles in this phase, P HThe proportion of heavy vehicles.
[0172] Defuzzification operation changes, using the center of gravity method to defuzzify the number of output place tokens, and obtain the green light increase time of the fuzzy Petri net. The green light increase time is added to the basic green light time and returned to the continuous Petri net to realize the signal control function. The defuzzification formula of the center of gravity method is as follows:
[0173]
[0174] Where M i is the fuzzy value of the output place.
[0175] The calculation of the green light time of the corresponding phase is as follows:
[0176] M green time =M green increace time +basic greentime
[0177] Where M green time is the number of phase green light time tokens, M green increace time Add time to the green light. Basicgreentime is the basic green light time. The basic green light time is adjusted according to the actual situation of the intersection.
[0178] The fuzzy rules are defined for the extended fuzzy Petri net. r is a fuzzy rule composed of "and" and "or" judgment logic. Each transition t is mapped to the corresponding fuzzy rule. The transition rule is obtained according to the minimum-maximum reasoning method: suppose the i-th place and the j-th transition in the fuzzy Petri net, for the enabled transition t j , take all its input locations p i Calculation result Ac ij =m i ×f ij ×λ j The minimum value in the transition t j The excitation output value; for a multiple input transition t j Place p i+1 , take all input transitions t j The maximum value among the excitation values is taken as the output location p i+1 The number of tokens updated, specifically:
[0179]
[0180] Where: Ac ij For library p i To Transitionj The calculation result is also called the transition excitation value, m i is the token of place i, f ij For library p i Direction change j The fuzzy weight of arc j, λ j For change j confidence, σ is the excitation function, θ j is the transition threshold;
[0181] The membership calculation function uses the triangle membership function, which is:
[0182]
[0183] Where y = a, b, c are the parameters of the triangle membership function;
[0184] Reasonable division of fuzzy subsets to ensure that the subset division meets the actual signal light control requirements, the range of the number of vehicles is set to [0,20], and it is divided into 5 fuzzy subsets, named as: {very few, few, medium, many, a lot}, abbreviated as {VS, S, M, MN, VM}; the range of the proportion of heavy vehicles is set to [0,1], and it is divided into 5 fuzzy subsets, named as: {very low, low, medium, high, very high}, abbreviated as {VL, L, M, H, VH}; the range of the output green light increase time is set to [0,40], and it is divided into 5 fuzzy subsets, named as: {very short, short, medium, long, very long}, abbreviated as {VS, S, M, L, VL}. The fuzzy rules are shown in Table 3:
[0185] Table 3 Fuzzy reasoning rules
[0186]
[0187] According to the above-mentioned fuzzy Petri net with extended calculation operation attributes, basic calculation definition and fuzzy rules, the fuzzy Petri net signal light fuzzy control model is as follows: Figure 5 The location and transition definitions of the fuzzy Petri net intersection signal light fuzzy control model are shown in Table 4:
[0188] Table 4 Fuzzy Petri net intersection signal light fuzzy control model library and transition definition
[0189]
[0190]
[0191] In the fuzzy Petri net intersection signal light fuzzy control model, the library p VN and p PHVRespectively represent the number of vehicles and the proportion of heavy vehicles in the fuzzy input; and They represent the fuzzy subsets of fuzzy input and output under the triangular membership function; GT Indicates the result of defuzzification of output quantity. Green light increases the time; transition The input quantity is fuzzified using the triangle membership function, and the input library p VN and p PHV Through operational changes Points to its corresponding fuzzy subset and
[0192] change The input places come from the fuzzified subset and change After the triggering conditions are met, the minimum inference method in Step 3.2 is executed to obtain the corresponding fuzzy rule transition Output of The input transition comes from the corresponding rule Changes to rules that meet the conditions Execute the maximum inference method in Step 3.2 to infer the green light increase time;
[0193] Change df Using the center of gravity method, the library p out The output quantity in is defuzzified and the green light increase time is output, which is added to the basic green light time to be the green light time of this phase and stored in the green light time library p GT , to achieve the green light time output of the corresponding phase signal light.
[0194] The fuzzy control model of the intersection signal light of the fuzzy Petri net includes two modules: input and output. The input module reads the reading library of each phase in the complete continuous Petri net intersection model. Replaced with the input library p of the corresponding phase of the fuzzy control model of the fuzzy Petri intersection network signal light VN and p PHV The output module simplifies the network structure of the fuzzy Petri intersection network signal light fuzzy control model into a library after replacement operation. Replaced library Complete continuous Petri net intersection model library Inspiring change together The intersection signal light fuzzy control model is combined with the complete continuous Petri net intersection model in Step 2, and an adaptive control intersection model based on continuous Petri net and fuzzy Petri net is constructed to realize the adaptive control of traffic light. Figure 6 shown.
[0195] Step 4: Based on the fuzzy control model of intersection traffic lights using fuzzy Petri nets, a fuzzy neural Petri net intersection traffic light control optimization algorithm is proposed according to the back propagation algorithm.
[0196] Initialize the initial parameters of the transition within the range that can be triggered; initialize the transition parameters. Assuming that the fuzzy rules are set to an average distribution, the parameter initialization formula is as follows:
[0197]
[0198] Where n in and n out are the number of nodes in the input layer and the output layer respectively.
[0199] The transition activation function is designed. According to the characteristics of the intersection signal light control system, a Sigmoid excitation function with relatively stable gradient changes is set. The relationship between the fuzzy input value and the transition confidence, threshold and fuzzy weight is defined. It can nonlinearly map the input and output of the fuzzy Petri net intersection signal light fuzzy control model and determine whether the transition is enabled. Specifically:
[0200]
[0201] Where Ac is the rule transition in the fuzzy control model of intersection signal lights in fuzzy Petri nets The calculation result is Ac=M(p)×F(p,t)×λ(t), where M(p) is the number of tokens in the input place, F(p,t) is the transition fuzzy weight, and λ(t) is the transition confidence.
[0202] Input simulation sample data, and calculate the fuzzy membership range of each set of input data and the triggered rules and their activation values through the fuzzy control system; for each set of simulation sample data, only the transitions corresponding to the triggered rules are trained and the activation values are calculated;
[0203] The loss is calculated using mean square error, and the weight, confidence and threshold of the transition are updated by gradient descent method. The gradient calculation formula is as follows:
[0204]
[0205] The loss function calculation formula is as follows:
[0206]
[0207] In the formula, y i is the true value, is the algorithm prediction value.
[0208] Use the same data to iteratively train the transition until the transition cannot be triggered. Keep the last set of parameters that can trigger the transition as temporary parameters. Compare the error between the activation value and the standard activation value under the new and old temporary parameters. Take the one with the smallest error as the new temporary parameter. Repeat these steps until all transition parameters are stable or the simulation sample data is used up. Output the trained transition parameters. The algorithm flow is as follows: Figure 7 shown.
[0209] Step 5: Simulation road network construction: Use the open source global map project OpenStreetMap as the source of map data; use SUMO's built-in tool netconvert to convert OpenStreetMap map data into a .net.xml file that can be used by SUMO; create a traffic flow .rou.xml file to define vehicle types, routes and their traffic.
[0210] Simulated detector settings: In the SUMO simulation software, the detector simulates the real induction coil or camera to analyze and optimize the traffic signal control strategy. The detector output file type is XML. The detector settings are as follows:
[0211] The lane area detector can record key data such as the number of vehicles passing through a lane, speed, acceleration, etc. The number of traffic jams in the road section obtained by the area detector is used as the fuzzy input quantity of the fuzzy neural Petri net signal control optimization algorithm: the number of vehicles.
[0212] The induction coil can detect the passing of vehicles in real time and collect data such as the number of vehicles, vehicle type, speed and headway, etc. The type of vehicles passing through the road section is obtained through the induction coil, and the fuzzy input quantity is obtained through calculation: the proportion of heavy vehicles.
[0213] Use Python to develop the API provided by SUMO, use the traci.start() method to connect to SUMO for real-time interaction, and run the simulated road network. Figure 8 shown.
[0214] Step 6: Use the traffic flow data and the corresponding phase signal light timing data obtained from running the simulated road network as training sample data; train the transition parameters according to the fuzzy neural Petri net intersection signal light control optimization algorithm in Step 4, optimize the transition confidence, threshold, and the weights between the library and the transition, so as to correct the parameters in the training to achieve the expected goals; bring the transition parameters trained by the fuzzy neural Petri net intersection signal light control optimization algorithm into the adaptive control intersection model based on continuous Petri nets and fuzzy Petri nets, and verify the accuracy of the algorithm's training of transition parameters by comparing the simulation sample data and the green light duration after training. The accuracy verification experimental results are as follows: Fig. 9 shown.
[0215] The SUMO simulation software was used to conduct a comparative experiment on traffic light control strategies. By comparing with the fixed timing scheme and the linear control scheme, the data output of the simulated road network operation was obtained and the evaluation indicators were calculated. The evaluation indicators were the average time loss, the average waiting time and the total number of vehicles.
[0216] Mean time loss refers to the average time a vehicle loses in a traffic system due to deceleration, stopping and acceleration.
[0217] It reflects the degree of traffic flow congestion and is an important indicator for evaluating the efficiency of traffic signal control.
[0218]
[0219] Where N is the number of vehicles, is the actual travel time of vehicle i, is the time the vehicle travels without interference.
[0220] Average waiting time is the average time a vehicle spends waiting at a traffic signal or jam before reaching its destination.
[0221] It is a key indicator for measuring the performance of traffic signal systems and road capacity.
[0222]
[0223] Where N is the number of vehicles, w i The waiting time of vehicle i usually refers to the time it stays at a red light.
[0224] The comparative experimental results are shown in Table 5.
[0225] Table 5 Traffic light control effect
[0226]
[0227] As can be seen from Table 5, for the signal light control of a certain phase of the intersection, the signal light control method based on fuzzy neural Petri net can effectively reduce the average time loss and average waiting time of vehicles compared with the traditional fixed timing scheme and the linear control scheme of SUMO, and at the same time increase the number of vehicles passing through the intersection. The results show that the algorithm can effectively improve the control effect of intersection signal lights.
[0228] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A method for intersection modeling and signal light control optimization based on fuzzy neural Petri net, characterized in that: The method comprises: Step 1: Extend the read-only attribute on the basis of the directed arc definition of the continuous Petri net. The extended directed arc is called the read-only arc. After the transition pointed to by the read-only arc meets the triggering condition, the transition only reads the number of tokens in the library place without removing the tokens in the library place. The continuous Petri net with extended read-only attribute is used to build the intersection traffic flow and road section model. Step 2: Based on the continuous Petri net with extended read-only arc attributes, the directed arc attributes are further extended. The extended directed arcs are defined as inhibition arcs. Inhibition arcs are used to check the transition triggering conditions and prevent the transition triggering that does not meet the conditions. The intersection signal light model is constructed using the continuous Petri net with extended read-only attributes and inhibition attributes. The replacement operation of the continuous Petri net is introduced to realize the replacement of the control library in the intersection signal light model and the intersection traffic flow and road section model, and a complete continuous Petri net intersection model is constructed. Step 3: Introduce fuzzy Petri net to optimize traffic light control, expand the basic attributes of transition in fuzzy Petri net, define the expanded transition as operation transition, which has the function of calculating the number of tokens in the library, and then define its fuzzy rules. Use the fuzzy Petri net with expanded transition operation attributes and defined fuzzy rules to build the fuzzy control model of intersection traffic lights. Use substitution operation to realize the combination of intersection traffic light fuzzy control model and complete continuous Petri net intersection model, and build an adaptive control intersection model based on continuous Petri net and fuzzy Petri net. Step 4: Based on the fuzzy control model of intersection signal lights, a fuzzy neural Petri net signal light control optimization algorithm is proposed according to the back propagation algorithm, and a fuzzy neural Petri net control optimization model is constructed; Step 5: In the SUMO simulation software, build a simulated road network according to the intersection layout and mixed traffic flow data, set up simulation detectors and run the simulated road network; Step 6: The traffic flow data and the corresponding phase signal timing data obtained by running the simulated road network are used as training sample data and input into the fuzzy neural Petri net control optimization model for training. The confidence, threshold and weights between places and transitions in the adaptive control intersection model are optimized to correct the parameters in training to achieve the expected goals. The accuracy of the optimization algorithm in training transition parameters is verified by comparing the simulation sample data and the green light duration after training.
2. The intersection modeling and signal light control optimization method based on fuzzy neural Petri net according to claim 1 is characterized in that: The Step 1 includes: Step 1.1: In the basic continuous Petri net CPN = (P, T, A, W, θ, M0), the read-only attribute RA is extended on the basic definition of the directed arc A. The read-only arc RA provides a way to check the number of tokens for the continuous Petri net transition. The read-only arc reads the detection area library. The number of tokens in the above place is unchanged. The enabling condition of the read-only arc RA is the same as that of the common arc, but the excitation rule is different. The read-only arc firing rules are defined as follows: For any transition t in the set T, if there exists a read-only arc a(p×t)∈RA, and the number of tokens in the input place p M(p), the read-only arc weight W(p,t) and the transition threshold θ(t) satisfy M(p)×W(p,t)≥θ(t), then M'(p)=M(p), where M'(p) is the number of output place tokens; RA is a finite set of read-only arcs, which is a mapping from places to transitions; The continuous Petri net with extended read-only attribute is defined as a seven-tuple CPN = (P, R, A, RA, W, θ, M0); Step 1.2: Use the places, transitions and directed arcs in the continuous Petri net seven-tuple CPN=(P, T, A, RA, W, θ, M0) with extended read-only attributes to construct a continuous Petri net intersection vehicle and road section model; In the continuous Petri net intersection vehicle and road segment model, the library and The superscript indicates the traffic state or stage of the traffic flow in the intersection, and the subscript indicates whether the road section and lane of the traffic flow in the intersection belong to straight or left turn; the number of tokens M in the library p indicates the number of vehicles in the traffic flow at this stage; transition Indicates changes in the traffic flow state or phase at the intersection; The continuous Petri net intersection vehicle and road section model has the function of detecting the number of tokens in the library, specifically: and change Indicates that traffic flow enters the waiting state from the detection state. A read-only arc is used at this transition. and Make the change and After stimulation and Implementing Waiting Places and For testing library and Read the number of tokens.
3. The intersection modeling and signal light control optimization method based on fuzzy neural Petri net according to claim 1 is characterized in that: The Step 2 includes: Step 2.1: Continue to extend the inhibition attribute IA based on the definition of the directed arc A in the continuous Petri net CPN=(P,T,A,RA,W,θ,M0) with extended read-only attribute. If the place connected to the inhibition arc IA has a mark, the transition cannot be triggered. Only when the place connected to the inhibition arc has no mark, the transition can be triggered. The inhibition arc firing rule is defined as: for any transition t in the set T, if there is an inhibition arc a(p×t)∈IA, and the number of tokens M(p) in the input place p, the read-only arc weight W(p,t) and the transition threshold θ(t) satisfy M(p)×W(p,t)<θ(t), then the transition t is called firing; IA is a finite set of inhibition arcs, which is a mapping from positions to transitions; The continuous Petri net with extended read-only attribute and inhibition attribute is defined as an octet CPN = (P, T, A, RA, IA, W, θ, M0); Step 2.2: Use the places, transitions and directed arcs in the continuous Petri net octet CPN=(P, T, A, RA, IA, W, θ, M0) with extended read-only and inhibition attributes to construct a continuous Petri net intersection signal model; In the continuous Petri net intersection signal model, the library p x , and They represent the signal light phase stage, the current phase green light time and the signal light control library, library p x When the number of tokens is 0, it indicates the end of the phase stage, and when the number of tokens is 1, it indicates the beginning of the phase stage; the transition t x→x+1 , and They represent the switching phase stage, the reset phase green light time and the reading green light time respectively; The continuous Petri net intersection signal model includes three functions: phase switching, green light time reset and green light time reading; Among them, the phase switching function is: directed arc To suppress the arc, when the library The number of tokens is 0, and the place p x When the token number is 1, it means that the current phase green light time has ended. With p x In the inhibition arc Under the action of jointly triggering transition t x→x+1 , to achieve phase switching; The green light time reset function is: directed arc and To suppress the arc, when the library and When the number of tokens in the middle is 0, it means that the green light time of the previous phase has ended. and In the inhibition arc and Under the influence of Reset the green light time of the current phase; Green light time reading function: directed arc For read-only arcs, read the library location The token number is stored in the signal light control library Realize the reading of green light time; Step 2.3: Introduce the replacement operation of continuous Petri nets. The replacement operation is: for any two subnets N1 = (P1, T1, A1) and N2 = (P2, T2, A2), the replacement operation is performed. After the replacement, N' = ([P', T', A') satisfies P' = (P-P1) ∪ P2, T' = (T-T1) ∪ T2; The continuous Petri net intersection signal model is simplified to a library after replacement operation. Replaced library The same as the library in the intersection traffic flow and road section model in Step 1 Inspiring change together Construct a complete continuous Petri net intersection model to realize signal light control of traffic flow.
4. The intersection modeling and signal light control optimization method based on fuzzy neural Petri net according to claim 1 is characterized in that: The Step 3 includes: Step 3.1: Introduce fuzzy Petri net to optimize traffic light control. In the fuzzy Petri net FPN = (P, T, D, A, F, θ, μ, λ, r, Ac, M0), the operation attribute is extended on the basis of the transition definition. The operation transition allows arithmetic operations on the number of markers during the transition excitation process. The triggering rule of operation transition is: for any transition t in the set T, there is an input place p∈P, which defines addition and subtraction operations and ratio operations. The triggering rule of addition operation transition is: M'(p O )=Op(t)=M(p1)+M(p2)+…+M(p n ); the triggering rule for the subtraction operation transition is: M'(p O )=Op(t)=M(p1)-M(p2)-…-M(p n ); The triggering rule for the ratio operation transition is: M'(p O )=Op(t)=M(P i ) / M(P j ); The ratio operation transition is used to calculate the proportion of heavy vehicles, the addition operation transition is used to calculate the phase green light time, and the input layer transition Subtraction operation transition and ratio operation transition are used to realize input fuzzification and defuzzification transition t df The addition operation transition and ratio operation transition are used to realize the centroid method of defuzzification. Op:T→"operation operation" is a mapping from transition to operation operation. The extended fuzzy Petri net is defined as a twelve-tuple FPN = (P, T, D, A, F, θ, μ, λ, r, Ac, Op, M0); Step 3.2: Define fuzzy rules for the extended fuzzy Petri net. r is a fuzzy rule composed of "and" and "or" judgment logic. Each transition t is mapped to the corresponding fuzzy rule. The transition rule is obtained according to the minimum-maximum reasoning method: Let the i-th place and the j-th transition in the fuzzy Petri net be equal. For the enabled transition t j , take all its input locations p i Calculation result Ac ij =m i ×f ij ×λ j The minimum value in the transition t j The excitation output value; for a multiple input transition t j Library place p i+1 , take all input transitions t j The maximum value among the excitation values is taken as the output location p i+1 The number of tokens updated; Step 3.3: Using the places, transitions and directed arcs in the fuzzy Petri net twelve-tuple FPN=(P, T, D, A, F, θ, μ, λ, r, Ac, Op, M0) with extended operation attributes and completed fuzzy rule definitions, a fuzzy Petri net intersection signal light fuzzy control model is constructed; In the fuzzy Petri intersection network signal light fuzzy control model, the library p VN and p PHV Respectively represent the number of vehicles and the proportion of heavy vehicles in the fuzzy input; and They represent the fuzzy subsets of fuzzy input and output under the triangular membership function; GT Indicates the result of defuzzification of output quantity. Green light increases the time; transition The input quantity is fuzzified using the triangle membership function, and the input library p VN and p PHV Through operational changes Points to its corresponding fuzzy subset and change The input places come from the fuzzified subset and change After the triggering conditions are met, the minimum inference method in Step 3.2 is executed to obtain the corresponding fuzzy rule transition Output of The input transition comes from the corresponding rule Changes to rules that meet the conditions Execute the maximum inference method in Step 3.2 to infer the green light increase time; Change df Using the center of gravity method, the library p out The output quantity in is defuzzified and the green light increase time is output, which is added to the basic green light time to be the green light time of this phase and stored in the green light time library p GT , realize the green light time output of the corresponding phase signal light; Step 3.4: The fuzzy control model of the signal light at the fuzzy Petri intersection network includes two modules: input and output. The input module reads the reading library of each phase in the complete continuous Petri net intersection model. Replaced with the input library p of the corresponding phase of the fuzzy control model of the fuzzy Petri intersection network signal light VN and p PHV The output module simplifies the network structure of the fuzzy Petri intersection network signal light fuzzy control model into a library after replacement operation. Replaced library Complete continuous Petri net intersection model library Inspiring change together The fuzzy control model of intersection traffic lights is combined with the complete continuous Petri net intersection model in Step 2, and an adaptive control intersection model based on continuous Petri nets and fuzzy Petri nets is constructed to realize adaptive control of traffic lights.
5. The intersection modeling and signal light control optimization method based on fuzzy neural Petri net according to claim 1 is characterized in that: The Step 4 includes: Step 4.1: The optimization algorithm includes initializing transition parameters, designing transition activation functions, updating parameters by gradient descent method, calculating losses, iterating training and outputting results; Initialize the transition parameters. Assuming that the fuzzy rules are set to average distribution, the parameter initialization formula is as follows: Where n in and n out are the number of nodes in the input layer and the output layer respectively; Step 4.2: Design the transition activation function. According to the characteristics of the intersection signal control system, set the Sigmoid type excitation function with relatively stable gradient changes, define the relationship between the fuzzy input value and the transition confidence, threshold and fuzzy weight, and nonlinearly map the input and output of the fuzzy Petri intersection network signal fuzzy control model, and determine whether the transition is enabled. Specifically: Where Ac is the rule transition in the fuzzy control model of traffic lights in fuzzy Petri intersection network The calculation result is Ac=M(p)×F(p,t)×λ(t), where M(p) is the number of tokens in the input place, F(p,t) is the transition fuzzy weight, and λ(t) is the transition confidence. Input simulation sample data, and calculate the fuzzy membership range of each set of input data and the triggered rules and their activation values through the fuzzy control system; for each set of simulation sample data, only the transitions corresponding to the triggered rules are trained and the activation values are calculated; Step 4.3: Use the mean square error to calculate the loss, and use the gradient descent method to update the weight, confidence and threshold of the transition. According to the designed excitation function, the gradient calculation formula of the transition, confidence and threshold is as follows: Step 4.4: Loss function calculation formula, specifically: In the formula, y i is the true value, is the algorithm prediction value; Step 4.5: Use the same data to iteratively train the transition until the transition cannot be triggered. Keep the last set of parameters that can trigger the transition as temporary parameters. Compare the error between the activation value and the standard activation value under the new and old temporary parameters. Take the one with the smallest error as the new temporary parameter. Repeat these steps until all transition parameters are stable or the simulation sample data is used up, and output the trained transition parameters.
Citation Information
Patent Citations
City traffic system modeling method and system based on colored Petri network
CN105957343A
Petri network-based road traffic modeling method and system, medium and terminal
CN112365704A
Cited By
Underground garage illumination control system and method based on artificial neural network PID, and storage medium
CN120343787A
