A hybrid traffic simulation method and system considering electric bicycles

CN122886393APending Publication Date: 2026-10-09SUN YAT SEN UNIVERSITY SHENZHEN +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611086228.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0006]2)缺乏三类参与者并行的信号交叉口统一仿真框架

Benefits of technology

[0057]本发明方法及系统的有益效果是:本发明通过构建交叉口统一多元胞空间模型,输入道路参数、智能体参数与信号配时参数,完成仿真场景初始化,生成二维元胞网格,布设初始智能体并设定信号灯相位与时长,将电动自行车作为独立智能体纳入机动车-非机动车-行人三者混行的CA仿真框架,赋予其独立的物理参数与行为规则,能够准确刻画电动自行车在城市交通中的实际运行特征,仿真真实性相比现有两两组合模型显著提升;进而根据信号灯相位与时长推进仿真进程,每个时间步起始时按各类智能体的设定到达流率生成新增机动车、电动自行车与行人智能体,并基于当前时刻的全局元胞占用状态,并行计算三类智能体在下一时刻的候选速度、候选位置以及对应的候选占用元胞集合,以电动自行车为基准的多元胞建模方法,以统一粒度适配三类尺寸差异显著的参与者,仿真场景可由信号灯交叉口扩展至路段、网络等更复杂场景,且可方便纳入其他类型交通参与者,具备良好的可延展性;进一步对候选占用元胞集合进行跨类型重叠检测与冲突元胞到达时间校验,依据各智能体到达冲突元胞的估算时间判定通行优先级,对低优先级智能体执行速度强制调整,冲突处理完成后将三类智能体的下一时刻状态统一写入全局状态;最后循环执行时间步推进、智能体运动计算、冲突处理与状态更新流程,直至达到预设仿真终止条件,输出交通流统计指标与仿真可视化结果,能够在每一时间步内维持跨类型元胞互斥约束,减少多个智能体同时占用同一元胞、交叉轨迹互相穿透或因互不让行形成死锁的非物理仿真状态,从而提高混合交通仿真的可复现性和对真实机非人混行场景的表达能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122886393A_ABST
    Figure CN122886393A_ABST
Patent Text Reader

Abstract

The application discloses a kind of hybrid traffic simulation method and system considering electric bicycle, which comprises the following steps: constructing intersection unified multicell space model, inputting road, agent and signal timing parameter initialization simulation scene, generating two-dimensional cell grid and setting signal light phase;With simulation advancing, each time step generates motor vehicle, electric bicycle and pedestrian agent according to flow rate;Combining cell occupation state, parallel computing agent candidate motion state.Detect cross-type cell conflict, according to arrival time to divide priority, force low-priority agent to speed up and update global state;Loop deduce to simulation end, output traffic flow statistical index and visual result.The application can improve the reproducibility of hybrid traffic simulation and the expression ability of real motor vehicle and non-motor vehicle mixed traffic scene.The application can be widely applied to the field of hybrid traffic simulation as a kind of hybrid traffic simulation method and system considering electric bicycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mixed traffic simulation technology, and in particular to a mixed traffic simulation method and system that takes into account electric bicycles. Background Technology

[0002] As urbanization continues, the composition of traffic participants on urban roads is becoming increasingly complex. Motor vehicles, electric bicycles, and pedestrians share the same road network, leading to frequent collisions at traffic light intersections. Electric bicycles are one of the main means of short-distance urban travel, but their proportion in urban traffic accidents remains high.

[0003] Cellular automata (CA) are an important method for microscopic traffic simulation due to their simple rules, high computational efficiency, and ease of expansion. Related techniques include the Neumann architecture (NS) model, improved multi-valued CA models for mixed bicycle flow, mixed car-bicycle CA models, non-mixed flow CA models for signalized intersections, and specialized CA simulations for electric bicycle flow. However, these techniques suffer from the following technical problems, such as:

[0004] 1) Electric bicycles were not included as independent intelligent agents in the mixed traffic CA simulation.

[0005] Existing hybrid traffic CA models typically only distinguish between motor vehicles and ordinary bicycles, simply categorizing electric bicycles as the latter. This fails to reflect the fundamental differences between electric bicycles in terms of maximum speed, vehicle size, acceleration and deceleration capabilities, and driving behavior patterns, resulting in simulation results that do not accurately reflect actual traffic conditions. This invention defines electric bicycles as independent intelligent agents, assigning them unique physical parameters and behavioral rules.

[0006] 2) Lack of a unified simulation framework for signalized intersections with three types of participants operating in parallel.

[0007] Existing research largely focuses on simulations of combinations of two types of participants, and has not yet developed a technical solution that simultaneously incorporates three types of participants—motor vehicles, electric bicycles, and pedestrians—and provides a complete model for traffic light intersection scenarios. This makes existing methods unable to realistically reproduce the mixed traffic state at intersections. This invention constructs a unified simulation framework for the three types of traffic participants.

[0008] 3) The specific behavioral rules of electric bicycles have not been adequately modeled.

[0009] Electric bicycles exhibit unique behaviors in actual operation, such as running red lights with a certain probability, using motor vehicle lanes in congested traffic, and having a different probability of random slowdown compared to ordinary bicycles. Existing CA models lack systematic rule design for these behaviors, resulting in high simulation distortion. This invention designs a complete rule system containing multiple random probability parameters to address these behaviors.

[0010] 4) The existing cell size is not suitable for the physical size differences of the three types of participants.

[0011] Traditional Neumann architectures (NS models) use the length of a motor vehicle (approximately 7.5m) as the unit cell, resulting in excessively large granularity that fails to accurately represent the space occupied by electric bicycles (approximately 2m × 0.5m) and pedestrians (approximately 0.5m × 0.5m) and their relative positions. This invention employs a multi-cell method based on electric bicycles, using 0.5m × 0.5m as the basic unit cell, allowing all three types of participants to express their physical dimensions using an integer number of cells.

[0012] 5) If existing technologies are simply combined and used in three-way mixed scenarios, new cross-type collaboration problems are likely to arise.

[0013] Existing technologies, such as the NS model for motor vehicles, the CA model for electric bicycles, and multi-cell modeling methods, are all designed for single or pairwise scenarios, operating independently without a unified standard for cross-type cell granularity, candidate state synchronization calculation methods, state writing verification order conventions, or yielding decision rules. Directly combining these existing technologies for signalized intersections where motor vehicles, electric bicycles, and pedestrians coexist can easily lead to new technical problems: First, the different cell granularities used in each model make it impossible to accurately determine cell overlap between different types of agents, resulting in inaccurate conflict detection. Second, the lack of unified constraints for cross-type candidate state synchronization calculation and writing may lead to the simultaneous declaration of non-physical states occupied by multiple agents within the same time step for the same cell. Third, the lack of cross-type arrival time yielding decision rules makes it impossible to determine the speed adjustments and yielding targets of various participants when a conflict occurs, potentially leading to simulation results such as penetration, deadlock, or inconsistencies with actual traffic patterns. Summary of the Invention

[0014] To address the aforementioned technical problems, the present invention aims to provide a mixed traffic simulation method and system that considers electric bicycles, which can improve the reproducibility of mixed traffic simulation and the ability to represent real-world mixed traffic scenarios involving both motorized and non-motorized vehicles.

[0015] The first technical solution adopted in this invention is: a hybrid traffic simulation method considering electric bicycles, comprising the following steps:

[0016] Construct a unified multi-cell space model of the intersection, input road parameters, agent parameters and signal timing parameters, complete the simulation scene initialization, generate a two-dimensional cellular mesh, deploy the initial agents and set the traffic light phase and duration;

[0017] The simulation process is advanced according to the phase and duration of the traffic lights. At the beginning of each time step, new motor vehicle, electric bicycle and pedestrian intelligent agents are generated according to the arrival flow rate set by each type of intelligent agent. Based on the global cell occupancy state at the current moment, the candidate speed, candidate position and corresponding candidate occupancy cell set of the three types of intelligent agents at the next moment are calculated in parallel.

[0018] Cross-type overlap detection and conflict cell arrival time verification are performed on the candidate occupied cell set. The passage priority is determined based on the estimated arrival time of each agent to the conflict cell. The execution speed of low-priority agents is forcibly adjusted. After the conflict is resolved, the next moment state of the three types of agents is uniformly written into the global state.

[0019] The process of time step progression, agent motion calculation, conflict handling and state update is executed in a loop until the preset simulation termination condition is reached, and traffic flow statistics and simulation visualization results are output.

[0020] Furthermore, the step of constructing a unified multi-cell space model of the intersection, inputting road parameters, agent parameters, and signal timing parameters, completing the simulation scene initialization, generating a two-dimensional cellular mesh, deploying initial agents, and setting the traffic light phase and duration specifically includes:

[0021] Using a preset unit length as the basic cell side length, the intersection road space is divided into a two-dimensional cell grid indexed by row and column coordinates;

[0022] Based on a two-dimensional cellular grid, according to the number of cells corresponding to the physical size of the agent, electric bicycles occupy 4×1 cells, motor vehicles occupy 10×4 cells, and pedestrians occupy 1×1 cells respectively, and the cell sets occupied by any two agents are constrained to satisfy a mutual exclusion relationship.

[0023] The simulated speed of the intelligent agent is converted into the corresponding actual physical speed according to the cell side length and time step. Based on the input road parameters and signal timing parameters, and combined with the mutual exclusion relationship of the occupied cell set, the simulation scene initialization and the setting of traffic light phase and duration are completed.

[0024] Furthermore, the process of calculating the candidate velocities, candidate positions, and corresponding candidate occupied cell sets of the three types of intelligent agents at the next moment also includes executing a preset longitudinal motion rule for the electric bicycle. The preset longitudinal motion rule is as follows:

[0025] Calculate the forward net distance based on the position of the front agent. If the forward net distance is greater than the current speed, take the minimum value of the current speed plus the acceleration increment and the maximum speed to obtain the candidate speed after acceleration.

[0026] Based on the forward clearance, a deceleration constraint is applied to the accelerated candidate speed, constraining the candidate speed to the forward clearance minus one value and ensuring that the speed is non-negative, thus avoiding rear-end collisions.

[0027] By performing a random slowing operation on the candidate speeds after deceleration using a preset slowing probability, the speed value is reduced by one while ensuring that the speed is non-negative, and finally the candidate speeds and candidate positions of the electric bicycle are obtained, generating the corresponding candidate occupied cell set.

[0028] Furthermore, the process of calculating the candidate speed, candidate position, and corresponding candidate occupied cell set of the three types of intelligent agents at the next moment also includes executing a preset lateral lane-changing rule for the electric bicycle. The preset lateral lane-changing rule is as follows:

[0029] When the forward clearance of the current lane is less than the candidate speed after acceleration, a lane change incentive is triggered. After verifying that the forward clearance of the target lane meets the requirements for passing the candidate speed and the backward clearance is not less than the maximum speed of the electric bicycle, a normal lane change in the non-motorized vehicle lane is performed according to the preset lane change probability.

[0030] When the net distance in front of the non-motorized vehicle lane is lower than the congestion trigger threshold, after verifying that the forward and backward safety distances of the adjacent motorized vehicle lanes meet the requirements, the operation of borrowing the motorized vehicle lane is performed according to the preset borrowing probability.

[0031] When an electric bicycle is in the motor vehicle lane, it will return to the non-motor vehicle lane according to the preset return probability when the forward clearance of the corresponding position in the non-motor vehicle lane meets the return condition.

[0032] Furthermore, the process of calculating the candidate velocity, candidate position, and corresponding candidate occupied cell set of the three types of intelligent agents at the next moment also includes executing a preset traffic light response rule for electric bicycles. The preset traffic light response rule is as follows:

[0033] During the green light phase, electric bicycles normally follow the rules for longitudinal movement and lane changing;

[0034] During a red light phase, the system determines whether to ignore the red light signal and continue to proceed based on a preset probability of running a red light. If the first vehicle is not determined to have run a red light, it will be constrained by the stop line and will slow down and stop. Other vehicles will slow down according to the following rules.

[0035] During the yellow light phase, calculate the time required to reach the stop line at the current speed. If the required time is less than or equal to the remaining time of the yellow light, determine whether to continue passing based on the preset overtaking probability; otherwise, decelerate and stop.

[0036] Furthermore, in the process of calculating the candidate velocity, candidate position, and corresponding candidate occupied cell set of the three types of intelligent agents at the next moment, the following rules are executed for motor vehicles:

[0037] The longitudinal candidate speed is calculated by sequentially performing acceleration, deceleration, and random slowing steps. Lane changing behavior is only performed between similar motor vehicle lanes, and entry into non-motor vehicle lanes and intersection conflict areas is prohibited.

[0038] During the green light phase, longitudinal movement and lane changing rules are executed normally. During the red light phase, the lead vehicle is constrained by the stop line and slows down to stop, while other vehicles slow down according to the following rules.

[0039] During the yellow light phase, a deterministic passage decision is adopted. The time required to reach the stop line at the current speed is calculated. If the required time is not greater than the remaining time of the yellow light, the vehicle can proceed normally; otherwise, it will decelerate and stop.

[0040] Furthermore, in the process of calculating the candidate velocity, candidate position, and corresponding candidate occupied cell set of the three types of agents in the next moment, the following rules are executed for pedestrians:

[0041] Along the direction of pedestrian crossing, perform acceleration, deceleration, and random slowing steps in sequence to calculate the longitudinal candidate velocity and candidate position of the pedestrian.

[0042] During the pedestrian red light phase, pedestrians who have not yet entered the crosswalk are forced to stop and wait at the curb, while pedestrians who have already entered the crosswalk are not bound by the signal switch and continue to cross until they have completed the crossing.

[0043] Furthermore, the step of determining the passage priority based on the estimated arrival time of each agent at the conflict cell and forcibly adjusting the speed of low-priority agents specifically includes:

[0044] Calculate the estimated arrival time of both sides in the conflict at the conflict cell. The side that arrives earlier has priority to pass, while the side that arrives later is forced to slow down or stop.

[0045] In the event of a conflict involving pedestrians, if both parties arrive at the same time or their priorities cannot be distinguished, the pedestrian shall be given priority.

[0046] In the event of a conflict between a motor vehicle and an electric bicycle, if both arrive at the same time or their priorities cannot be distinguished, the motor vehicle shall be given priority, and the speed of the electric bicycle shall be subject to mandatory adjustment.

[0047] Furthermore, the step of uniformly writing the next state of the three types of agents into the global state after the conflict resolution is completed specifically includes:

[0048] The candidate states of all agents are calculated and generated based on the global state at the same moment, and the global cell occupancy state is not modified before the conflict is resolved.

[0049] The final position, velocity, and occupied cell state of the three types of intelligent agents are synchronously written into the global state at the end of the same time step.

[0050] All agents within the same type are updated in full parallel, and the order of individual updates does not affect the global state result;

[0051] The unified writing process adopts the candidate state calculation and state writing verification order for motor vehicles, electric bicycles, and pedestrians. This order is only used for calculation execution and writing verification and does not change the aforementioned yield determination result.

[0052] The second technical solution adopted in this invention is: a hybrid traffic simulation system considering electric bicycles, comprising:

[0053] The first module is used to construct a unified multi-cell space model of the intersection. It inputs road parameters, agent parameters and signal timing parameters, completes the simulation scene initialization, generates a two-dimensional cell mesh, deploys the initial agents and sets the traffic light phase and duration.

[0054] The second module is used to advance the simulation process according to the traffic light phase and duration. At the beginning of each time step, new motor vehicle, electric bicycle and pedestrian intelligent agents are generated according to the set arrival flow rate of each type of intelligent agent. Based on the global cell occupancy state at the current moment, the candidate speed, candidate position and corresponding candidate occupancy cell set of the three types of intelligent agents are calculated in parallel at the next moment.

[0055] The third module is used to perform cross-type overlap detection and conflict cell arrival time verification on the candidate occupied cell set. It determines the passage priority based on the estimated arrival time of each agent to the conflict cell, forces the speed adjustment of low-priority agents, and writes the next moment state of the three types of agents into the global state after the conflict is resolved.

[0056] The fourth module is used to repeatedly execute the time step progression, agent motion calculation, conflict handling and state update process until the preset simulation termination condition is reached, and output traffic flow statistics and simulation visualization results.

[0057] The beneficial effects of the method and system of this invention are as follows: This invention constructs a unified multi-cell space model of intersections, inputs road parameters, agent parameters, and signal timing parameters, completes the simulation scene initialization, generates a two-dimensional cellular mesh, deploys initial agents, and sets the traffic light phase and duration. Electric bicycles are incorporated as independent agents into the CA simulation framework of mixed traffic of motor vehicles, non-motor vehicles, and pedestrians, and are given independent physical parameters and behavioral rules. This accurately depicts the actual operating characteristics of electric bicycles in urban traffic, significantly improving the simulation realism compared to existing pairwise combination models. Furthermore, the simulation process is advanced according to the traffic light phase and duration. At the beginning of each time step, new motor vehicle, electric bicycle, and pedestrian agents are generated according to the set arrival flow rate of each type of agent. Based on the current global cell occupancy state, the candidate speed, candidate position, and corresponding candidate occupancy cell set of the three types of agents are calculated in parallel. This multi-cell modeling method, based on electric bicycles, uses a unified granularity. It adapts to three types of participants with significantly different sizes, and the simulation scenario can be expanded from traffic light intersections to more complex scenarios such as road segments and networks. It can also easily incorporate other types of traffic participants, demonstrating good scalability. Furthermore, it performs cross-type overlap detection and conflict cell arrival time verification on the candidate occupancy cell set. Based on the estimated arrival time of each agent to the conflict cell, it determines the passage priority and forcibly adjusts the execution speed of low-priority agents. After the conflict is resolved, the next moment state of the three types of agents is uniformly written into the global state. Finally, it iteratively executes the time step advancement, agent motion calculation, conflict resolution, and state update process until the preset simulation termination condition is reached, outputting traffic flow statistics and simulation visualization results. It can maintain cross-type cell mutual exclusion constraints in each time step, reducing non-physical simulation states such as multiple agents occupying the same cell at the same time, cross-trajectories penetrating each other, or deadlocks caused by non-yielding, thereby improving the reproducibility of mixed traffic simulation and its ability to express real mixed traffic scenarios of vehicles and non-humans. Attached Figure Description

[0058] Figure 1 This is a flowchart of the steps of a mixed traffic simulation method considering electric bicycles according to the present invention;

[0059] Figure 2 This is a structural block diagram of a hybrid traffic simulation system considering electric bicycles according to the present invention;

[0060] Figure 3 This is a schematic diagram of the overall framework of the simulation system provided in a specific embodiment of the present invention;

[0061] Figure 4 This is a schematic diagram of the simulation operation process provided in a specific embodiment of the present invention. Detailed Implementation

[0062] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.

[0063] First, the technical terms used in the embodiments of this invention will be explained:

[0064] 1) Cellular Automata (CA): A dynamic computational model based on discrete time, space and state, consisting of cells, states, neighborhoods and evolution rules, and widely used for traffic flow micro-simulation.

[0065] 2) NS model (NS, Nagel-Schreckenberg model): The classic single-lane traffic flow CA model, which includes four rules: acceleration, deceleration, random slowing down, and position update. It is the basis for the design of the motion rules of this invention.

[0066] 3) Electric bicycle (EB): a non-motorized vehicle with a pedal function that uses a battery as an auxiliary power source and has a maximum speed of no more than 25 km / h.

[0067] 4) Multi-grid Model: A modeling method that allows different types of traffic participants to express their physical size with different numbers of cells, achieving the coexistence of heterogeneous subjects at a unified cell granularity.

[0068] 5) Random slowdown probability (Pslow,k): This probability is used to perform a deceleration operation on the speed of the k-th agent. It is used to simulate random uncertainties in cycling / driving.

[0069] 6) Probability of running a red light (Prlr): The random probability that an electric bicycle will ignore the signal and continue to move forward during a red light phase. It is used to characterize the features of illegal driving behavior.

[0070] 10) Probability of using a motor vehicle lane (Pmerge): The random probability that an electric bicycle will laterally enter the adjacent motor vehicle lane when the non-motor vehicle lane is congested.

[0071] 11) Conflict Zone: A cellular space within an intersection where the trajectories of traffic participants from different directions or of different types intersect.

[0072] 12) Time Step (t): The basic time unit for simulation propagation. In this invention, it is uniformly taken as 1 second.

[0073] 13) Pedestrian (PED): A natural person who participates in traffic on foot. In this invention, the space occupied by the pedestrian is represented by a 1×1 cell. The maximum speed does not exceed 5.4 km / h. The pedestrian crosses the intersection within the pedestrian crossing phase and is subject to traffic lights.

[0074] 14) Agent numbering rules: Within the same lane, agents are numbered sequentially from smallest to largest according to their longitudinal coordinates. The agent with the smaller number is located in front (i.e., agent n-1 is located in front of agent n). The net distance in front is calculated based on the number of empty cells between adjacent agents with different numbers.

[0075] Furthermore, it should be noted that this embodiment of the invention specifically addresses the problems in related technologies by designing a unified cell granularity, synchronous calculation of candidate states, cross-type conflict detection, arrival time yielding determination, and a unified state writing mechanism. This enables the movement rules of the three types of participants to mutually constrain and co-evolve within the same simulation step, rather than simply piecing together existing technologies. This embodiment uses a traffic light intersection as a typical scenario. Under the unified cell CA framework, electric bicycles are incorporated into the simulation as independent intelligent agents. Their complete physical parameters and behavioral rules are designed, and a unified mechanism for synchronous calculation of candidate states, state writing verification order, and arrival time yielding determination is constructed among the three types of intelligent agents. This enables parallel simulation of the three types of participants and outputs key indicators such as traffic efficiency and conflict characteristics, providing simulation support tools for urban mixed traffic management and intersection optimization.

[0076] Reference Figure 1 This invention provides a simulation method for mixed traffic considering electric bicycles, the method comprising the following steps:

[0077] S100. Construct a unified multi-cell space model of the intersection, input road parameters, agent parameters and signal timing parameters, complete the simulation scene initialization, generate a two-dimensional cell mesh, deploy the initial agents and set the traffic light phase and duration.

[0078] In this embodiment, the present invention uses the multi-grid method to define the simulation space, with a basic cell side length of 0.5m × 0.5m, uniformly dividing the intersection road space into a two-dimensional cellular grid. The grid is defined using row and column coordinates. Index, where The vertical coordinate is along the direction of travel. The horizontal coordinate is the coordinate perpendicular to the direction of travel.

[0079] The basic cell size is:

[0080]

[0081]

[0082] The physical dimensions of various traffic participants and the corresponding number of cells are as follows:

[0083] Electric bicycles:

[0084]

[0085] Motor vehicles:

[0086]

[0087] pedestrian:

[0088]

[0089] An intersection includes motor vehicle lanes (straight and turning lanes), non-motorized vehicle lanes, sidewalks, pedestrian crossings, and a central conflict zone. The width of each functional zone is converted into cells based on actual road parameters. Traffic lights are located at the stop line and have three phases: red, green, and yellow, with configurable phase durations.

[0090] For the set of cells occupied by the agent:

[0091] For the coordinates (The leftmost corner of the front end, i.e., the coordinates of the frontmost and leftmost cell in the horizontal direction of the agent's movement) There are 1 intelligent agent, and the set of cells it occupies is:

[0092]

[0093] in The row and column coordinate indices of the cell grid. For the first The vertical length (number of cells) of an agent. For the first The horizontal width (number of cells) of an agent.

[0094] Mutual exclusion constraint (no two agents may occupy the same cell at the same time):

[0095]

[0096] Road width conversion (actual width converted to cells):

[0097]

[0098] The correspondence between velocity and actual physical velocity:

[0099]

[0100] in The simulation speed is expressed in cells per step. This corresponds to the actual physical velocity (m / s).

[0101] For the definition of the three types of intelligent agents:

[0102] The state variables for each type of agent include: current position coordinates (cell index), current speed (cell / time step), lane number, direction of travel (straight / left turn / right turn), and traffic light perception status. The time step is uniformly set to 1 second.

[0103] Each agent in The state at a given time is represented by a six-tuple:

[0104]

[0105] in The vertical axis is the coordinate of the axis. The horizontal axis is... For speed, The lane number is assigned to the lane in question. As the direction of progress, This indicates the current status of the traffic light.

[0106] For steering trajectory processing:

[0107] The direction of travel of the intelligent agent The direction of movement is determined before entering the intersection conflict zone (randomly assigned proportionally during initialization). Upon entering the conflict zone, agents moving straight continue along the longitudinal coordinate direction; agents turning left or right follow a preset sequence of turning path cells. This means that a list of path cells is predefined within the intersection conflict zone, and the agent updates its position sequentially along the cell coordinates in this list. After completing the turn, the longitudinal movement rules are restored. The speed during the turn does not exceed the maximum speed for the corresponding type.

[0108] Speed ​​constraints:

[0109]

[0110]

[0111]

[0112]

[0113] Acceleration increments (each type takes independent values):

[0114]

[0115]

[0116]

[0117] Different acceleration increments are taken for different types of intelligent agents to reflect the actual characteristics that motor vehicles have significantly better acceleration performance than electric bicycles and pedestrians.

[0118] For various agent density calculations:

[0119] In length Width is Within a region (in terms of cell count), the first The spatial density of participants is:

[0120]

[0121] in For the first in this region Number of participants in each class For the first Cell occupancy of class participants.

[0122] For the definition of flux (the number of agents passing through a cross section per unit time step):

[0123]

[0124] in To collect interface coordinates, For the first The set of all intelligent agents of a class. This is an indicator function.

[0125] S200. The simulation process is advanced according to the phase and duration of the traffic lights. At the beginning of each time step, new motor vehicle, electric bicycle and pedestrian intelligent agents are generated according to the set arrival flow rate of each type of intelligent agent. Based on the global cell occupancy state at the current moment, the candidate speed, candidate position and corresponding candidate occupancy cell set of the three types of intelligent agents at the next moment are calculated in parallel.

[0126] In this embodiment, for the motor vehicle behavior rule system, the longitudinal motion rules of the motor vehicle are executed in the following order at each time step:

[0127] First, the acceleration rules:

[0128]

[0129] in For the first The vehicle length (number of cells) of the intelligent agent; if the vehicle in front is a motor vehicle, then... If the vehicle in front is an electric bicycle, then If there are no cars ahead Choose a sufficiently large value (such as the remaining length of the road).

[0130]

[0131] Execution conditions: If the conditions are not met, the speed remains at the current value, and the deceleration rule is entered.

[0132] Then there are the deceleration rules:

[0133]

[0134] To prevent rear-end collisions and ensure that the speed is non-negative.

[0135] Furthermore, there is the stochastic slowing rule:

[0136] like ,but ,in, These are independent, uniformly distributed random numbers. (Based on actual measurement calibration).

[0137] Finally, the lane changing rules:

[0138] Lane changing by motor vehicles is limited to lateral movement between lanes of the same type and is prohibited from entering non-motorized vehicle lanes. Within the same time step, the following three conditions are evaluated sequentially; if all three conditions are met simultaneously, a probability is applied. Execute lane change:

[0139] It should be noted that the following incentive conditions... Specifically, this refers to the candidate speed obtained from the acceleration rule, i.e., the expected speed before being constrained by the deceleration rule's following distance. This candidate speed is used to determine whether "driving at the expected speed will exceed the current lane clearance," thereby generating a lane-changing motivation. It is denoted in the same way as the final speed obtained at this time step after the deceleration rule and the random slowdown rule. The values ​​of the same symbol at different calculation stages are not the same; the latter, after being constrained by the deceleration rule, will necessarily be less than [value missing]. Therefore, it cannot be used to determine this incentive condition.

[0140] Regarding incentive conditions:

[0141]

[0142] This means that the current lane's forward clearance is insufficient to maintain the current speed, creating an incentive to change lanes.

[0143] For forward safety conditions:

[0144]

[0145] The clearance ahead of the target lane is sufficient to accommodate the current speed.

[0146] For backward security conditions:

[0147]

[0148] The distance between vehicles approaching from behind in the target lane should not be less than the maximum speed of the vehicle, to ensure that the following vehicle does not rear-end the other.

[0149] The net clearance ahead of the target lane (number of cells). The distance between vehicles approaching from behind the target lane (number of cells). (Based on actual measurements, motor vehicles are less willing to change lanes than electric bicycles).

[0150] When the lane change is executed, the agent's lateral coordinates Updated to the target lane's lateral coordinates and lane number. Synchronous updates ensure that the longitudinal position and speed do not change due to the lane change operation itself. The longitudinal position update is still performed normally according to the speed and position update rules calculated by the acceleration rule, deceleration rule and random slowdown rule.

[0151] Lane change restrictions include:

[0152] 1) Motor vehicles are not allowed to change lanes and enter non-motor vehicle lanes or pedestrian lanes;

[0153] 2) Lane changing is prohibited within the intersection conflict area, meaning that when an agent has already entered the intersection conflict area, the lane changing rule is not executed;

[0154] 3) Do not change lanes while waiting in line at a red light.

[0155] Regarding location update rules:

[0156] Move forward the corresponding number of cells along the current direction of travel to complete the vertical position update for this time step.

[0157]

[0158] For the traffic light response rules, let the coordinates of the stop line be... , The coordinates for the front (head) of the vehicle include:

[0159] 1) Green light phase: During a green light, the longitudinal movement rules are executed normally.

[0160] 2) During a red light phase, first determine whether the vehicle is the first vehicle in the queue before the stop line (i.e., there are no other vehicles in the same lane ahead of it within the stop line).

[0161] If it is the lead vehicle, then the stop line constraint applies:

[0162]

[0163] If it is not the lead vehicle, the following deceleration rule, which is the same as the acceleration rule, will still be applied, and its speed will be constrained by the position of the vehicle in front. There is no need to apply a separate stop line constraint.

[0164] 3) Yellow light phase: Calculate the number of steps required to reach the stop line in the current state. If the vehicle is already stopped, skip the following calculations; otherwise, calculate the number of steps required to reach the stopping line at the current speed:

[0165]

[0166] like Continue through, and execute the longitudinal motion rules normally according to the acceleration rules, deceleration rules, random slowdown rules, and lane change rules.

[0167] It should be noted that the rule for vehicles to pass through a yellow light here is deterministic. This means that as long as the calculated time to reach the stop line does not exceed the remaining duration of the yellow light, they can proceed without introducing any probability of random overtaking. This differs from the probabilistic rule for electric bicycles to respond to a yellow light. The randomization process for deciding whether to cut in front of a vehicle differs. This invention assumes that motor vehicle drivers have a more certain judgment of when to proceed and that individual differences are weaker than those of electric bicycle riders; therefore, it does not randomize the behavior of motor vehicles passing through a yellow light.

[0168] like Execute deceleration and stop; speed updated to:

[0169]

[0170] The behavioral rules system for electric bicycles includes the following pre-defined rules:

[0171] For the longitudinal motion rule (based on the NS model extension), the longitudinal motion rule for the electric bicycle is executed in the following order within each time step:

[0172] 1) Acceleration rules:

[0173]

[0174] Execution conditions: ;

[0175] The forward clearance is defined as:

[0176]

[0177] in For the first The vehicle length (number of cells) of the intelligent agent; if the vehicle in front is a motor vehicle, then... If the vehicle in front is an electric bicycle, then If there are no cars ahead Choose a sufficiently large value (such as the remaining length of the road).

[0178] 2) Deceleration rules:

[0179]

[0180] ensure To prevent collisions.

[0181] 3) Random slowing down rule:

[0182] like ,but ,in, Uniformly distributed random numbers, (Based on actual measurement calibration).

[0183] 4) Location update rules:

[0184] Move forward the corresponding number of cells along the current direction of travel to complete the vertical position update for this time step.

[0185]

[0186] Regarding lane-changing rules, lane-changing behavior of electric bicycles is divided into two categories: ordinary lane-changing (lateral movement within the non-motorized vehicle lane) and using the motorized vehicle lane (crossing lanes to enter the motorized vehicle lane).

[0187] For regular lane changing rules:

[0188] Within the same time step, the following three conditions are evaluated sequentially. If all three conditions are met simultaneously, a probability is applied. Execute lane change:

[0189] 1) Incentive conditions: ;

[0190] 2) Forward safety conditions: ;

[0191] 3) Backward safety conditions: ;

[0192] Indicates the net clearance ahead of the target lane; Indicates the distance between vehicles approaching from behind in the target lane; .

[0193] It should be noted that, similar to the rules for lane changing by motor vehicles, the following incentive conditions... The candidate speed refers to the speed after acceleration and before the car-following constraint. It is used to determine whether a lane-changing motivation has been generated. It is the same sign as the final speed obtained after acceleration and deceleration rules, but the values ​​are different and cannot be used interchangeably.

[0194] Regarding the rules for using motor vehicle lanes:

[0195] When the following triggering conditions are met, with probability Perform a lateral movement into the motor vehicle lane (crossing the boundary of the non-motor vehicle lane to enter the adjacent motor vehicle lane):

[0196]

[0197]

[0198]

[0199] in, A cell (corresponding to 2.5m to 4m, approximately 1 to 2 times the length of an electric bicycle) is a congestion trigger threshold. It can be calibrated based on measured congestion density data of non-motorized vehicle lanes and relevant literature, reflecting the behavioral characteristics of electric bicycles tending to use other lanes when the net distance in front is less than approximately 1 to 2 times the length of the bicycle. Indicates the forward safe distance between adjacent lanes of motor vehicles. Indicates the rearward safety distance between adjacent lanes; Cell (forward safety distance); Cell / step.

[0200] Return to non-motorized vehicle lane conditions (in terms of probability) implement):

[0201]

[0202] in, Cell; .

[0203] For the traffic light response rules, let the coordinates of the stop line be... Specifically, it includes:

[0204] 1) Green light phase: During a green light, the longitudinal movement rules are executed normally.

[0205] 2) For red light phases, first determine if a red light violation has been triggered:

[0206] like Ignore the signal and continue driving according to the green light rule (run a red light), then execute the normal longitudinal movement rules;

[0207] Otherwise, apply the deceleration formula (lead vehicle constraint): ,in, (Based on actual measurement and statistical calibration).

[0208] 3) Yellow light phase: Calculate the number of steps required to reach the stop line in the current state. If the electric bicycle has already stopped, then the deceleration and stopping state will be executed directly, skipping the following calculations. Otherwise, the arrival time will be calculated:

[0209]

[0210] like : based on probability Decide whether to cut in front of others; if so, follow the normal longitudinal movement rules; if not, slow down and stop. .

[0211]

[0212] like Then, deceleration and stopping will be implemented.

[0213] Rules for handling conflicts with motor vehicles:

[0214] This rule applies to intersection conflict areas and situations where electric bicycles and motor vehicles share a motor vehicle lane, and where the electric bicycle's trajectory intersects with the motor vehicle's trajectory or is predicted to occupy the same cell in the next time step. This mandatory speed adjustment must be completed after random slowing down and before position updating.

[0215] Let the collision cell be C, and the net distances from the electric bicycle and the motor vehicle to C be respectively... , The current speeds are respectively , Arrival time estimate:

[0216]

[0217]

[0218] like Motor vehicles have priority, mandatory ;

[0219] like Electric bicycles have priority and can continue to travel normally.

[0220] Rules for handling conflicts with pedestrians:

[0221] Let C be the conflict cell when the candidate trajectories of the electric bicycle and the pedestrian intersect, and let the net distances from the electric bicycle and the pedestrian to C be respectively. , The current speeds are respectively , Perceived distance threshold For cells. It is used to trigger conflict detection and early deceleration, rather than determining the final priority independently.

[0222] When the electric bicycle is in front When there are overlapping or intersecting candidate occupancy cells of pedestrians or electric bicycles within the memory, the arrival time to the conflicting cell is calculated, and its expression is as follows:

[0223]

[0224]

[0225] like If the arrival times are the same and indistinguishable, pedestrians have priority, and electric bicycles must slow down or stop. .

[0226] like If the candidate cell for electric bicycle occupancy does not intrude into the candidate cell for pedestrian occupancy, then the electric bicycle will proceed according to normal rules; if there is no such conflict risk, then it will proceed according to normal movement rules. This mandatory speed adjustment must be completed after random slowing is finished and before the location is updated.

[0227] Regarding the pedestrian movement rule system:

[0228] Pedestrians at crosswalks are subject to traffic lights and cross the intersection laterally during the green light (pedestrian phase). The rules for pedestrian longitudinal movement (along the crossing direction) are as follows:

[0229] 1) Acceleration rules:

[0230]

[0231] Execution conditions: If the conditions are not met, the speed remains at the current value, and the deceleration rule is entered.

[0232] 2) Deceleration rules:

[0233]

[0234] in This represents the net distance (number of cells) between pedestrians traveling in the same direction ahead, designed to prevent collisions and ensure non-negative speeds. For the first The length of the agent (number of cells); if there is a motor vehicle ahead, then... If the vehicle in front is an electric bicycle, then .

[0235] 3) Random slowing down rule:

[0236] like ,but ,in, Uniformly distributed random numbers, (Based on actual measurement calibration).

[0237] 4) Location update rules:

[0238]

[0239] For pedestrian traffic light response rules, let the coordinates of the curb (the boundary of the pedestrian crossing waiting area) be... The coordinates of the parking line are Specifically, it includes:

[0240] 1) Pedestrian green light phase: Acceleration rules, deceleration rules, random slowdown rules, and position update rules are executed normally, allowing entry into the crosswalk;

[0241] 2) Pedestrian red light phase: Forced to stop and wait at the curb;

[0242] 3) Pedestrians already in the crosswalk (i.e., already past the curb): Regardless of the signal phase, continue to proceed according to the movement rules until the crossing is completed, without being forced to stop midway.

[0243] S300: Perform cross-type overlap detection and conflict cell arrival time verification on the candidate occupied cell set. Determine the passage priority based on the estimated arrival time of each agent to the conflict cell. Force the speed adjustment of low-priority agents. After the conflict is resolved, write the next moment state of the three types of agents into the global state.

[0244] In this embodiment, the conflict handling between pedestrians and electric bicycles uses the same arrival time-based yielding logic, rather than a separate distance-based deceleration rule. Specifically, when the pedestrian's safe perceived distance is... When there is an electric bicycle, or when the candidate occupancy cells of a pedestrian and an electric bicycle overlap or their trajectories intersect, determine the conflicting cell C and calculate the arrival time of the pedestrian respectively. Arrival time of electric bicycle .

[0245] like If the arrival times are the same and indistinguishable, the pedestrian has priority according to the tie-breaking rule for pedestrians, and the electric bicycle must slow down or stop; if If the candidate occupancy cell of the electric bicycle does not intrude into the candidate occupancy cell of the pedestrian, then the electric bicycle shall pass first, and the pedestrian shall continue at its candidate speed or appropriately slow down according to the safety distance constraint.

[0246] In this rule, it serves as a conflict risk triggering condition and an early deceleration threshold to detect close interactions between pedestrians and electric bicycles in advance. The final yielding object is determined by comparing the arrival times of the conflict cells. When the arrival times are the same or cannot be distinguished, the pedestrian priority rule applies.

[0247] The conflict resolution rules for pedestrians and motor vehicles are structurally the same as those for electric bicycles and motor vehicles: the right-of-way is determined by the estimated time of arrival at the conflict cell; if the pedestrian arrives earlier than the motor vehicle, or if the two arrive at the same time and cannot be distinguished, the pedestrian has priority and the motor vehicle is forced to slow down or stop; if the motor vehicle arrives earlier than the pedestrian and will not intrude into the pedestrian's candidate occupancy cell, the motor vehicle has priority and the pedestrian continues at its candidate speed or slows down appropriately according to the safety distance constraint.

[0248] It should be noted that the handling of conflicts between pedestrians and electric bicycles, pedestrians and motor vehicles, and the handling of conflicts between electric bicycles and motor vehicles and pedestrians in the electric bicycle behavior rule system, the mandatory adjustment of speed should all be completed after random slowing is completed and before the location update is executed. That is, the final speed of the current time step should be determined first based on the conflict detection results. Then, based on this, a unified location update will be performed. .

[0249] The S400 process iterates through time steps, calculates agent motion, handles conflicts, and updates state until the preset simulation termination conditions are met, outputting traffic flow statistics and simulation visualization results.

[0250] The framework of this embodiment specifically includes:

[0251] 1) Scene initialization module:

[0252] A two-dimensional cellular mesh is generated based on road parameters. Three types of intelligent agents are assigned initial positions, velocities, and directions of travel according to a set flow rate. The duration of traffic light phases (green light duration, red light duration, and yellow light duration) is set.

[0253] 2) Agent generation module:

[0254] At the beginning of each time step, according to the arrival flow rate (Poisson distribution or uniform distribution) set by various agents, a new agent is generated at the road entrance cell and given an initial speed and direction of travel. If the entrance cell is already occupied, no agent is generated in that time step, and the process waits for the next step.

[0255] 3) Status synchronization update module:

[0256] A candidate state synchronous computation and unified writing strategy is adopted, and all agents are based on Global state calculation at time step The candidate velocities, candidate positions, and candidate occupied cell sets at each time step do not change the global cell occupancy state before conflict detection and yield determination are completed, avoiding the order of updates directly affecting the simulation results. During conflict handling, the passage order is determined primarily based on the arrival time of each agent in the conflicting cell; in conflicts involving pedestrians, pedestrians have priority if their arrival times are the same or indistinguishable; in cases of ties or indistinguishability without pedestrians, the pre-defined rules for the corresponding agent pair are followed. The order of motor vehicle → electric bicycle → pedestrian is only used as the execution order for candidate state calculation and state writing verification, and does not change or replace the specific yield determination result. The processed states of the three types of agents are written uniformly at the end of the same time step; multiple agents within the same type are updated in complete parallel, meaning all individuals of the same type are updated simultaneously based on... Calculate the state of each neighbor at each time step. States have no particular order of precedence.

[0257] 4) Conflict Detection and Handling Module:

[0258] Before the state is uniformly written at each time step, it is checked whether there is cross-type overlap of candidate occupied cells of multiple agents, or whether different types of agents will arrive at the same conflict cell in the same time window; for the detected conflict, the rules for handling conflicts with motor vehicles and pedestrians in the electric bicycle behavior rule system and the rules described in the pedestrian movement rule system are executed to determine the arrival time priority, prioritize the handling of ties involving pedestrians, handle the corresponding subject of non-pedestrian conflicts, and force speed adjustment.

[0259] 5) Indicator Statistics Module:

[0260] Record data at each time step and calculate the average delay (the average difference between the passage time of each type of agent and the free-flow travel time), the throughput of each type (the number of agents passing through the parking line per unit time), the space occupancy rate (the number of occupied cells / the total number of cells), and the number of conflict triggers.

[0261] 6) Visualization output module:

[0262] The system displays the occupancy status of each cell in real time using a two-dimensional color grid. Motor vehicles, electric bicycles, and pedestrians are marked with different colors. It also displays the current traffic light phase and simulation time step synchronously and supports the output of statistical indicators in charts after the simulation ends.

[0263] The embodiments of the present invention will be further summarized and described in conjunction with the accompanying drawings, such as... Figure 3As shown, the system's top layer receives three types of inputs (represented by parallelograms): road parameter inputs (including the number of lanes, road width, and intersection geometry), agent parameter inputs (including the maximum speed, size, and random probability parameters of various agents), and signal timing inputs (red, green, and yellow phase durations). These three types of inputs are fed into the scene initialization module to complete cell mesh generation, initial agent placement, and traffic light phase settings.

[0264] After initialization, the system enters the main loop. At the beginning of each time step, the agent generation module first deploys newly generated motor vehicle, electric bicycle, and pedestrian agents at the road entrance according to the set arrival flow rate of each type of agent, assigning them initial position, speed, and direction of travel; this module is executed in every time step, not just during the initialization phase.

[0265] Subsequently, the system enters three behavior rule modules in parallel (represented by rectangles): the motor vehicle movement rule module, the electric bicycle behavior rule module, and the pedestrian movement rule module. Each module calculates the candidate velocity, candidate position, and candidate occupied cell set for its respective agent at time t+1 based on the global cell occupancy state at time t. The candidate results are then uniformly passed to the conflict detection and state synchronization module. This module first checks cell-by-cell for cross-type overlap between candidate occupied cell sets, then enforces speed adjustments according to specific yielding rules, and finally writes the processed positions and velocities of the three agent types into the t+1 state according to the order of candidate state calculation and state writing verification. Finally, the system outputs data at each time step (represented by parallelograms) to the indicator statistics module (calculating delay, throughput, occupancy rate, and conflict count) and the visualization output module (real-time grid display).

[0266] like Figure 2As shown, the simulation starts from the "Start" node, first completing initialization: generating cellular meshes and setting road structure and signal phase; then generating three types of agents: motor vehicles, electric bicycles, and pedestrians, assigning them initial positions, speeds, and directions of travel. After entering the main loop, the time step advances from t to t+1, and the following operations are performed sequentially: updating the traffic light phase (red / yellow / green switching); the three types of agents respectively execute longitudinal motion rules (acceleration → deceleration → random slowing down) and calculate candidate speeds; executing lane-changing rules (normal lane change / borrowing motor vehicle lanes) and forming candidate positions and candidate occupied cell sets; performing cross-type conflict detection to determine whether there are multiple agents intending to occupy the same cell or the same conflicting cell arriving at conflicting times. If a conflict exists, the conflict handling rules are executed (arrival time priority determination, priority handling for ties involving pedestrians, handling of corresponding agents in non-pedestrian conflicts, and forced speed adjustment); uniformly writing the t+1 position state of all agents; and recording statistical indicators (delay, throughput, number of conflicts, occupancy rate). Then, it checks whether the simulation termination condition (preset total time steps) has been met. If not, it returns to the main loop; if it has, it outputs the simulation results, statistical indicators, and visualization content, and the simulation ends.

[0267] Finally, it should be noted that while the embodiments of this invention provide separate movement rules for motor vehicles, electric bicycles, and pedestrians, these three types of rules are not simply superimposed after independent operation. Instead, they are uniformly designed at three levels: cell granularity selection, state writing verification order, and conflict yielding judgment logic. This design specifically adapts to scenarios involving mixed traffic of motor vehicles and non-motorized vehicles, and mixed traffic of pedestrians and vehicles. The overall logic of this collaborative design will now be explained in detail to facilitate understanding of the inherent connections between the various rules.

[0268] Firstly, the synergistic effect of unified cell granularity. This invention uses 0.5m × 0.5m as the basic cell. Its function is not limited to representing the physical size of a single type of intelligent agent, but more importantly, it enables motor vehicles, electric bicycles, and pedestrians to have directly comparable spatial positions within the same cell coordinate system. This supports the accurate determination of cell mutual exclusion constraints in cross-type scenarios, as well as the cell-by-cell verification by the conflict detection module to determine whether cells occupied by different types of intelligent agents overlap. If each type uses its own existing cell granularity (such as the traditional NS model using the entire vehicle length as the unit cell), it is impossible to accurately determine the spatial overlap between heterogeneous intelligent agents under a unified coordinate system, and cross-type conflict detection will lose its basis.

[0269] Secondly, the collaborative design of state synchronization and write verification order. The order of motor vehicle → electric bicycle → pedestrian does not represent that the three types of entities independently complete their position updates, nor is it an absolute right-of-way or yielding tie rule in the sense of traffic regulations. Rather, it is the execution order used for candidate state calculation and state write verification: motor vehicles are large and have long braking distances, so once their state is determined, the room for adjustment is relatively limited; electric bicycles are small and highly maneuverable, and can adjust their speed and lane-changing decisions after sensing the candidate occupancy intention of motor vehicles; pedestrians have the lowest speed and the most flexible turning, and can undergo safety verification after the candidate states of the first two types of intelligent entities are determined. This execution order and the candidate state synchronization calculation mechanism together form a deterministic calculation chain, avoiding the simultaneous writing and occupancy of the same cell by multiple intelligent entities in the same time step; the specific yielding result is still determined by the arrival time and the entity's compliance with the rules.

[0270] Thirdly, a unified logic for yielding in cross-type conflicts. The conflict handling rules for electric bicycles and motor vehicles, electric bicycles and pedestrians, and pedestrians and motor vehicles are all based on the detection of overlapping candidate occupancy cells or trajectory intersections. They employ a comparison of arrival times of conflicting cells (e.g., comparing the arrival time teb of an electric bicycle with the arrival time tcar of a motor vehicle) and a forced speed adjustment method. Essentially, this is the application of the same yielding mechanism under different combinations of subjects, rather than isolated rules designed separately for each combination. Specifically, in conflicts involving pedestrians, if the arrival times are the same or indistinguishable, pedestrians are given priority; in cases of a tie or indistinguishability without pedestrians, the pre-defined rules for the corresponding subject pair are followed. (Electric bicycle-pedestrian rule...) Used for triggering near-distance risks and early deceleration, the final priority is still determined by comparison of arrival times and the rules of the aforementioned subjects. This mechanism is also connected with the safety distance conditions in the rules for using motor vehicle lanes, so that the act of electric bicycles using lanes inherently incorporates the perception and avoidance of the state of motor vehicles, reflecting the design features of two-way perception and two-way avoidance, rather than a simple avoidance of motor vehicle flow by electric bicycles.

[0271] In summary, this invention does not simply combine existing motor vehicle NS models, electric bicycle CA models, and multi-cell modeling methods. Instead, it specifically addresses the mixed traffic scenario of motor vehicles, electric bicycles, and pedestrians by implementing interactive adaptation designs at five levels: cell granularity, synchronous calculation of candidate states, conflict detection, arrival time arbitration, and unified state writing. This allows the motion rules of the three types of participants to mutually constrain and co-evolve within the same simulation step, thereby solving the cell occupancy conflicts and motion rule mismatches that easily occur after separate modeling and simple combination in existing technologies. This collaborative mechanism is the core technical contribution of this invention, distinguishing it from the simple combination of existing technologies.

[0272] Furthermore, to ensure the aforementioned collaborative mechanism has reproducible execution boundaries, within each time step t, the system implements state transitions for the three types of agents according to the following steps: First, it reads the global cell occupancy state, signal phase, and current speed and position of the three types of agents at time t; second, the motor vehicle, electric bicycle, and pedestrian behavior rule modules calculate candidate speeds, candidate positions, and candidate occupancy cell sets based on the same state at time t; third, it performs cell-by-cell intersection calculations on the candidate occupancy cell sets of different types of agents to determine candidate overlapping cells or conflict cells formed by trajectory intersections; then, it calculates the arrival time of each conflicting agent at the conflict cell, and determines the passing agent according to the arrival time priority principle. In conflicts involving pedestrians, pedestrians are given priority when their arrival times are the same or indistinguishable. In cases of ties or indistinguishability where pedestrians are not involved, the corresponding agent pair's preset rules are applied; subsequently, the speed of the yielding agent is forcibly adjusted, and its candidate occupancy cell set is re-verified; finally, according to the order of candidate state calculation and state writing verification, the speed, position, and cell occupancy state at time t+1 are uniformly written after all conflicts are resolved.

[0273] Through the above steps, the motion rules of the three types of subjects all take the same global cell state as input and are subject to the same conflict yielding determination mechanism before unified writing. Therefore, the candidate motion of any type of subject will affect the final speed and occupancy result of other types of subjects, forming a closed loop of cross-type bidirectional perception and bidirectional avoidance.

[0274] In summary, the embodiments of the present invention differ from the prior art in the following technical features:

[0275] 1) Using the multi-cell method, differentiated physical space modeling of three types of traffic participants—motor vehicles, electric bicycles, and pedestrians—is carried out at a uniform cell granularity (0.5m×0.5m), realizing the coexistence of heterogeneous traffic subjects in the same CA simulation space;

[0276] 2) A complete behavioral rule system for the electric bicycle intelligent agent, including: longitudinal motion rules based on the NS model extension (including random slowdown probability). The rules for lane changes are divided into two categories: regular lane changes and lane-using rules (including triggering conditions and execution probabilities), and include the probability of running a red light. and the probability of overtaking Traffic light response rules (covering red, green, and yellow phases), and conflict handling rules for motor vehicles and pedestrians respectively (including priority determination and speed mandatory adjustment formulas).

[0277] 3) Taking a traffic light intersection as the scenario, a hybrid traffic CA simulation system framework is established, which integrates the definitions, behavioral rules and interaction mechanisms of three types of intelligent agents. It includes functional modules such as initialization, state synchronization update, conflict detection and handling, indicator statistics and visualization output.

[0278] 4) The motion rule system for pedestrian intelligent agents, including longitudinal motion rules based on the NS model extension (including random slowing probability). The rules include traffic light response rules (crossing at green lights / waiting at red lights / no mandatory stopping in crosswalks), and rules for handling conflicts with electric bicycles and motor vehicles; together with the rules for motor vehicles and electric bicycles, these constitute a complete technical closed loop of a unified simulation framework for the three types of participants.

[0279] 5) A unified candidate state synchronization calculation and conflict yielding determination mechanism among three types of heterogeneous intelligent agents: including a cross-type cell overlap determination basis at a unified cell granularity, synchronous calculation of three types of candidate speed / candidate position / candidate occupied cell sets based on the global state at the same time t, cell-by-cell intersection of candidate occupied cell sets, comparison of arrival conflict cell times, determination of the yielding object according to the specific agent pair rules when arrival times are the same or indistinguishable (pedestrians are given priority when pedestrians are involved, and the corresponding preset rules are applied when pedestrians are not involved), forced speed adjustment of the yielding agent, and unified writing of the t+1 state; among them, the order of motor vehicle → electric bicycle → pedestrian is only the order of candidate state calculation and state writing verification, and does not replace the above yielding determination rules, and the electric bicycle-pedestrian conflict rules are not replaced by the above rules. This mechanism serves as a threshold for conflict detection and early deceleration. It is integrated with the safety distance conditions for electric bicycles using motor vehicle lanes, forming a collaborative design of two-way perception and two-way avoidance. Rather than a simple superposition of various existing technologies, this is the core technical feature that distinguishes this invention from existing single-type CA / NS models and pairwise combination schemes.

[0280] Therefore, the embodiments of the present invention have the following advantages compared with the prior art:

[0281] 1) It fills the gap in CA simulation of electric bicycle independent intelligent agents in mixed traffic.

[0282] This invention incorporates electric bicycles as independent intelligent agents into a CA simulation framework involving mixed traffic of motor vehicles, non-motor vehicles, and pedestrians, giving them independent physical parameters and behavioral rules. This allows for accurate characterization of the actual operation of electric bicycles in urban traffic, significantly improving the realism of the simulation compared to existing pairwise combined models.

[0283] 2) The behavioral rules system is complete, covering violations and lane-changing behaviors unique to electric bicycles.

[0284] This invention, based on the NS model, specifically designs a system that includes the probability of running a red light. Probability of using the motor vehicle lane It also provides a complete rule system for handling conflicts with motor vehicles and pedestrians, and gives mathematical expressions for each rule. It is highly reproducible and overcomes the shortcomings of existing models that lack modeling of such behaviors.

[0285] 3) The unified multi-cell framework has good scalability.

[0286] This invention presents a multi-cell modeling method based on electric bicycles, which adapts to three types of participants with significant size differences with a uniform granularity. The simulation scenario can be expanded from traffic light intersections to more complex scenarios such as road segments and networks, and other types of traffic participants can be easily included, demonstrating good scalability.

[0287] 4) A unified coordination and state synchronization mechanism was constructed among the three types of heterogeneous intelligent agents, rather than a simple patchwork of existing models.

[0288] This invention does not directly combine the existing motor vehicle NS model with the electric bicycle CA model. Instead, it specifically designs a mechanism for cross-type overlap determination, candidate state synchronous calculation, arrival time priority determination, subject-to-draw handling, and unified state writing for the mixed traffic scenario of motor vehicles, electric bicycles, and pedestrians at a unified cell granularity. This enables the motion rules of the three types of participants to mutually constrain and co-evolve within the same simulation step, solving the cell occupancy conflict, penetration, deadlock, and motion rule mismatch problems that easily occur when simply combining existing technologies. Compared with existing technologies that only combine two types, this invention has stronger overall consistency and reliability.

[0289] Because the conflict yielding decision is completed before the unified state is written, this invention can maintain cross-type cell mutual exclusion constraints in each time step, reducing non-physical simulation states such as multiple agents simultaneously occupying the same cell, intersecting trajectories penetrating each other, or deadlocks caused by mutual non-yielding. This improves the reproducibility of mixed traffic simulation and its ability to represent real-world mixed traffic scenarios involving machines and non-humans. The above effects stem from the combination of unified cell granularity, synchronous calculation of candidate states, and cross-type yielding decision mechanisms, rather than any single motion rule being able to achieve this independently.

[0290] Reference Figure 2 A hybrid traffic simulation system considering electric bicycles includes:

[0291] The first module 201 is used to construct a unified multi-cell space model of the intersection. It inputs road parameters, agent parameters and signal timing parameters, completes the simulation scene initialization, generates a two-dimensional cell mesh, deploys the initial agents and sets the traffic light phase and duration.

[0292] The second module 202 is used to advance the simulation process according to the traffic light phase and duration. At the beginning of each time step, new motor vehicle, electric bicycle and pedestrian intelligent agents are generated according to the set arrival flow rate of each type of intelligent agent. Based on the global cell occupancy state at the current moment, the candidate speed, candidate position and corresponding candidate occupancy cell set of the three types of intelligent agents at the next moment are calculated in parallel.

[0293] The third module 203 is used to perform cross-type overlap detection and conflict cell arrival time verification on the candidate occupied cell set. It determines the passage priority based on the estimated arrival time of each agent to the conflict cell, forces the speed adjustment of low-priority agents, and writes the next moment state of the three types of agents into the global state after the conflict is resolved.

[0294] The fourth module 204 is used to cyclically execute the time step progression, agent motion calculation, conflict handling and state update process until the preset simulation termination condition is reached, and output traffic flow statistics and simulation visualization results.

[0295] The content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0296] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this is not intended to limit the scope of the embodiments of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the embodiments of the present application.

Claims

1. A hybrid traffic simulation method considering electric bicycles, characterized in that, Includes the following steps: Construct a unified multi-cell space model of the intersection, input road parameters, agent parameters and signal timing parameters, complete the simulation scene initialization, generate a two-dimensional cellular mesh, deploy the initial agents and set the traffic light phase and duration; The simulation process is advanced according to the phase and duration of the traffic lights. At the beginning of each time step, new motor vehicle, electric bicycle and pedestrian intelligent agents are generated according to the arrival flow rate set by each type of intelligent agent. Based on the global cell occupancy state at the current moment, the candidate speed, candidate position and corresponding candidate occupancy cell set of the three types of intelligent agents at the next moment are calculated in parallel. Cross-type overlap detection and conflict cell arrival time verification are performed on the candidate occupied cell set. The passage priority is determined based on the estimated arrival time of each agent to the conflict cell. The execution speed of low-priority agents is forcibly adjusted. After the conflict is resolved, the next moment state of the three types of agents is uniformly written into the global state. The process of time step progression, agent motion calculation, conflict handling and state update is executed in a loop until the preset simulation termination condition is reached, and traffic flow statistics and simulation visualization results are output.

2. The hybrid traffic simulation method considering electric bicycles according to claim 1, characterized in that, The step of constructing a unified multi-cell space model of the intersection, inputting road parameters, agent parameters, and signal timing parameters, completing the simulation scene initialization, generating a two-dimensional cellular mesh, deploying initial agents, and setting the traffic light phase and duration specifically includes: Using a preset unit length as the basic cell side length, the intersection road space is divided into a two-dimensional cell grid indexed by row and column coordinates; Based on a two-dimensional cellular grid, according to the number of cells corresponding to the physical size of the agent, electric bicycles occupy 4×1 cells, motor vehicles occupy 10×4 cells, and pedestrians occupy 1×1 cells respectively, and the cell sets occupied by any two agents are constrained to satisfy a mutual exclusion relationship. The simulated speed of the intelligent agent is converted into the corresponding actual physical speed according to the cell side length and time step. Based on the input road parameters and signal timing parameters, and combined with the mutual exclusion relationship of the occupied cell set, the simulation scene initialization and the setting of traffic light phase and duration are completed.

3. The hybrid traffic simulation method considering electric bicycles according to claim 2, characterized in that, The process of calculating the candidate velocity, candidate position, and corresponding candidate occupied cell set of the three types of intelligent agents at the next moment also includes executing a preset longitudinal motion rule for the electric bicycle. The preset longitudinal motion rule is as follows: Calculate the forward net distance based on the position of the front agent. If the forward net distance is greater than the current speed, take the minimum value of the current speed plus the acceleration increment and the maximum speed to obtain the candidate speed after acceleration. Based on the forward clearance, a deceleration constraint is applied to the accelerated candidate speed, constraining the candidate speed to the forward clearance minus one value and ensuring that the speed is non-negative, thus avoiding rear-end collisions. By performing a random slowing operation on the candidate speeds after deceleration using a preset slowing probability, the speed value is reduced by one while ensuring that the speed is non-negative, and finally the candidate speeds and candidate positions of the electric bicycle are obtained, generating the corresponding candidate occupied cell set.

4. The hybrid traffic simulation method considering electric bicycles according to claim 3, characterized in that, The process of calculating the candidate velocity, candidate position, and corresponding candidate occupied cell set of the three types of intelligent agents at the next moment also includes executing a preset lateral lane-changing rule for the electric bicycle. The preset lateral lane-changing rule is as follows: When the forward clearance of the current lane is less than the candidate speed after acceleration, a lane change incentive is triggered. After verifying that the forward clearance of the target lane meets the requirements for passing the candidate speed and the backward clearance is not less than the maximum speed of the electric bicycle, a normal lane change in the non-motorized vehicle lane is performed according to the preset lane change probability. When the net distance in front of the non-motorized vehicle lane is lower than the congestion trigger threshold, after verifying that the forward and backward safety distances of the adjacent motorized vehicle lanes meet the requirements, the operation of borrowing the motorized vehicle lane is performed according to the preset borrowing probability. When an electric bicycle is in the motor vehicle lane, it will return to the non-motor vehicle lane according to the preset return probability when the forward clearance of the corresponding position in the non-motor vehicle lane meets the return condition.

5. The hybrid traffic simulation method considering electric bicycles according to claim 4, characterized in that, The process of calculating the candidate velocity, candidate position, and corresponding candidate occupied cell set of the three types of intelligent agents at the next moment also includes executing a preset traffic light response rule for electric bicycles. The preset traffic light response rule is as follows: During the green light phase, electric bicycles normally follow the rules for longitudinal movement and lane changing; During a red light phase, the system determines whether to ignore the red light signal and continue to proceed based on a preset probability of running a red light. If the first vehicle is not determined to have run a red light, it will be constrained by the stop line and will slow down and stop. Other vehicles will slow down according to the following rules. During the yellow light phase, calculate the time required to reach the stop line at the current speed. If the required time is less than or equal to the remaining time of the yellow light, determine whether to continue passing based on the preset overtaking probability; otherwise, decelerate and stop.

6. The hybrid traffic simulation method considering electric bicycles according to claim 5, characterized in that, In the process of calculating the candidate velocity, candidate position, and corresponding candidate occupied cell set of the three types of intelligent agents in the next moment, the following rules are executed for motor vehicles: The longitudinal candidate speed is calculated by sequentially performing acceleration, deceleration, and random slowing steps. Lane changing behavior is only performed between similar motor vehicle lanes, and entry into non-motor vehicle lanes and intersection conflict areas is prohibited. During the green light phase, longitudinal movement and lane changing rules are executed normally. During the red light phase, the lead vehicle is constrained by the stop line and slows down to stop, while other vehicles slow down according to the following rules. During the yellow light phase, a deterministic passage decision is adopted. The time required to reach the stop line at the current speed is calculated. If the required time is not greater than the remaining time of the yellow light, the vehicle can proceed normally; otherwise, it will decelerate and stop.

7. The hybrid traffic simulation method considering electric bicycles according to claim 6, characterized in that, In the process of calculating the candidate velocity, candidate position, and corresponding candidate occupied cell set of the three types of intelligent agents in the next moment, the following rules are executed for pedestrians: Along the direction of pedestrian crossing, perform acceleration, deceleration, and random slowing steps in sequence to calculate the longitudinal candidate velocity and candidate position of the pedestrian. During the pedestrian red light phase, pedestrians who have not yet entered the crosswalk are forced to stop and wait at the curb, while pedestrians who have already entered the crosswalk are not bound by the signal switch and continue to cross until they have completed the crossing.

8. The hybrid traffic simulation method considering electric bicycles according to claim 7, characterized in that, The step of determining the passage priority based on the estimated arrival time of each agent at the conflict cell and forcibly adjusting the speed of low-priority agents specifically includes: Calculate the estimated arrival time of both sides in the conflict at the conflict cell. The side that arrives earlier has priority to pass, while the side that arrives later is forced to slow down or stop. In the event of a conflict involving pedestrians, if both parties arrive at the same time or their priorities cannot be distinguished, the pedestrian shall be given priority. In the event of a conflict between a motor vehicle and an electric bicycle, if both arrive at the same time or their priorities cannot be distinguished, the motor vehicle shall be given priority, and the speed of the electric bicycle shall be subject to mandatory adjustment.

9. The hybrid traffic simulation method considering electric bicycles according to claim 8, characterized in that, The step of writing the next state of the three types of agents into the global state after the conflict resolution is completed specifically includes: The candidate states of all agents are calculated and generated based on the global state at the same moment, and the global cell occupancy state is not modified before the conflict is resolved. The final position, velocity, and occupied cell state of the three types of intelligent agents are synchronously written into the global state at the end of the same time step. All agents within the same type are updated in full parallel, and the order of individual updates does not affect the global state result; The unified writing process adopts the candidate state calculation and state writing verification order for motor vehicles, electric bicycles, and pedestrians. This order is only used for calculation execution and writing verification and does not change the aforementioned yield determination result.

10. A hybrid traffic simulation system considering electric bicycles, characterized in that, Includes the following modules: The first module is used to construct a unified multi-cell space model of the intersection. It inputs road parameters, agent parameters and signal timing parameters, completes the simulation scene initialization, generates a two-dimensional cell mesh, deploys the initial agents and sets the traffic light phase and duration. The second module is used to advance the simulation process according to the traffic light phase and duration. At the beginning of each time step, new motor vehicle, electric bicycle and pedestrian intelligent agents are generated according to the set arrival flow rate of each type of intelligent agent. Based on the global cell occupancy state at the current moment, the candidate speed, candidate position and corresponding candidate occupancy cell set of the three types of intelligent agents are calculated in parallel at the next moment. The third module is used to perform cross-type overlap detection and conflict cell arrival time verification on the candidate occupied cell set. It determines the passage priority based on the estimated arrival time of each agent to the conflict cell, forces the speed adjustment of low-priority agents, and writes the next moment state of the three types of agents into the global state after the conflict is resolved. The fourth module is used to repeatedly execute the time step progression, agent motion calculation, conflict handling and state update process until the preset simulation termination condition is reached, and output traffic flow statistics and simulation visualization results.