Building pedestrian simulation statistics and analysis method

By constructing a three-dimensional building model and optimization algorithm, combining Markov decision-making process and KD tree management obstacles, the existing pedestrian simulation system is solved inadequate statistical analysis and data visualization, and in-depth assessment of pedestrian behavior and improvement of evacuation efficiency are achieved, and scientific basis is provided for building safety design and emergency plans.

CN120336888AActive Publication Date: 2025-07-18SOUTHWEAT UNIV OF SCI & TECH

Patent Information

Application Number
CN202510789078.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-07-18
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

The existing pedestrian simulation system is insufficient in statistical analysis, data visualization and emergency situation distinction, cannot effectively evaluate pedestrian mobility efficiency and bottleneck areas, cannot display key information in real time, and lacks in-depth analysis and logical correlation of pedestrian behavior.

Method used

Through normal pedestrian cycle simulation and emergency evacuation simulation, combined with statistical analysis, data visualization and optimization algorithms, a three-dimensional built environment model is constructed, the Markov decision-making process and reward function are used to guide the Agent behavior, and the obstacles are managed in combination with KD trees and DWA algorithms, heat maps and trajectory playback are generated, high-frequency congested areas are identified and optimization solutions are proposed.

Benefits of technology

A comprehensive assessment and optimization of pedestrian behavior has been achieved, evacuation efficiency has been improved, congestion has been reduced, and scientific basis has been provided for building safety design and emergency plans. The simulation results are closer to the real situation and can identify and alleviate potential bottleneck areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336888A_ABST
    Figure CN120336888A_ABST
Patent Text Reader

Abstract

The invention discloses a building pedestrian simulation statistics and analysis method, and belongs to the technical field of simulation. According to the invention, a comprehensive pedestrian behavior evaluation and optimization scheme is provided through normal pedestrian circulation simulation and emergency evacuation simulation in combination with statistical analysis, data visualization and an optimization algorithm. The system manages pedestrian density through a KD tree, performs real-time data visualization by using ScottPlot, generates one-dimensional, two-dimensional and three-dimensional charts, and visually displays pedestrian distribution and flow conditions in a building. In an emergency evacuation scene, the system dynamically plans a path through a # imgabs0 # algorithm, and identifies and relieves a potential bottleneck area in combination with a heuristic function of congestion measurement. The simulation system can collect abundant statistical data including evacuation time, people flow distribution, congestion point analysis and the like, and provides a scientific basis for building safety design improvement and emergency plan making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of simulation technology, and in particular to a building pedestrian simulation statistics and analysis method. Background Art

[0002] Pedestrian simulation is mainly used in two fields: pedestrian evacuation in space and layout and evaluation of facilities in space. In the process of pedestrian evacuation simulation, pedestrians are generally assumed to be an activity, that is, moving from their current location to the destination. The initial position of pedestrians is randomly generated according to the basic conditions in the space. During the movement, pedestrians either move forward or are blocked. In the process of spatial facility simulation, pedestrians are assumed to have multiple activities, that is, they leave the simulation space after completing all activities. Pedestrians are not generated at one time, but gradually enter the simulation space from the gathering point as the simulation clock changes. The purpose and basic assumptions of pedestrian simulation vary depending on the application field. In pedestrian evacuation simulation, pedestrians are assumed to exist at the beginning of the simulation, have static path planning, cannot self-adjust time and travel speed, and are considered to be the same individual, rational, and the propagation of crowding force is not considered. In spatial facility pedestrian simulation, the pedestrian activity sequence is often set, resulting in pedestrians having static path planning, certain facility selection preferences, and being considered rational. The propagation of crowding forces is also not considered.

[0003] The existing pedestrian simulation system still has the following shortcomings: 1) Insufficient statistical analysis: The existing system lacks in-depth statistical analysis of pedestrian behavior during pedestrian simulation and cannot effectively evaluate the efficiency and bottleneck areas of pedestrian flow.

[0004] 2) Insufficient data visualization: The existing system is relatively weak in data visualization and cannot display key information such as pedestrian density and flow paths in real time, making it difficult for decision makers to intuitively understand the simulation results.

[0005] 3) Insufficient distinction between normal and emergency situations: The existing system lacks clear distinction and logical association in the simulation process of normal pedestrian circulation and emergency evacuation, resulting in the simulation results being unable to fully reflect the actual use of the building. Summary of the invention

[0006] The purpose of the present invention is to provide a building pedestrian simulation statistics and analysis method, which provides a comprehensive pedestrian behavior evaluation and optimization solution through normal pedestrian cycle simulation and emergency evacuation simulation, combined with statistical analysis, data visualization and optimization algorithm.

[0007] To achieve the above object, the present invention provides a building pedestrian simulation statistics and analysis method, comprising the following steps: S1. System requirements analysis: clarify the simulation objectives, evaluate the safety evacuation ability of the building and optimize the daily pedestrian flow line. Use BIM software or CAD software for modeling and collect specific information about the building; S2. Establishment of the environment and agent model: construct an accurate three-dimensional building environment model, including static and dynamic elements, and define the state space, action space, and reward function of the Agent; S3. Normal pedestrian circulation simulation: The Agent selects a path based on the Markov decision process, collects data in real time, evaluates the rationality of the facility layout in combination with the path deviation rate, and performs real-time visualization display of one-dimensional, two-dimensional, and three-dimensional charts through ScottPlot; S4. Emergency evacuation simulation: When an emergency event is triggered, the Agent's goal switches to escape, activates the collaborative rescue rules, pre-computes the shortest path to the safe exit based on the algorithm, avoids obstacles in real time in combination with DWA, manages the obstacle update path set through the KD tree, guides the Agent's behavior using the reward function, uses 3D trajectory playback to mark congestion points and rescue events, and generates charts to quantitatively evaluate the utilization rate of exits and collaborative efficiency; S5. Multi-mode comparison and optimization: Compare normal and emergency data, use Matplotlib and Tableau of Python to generate heat maps and time series charts, analyze in combination with the DBSCAN clustering algorithm, identify building design defects and high-frequency congestion areas, and propose targeted layout optimization plans; S6. Iterative verification: According to the analysis and feedback of the simulation results, adjust the agent behavior parameters or the environment model, and re-perform the simulation; set the key index threshold, and continuously iterate until the ideal evacuation efficiency and pedestrian circulation effect are met.

[0008] Preferably, in step S1, the specific information of the building includes the floor plan layout, the location of entrances and exits, the width of stairs, and fire-fighting facilities; Use these data to calculate the accessibility index of each area of the building , and the formula is: ; where is the shortest path distance from area i to other area j, and n is the number of areas connected to area i; the accessibility index is used to measure the convenience of personnel flow between different areas in the building, The larger the value, the closer the connection between this area and other areas, and the more convenient the personnel flow.

[0009] Preferably, in step S2, the Agent attributes and state space are defined. The Agent attributes include speed, perception radius, and behavioral goal. Different types of pedestrians are represented as adults, children, and the elderly. The pedestrian distribution characteristics include speed, reaction time, and perception range. At the same time, the state space, action space, and reward function of the Agent motion model are defined. Among them, the state space of the Agent motion model defines the position state, speed state, and behavioral state in the simulation environment. Position state is represented by three-dimensional coordinates to indicate the specific position of the Agent in the three-dimensional space of the building, and its change over time reflects the movement trajectory of the Agent. Speed state is described by a velocity vector, representing the magnitude and direction of the Agent's moving speed in each direction. Behavioral state It is set that the Agent has three basic behavioral states including walking, waiting, and running, and a state variable S is used to represent the behavioral state of the Agent. ; The behavioral operations adopted by the action space of the Agent motion model include movement behavior and turning behavior, as follows: Moving forward with a step size of , and calculating the new position according to the speed state and time interval , which is expressed as: ; Among them, is the old position of the Agent, is the new position after taking the movement action; The total reward function of the Agent: ; Position-related reward R location : It is used to reflect the proximity of the Agent to the target position or the safety exit; the reward for approaching the target uses the reciprocal of the distance as the reward. Assuming the target position of the Agent is , and its current position is , the expression for the reward for approaching the target is ; Among them θ is a very small constant to avoid the denominator being zero; by adding θ , it is ensured that the denominator is always greater than 0, making the reward function mathematically valid. When the Agent approaches the target, the distance decreases and the reward value increases; when it reaches the target, the reward value approaches , at this time, trigger "Reaching the safety exit reward ".

[0010] When the Agent successfully reaches the safety exit, give a relatively large positive reward R exit, at this time it is the reward for reaching the safety exit; Path length reward R path : used to measure the efficiency of the Agent's movement path; When the Agent completes a movement, calculate the actual path length it has traveled L actual and the theoretical shortest path length L optimal The ratio of, and its path length reward is defined as , where is a ratio coefficient, α = L optimal / L actual ; If the Agent's path is close to the theoretical shortest path, α close to 1, R path is relatively small; if the Agent takes a lot of detours, α is larger, R path will be smaller or negative; Cooperation reward R cooperate : reflects the cooperation behavior among agents; Let the number of other Agents helped by the Agent be , then the expression of the cooperation reward is , where is a coefficient; The more, the higher the cooperation reward, encouraging agents to assist each other; is the weight of the reward function.

[0011] Preferably, in step S3, it specifically includes the following steps: S31. Behavior rule management: The Agent selects a path based on the Markov decision process; in the normal simulation, the Agent dynamically selects a path according to the preset goal and optimizes its behavior through the Markov decision process; Assume that the Agent is in the state s and takes an action and then transfers to the state s' with a probability of , and the immediate reward , the long-term cumulative reward of the Agent is ; Among them, is the discount factor, and its value range is (0, 1), which is used to measure the importance of future rewards. The Agent selects the optimal action strategy by maximizing the long-term cumulative reward; is the state at time t + k (the position, speed, behavior state, etc. of the Agent in the building); is the action taken at time t + k (moving, turning, etc.); is the state at time t + k + 1 (the new state after executing the action ); The long-term cumulative reward is the discounted sum of all future rewards of the Agent starting from time t. The discount factor is used to measure the importance of future rewards. The closer it is to 0, the more the Agent focuses on immediate rewards, and the closer it is to 1, the more it focuses on long-term rewards.

[0012] S32. Real-time data collection: Record the regional flow, residence duration, and path deviation rate , and the system calculates the pedestrian flow and average residence duration in each region in real time, and combines the path deviation rate to evaluate the rationality of the facility layout; Calculate the r pedestrian flow in the region t 1 , t 2 The formula is: F r The formula is: ; Among them, N r is the number of Agents entering the region t 1 , t 2 within the time period; r ; Calculate the average residence duration r of the Agent in the region T r The formula is: ; Among them, is the th Agent's residence time in the region r ; S33. Visual analysis: Display the crowd density through a heat map and generate a facility utilization rate report; Perform real-time visualization of the obtained one-dimensional, two-dimensional, and three-dimensional charts through ScottPlot. Determine the content of the one-dimensional data based on the queried information, and record the number of Agents passing through each observation point within a certain period of time. In the two-dimensional chart, divide the floor plan of a certain building floor into small squares, calculate the density of Agents in each square, and generate a heat map to display the crowd density. In the three-dimensional chart, divide the building into multiple three-dimensional small cube units and calculate the density of Agents in each unit; At the same time, generate a real-time heat map through ScottPlot to reflect the regional density, and calculate the average pedestrian speed, path deviation index and facility utilization rate; For high-frequency stay areas, mark them as potential congestion points for reference in building layout optimization, and calculate the pedestrian density within the two-dimensional grid , and its expression is ; Among them, is the number of Agents within the grid , is the area of the grid ; Calculate the pedestrian density within the three-dimensional unit , and its expression is ; Among them, is the number of Agents within the unit , is the volume of the unit .

[0013] Preferably, in step S3, the calculation formula for the path deviation rate is , and mark the area with a deviation rate > 1.5 as the optimization focus in combination with the heat map.

[0014] Preferably, in step S4, it specifically includes the following steps: S41. Event trigger mechanism: Switch the Agent target to escape and activate the collaborative rescue rule. When an emergency event is triggered, the system switches the Agent target from the normal activity mode to escape through the event response module and activates the collaborative rescue reward mechanism; S42. Dynamic path planning: Pre-calculate the feasible shortest path based on the A algorithm and avoid obstacles in real time in combination with DWA; specifically as follows: Based on AThe algorithm pre-computes the feasible shortest paths from each Agent to the safe exits and dynamically updates the path lengths. , the Agent selects the exit with the smallest value as the target, queries the positions of obstacles through a real-time KD tree, and uses the Dynamic Window Approach (DWA) for local obstacle avoidance to ensure the feasibility of the path. Manages the positions of obstacles based on the KD tree and updates the set of feasible paths in real time; uses a reward function to guide the behavior of the Agent, and its expression is as follows: ; Among them, is the total reward value; R location is the position-related reward, R path is the path length reward, R speed is the speed-related reward, which is used to penalize the reduction in speed caused by obstacle avoidance or detouring; In the A* algorithm, construct a KD tree and insert data points, use the KD tree to process various object information in the environment, and insert the position coordinates of the rescue Agent, the Agent to be rescued, other normally walking Agents, and static obstacles as data points into the KD tree. Initialize the relevant parameters of the A* algorithm, define a node class to represent the nodes in path planning, and each node contains position coordinates ( ), the father node, initialize g the g value to 0, where the value represents the actual cost from the position of the rescue Agent to the current node, and the h value represents the heuristic estimated cost from the current node to the position of the Agent to be rescued. According to the current node coordinates ( ) and the coordinates of the Agent to be rescued ( ), calculate using the Euclidean distance formula, and the specific expression is: The value is , which is used to evaluate the priority of the node. The smaller the value, the higher the priority of the node; and create an open list and a closed list. The open list is used to store the nodes to be expanded. Initially, add the node corresponding to the position of the rescue Agent to the open list and set its value. The closed list is used to store the nodes that have been expanded and is initially empty. In DWA, the Agent selects the smallest exit and adjusts the real-time movement direction through DWA. The formula is: ; Among them, is the speed adjustment amount, which is used to control the amplitude of the Agent's deceleration or direction change; is the obstacle distance, is the deceleration coefficient (determining the intensity of speed change during obstacle avoidance, usually negative, indicating deceleration); is the safety distance threshold, representing the minimum safe distance between the Agent and obstacles or other pedestrians; During the movement of the rescue Agent, it continuously queries the surrounding neighbor information within the sensing radius through the KD tree. Its sensing radius is , and it judges whether there are obstacles or other pedestrians approaching. If the detected distance from other objects is less than the safety distance threshold , it adjusts the speed or changes the walking direction according to this formula to avoid collisions; S43. Data evaluation: Statistically calculate the evacuation time and the overlapping rate of bottleneck areas, and mark the congestion points in the 3D trajectory playback. Run the evacuation simulation to collect data on the evacuation time, congestion level, and effectiveness of the escape path. Adopt the 3D trajectory playback technology to mark the bottleneck areas and rescue events, and synchronously generate the evacuation time distribution histogram and the path overlapping rate matrix to quantitatively evaluate the exit utilization rate and the cooperation efficiency; Calculate the evacuation time which is the time difference from the triggering of the emergency event to all Agents reaching the safe exit. Calculate the overlapping rate of bottleneck areas O The formula is ; Among them, m is the number of all possible bottleneck areas, is the number of times of personnel congestion overlap within the bottleneck area i , is the total number of times the Agent passes through the bottleneck area i .

[0015] Preferably, In the main loop of the algorithm, after entering the loop, as long as the open list is not empty, perform the following operations: Take out the current node: Take out the node with the smallest value from the open list as the current node, and check whether the position coordinates of the current node are equal to the position coordinates of the Agent to be rescued;Determine whether the target has been reached: If they are equal, it means the target node has been found. At this time, construct a complete path from the rescue Agent to the Agent to be rescued by backtracking the parent nodes, and then end the path planning process; if they are not equal, expand the current node and query the neighbor nodes within the sensing radius around the current node through the KD tree; Update neighbor node information: For each queried neighbor node, calculate the new g value from the rescue Agent passing through the current node to reach this neighbor node. Assume the g value of the current node is g current , and the movement cost from the current node to the neighbor node is cost move , then the new g value g new =g current +cost move ; Recalculate the new value of the neighbor node in the same way as during initialization. Calculate it using the Euclidean distance formula based on the position coordinates of the neighbor node and the position coordinates of the Agent to be rescued; Calculate the new value as . If the neighbor node is not in the open list and the closed list, add it to the open list and set its value; if the neighbor node is already in the open list and g new < g old , then update the value of this node in the open list; Add the current node to the closed list: Add the current node to the closed list, indicating that it has been expanded and will not be expanded repeatedly in the future.

[0016] Preferably, in step S5, compare the normal and emergency data, identify design defects, and propose a layout optimization plan; analyze the simulation results, use Python Matplotlib and Tableau to generate a heat map to display the normal pedestrian flow distribution, compare the changes in key indicators before and after evacuation through a time series graph, combine the clustering algorithm to identify high-frequency congestion areas, and propose improvement measures for the problem points to provide a basis for decision-making; Use the DBSCAN clustering algorithm to perform clustering analysis on the pedestrian trajectory data in the normal and emergency modes to identify high-frequency congestion areas; The DBSCAN algorithm defines the neighborhood radius and the minimum number of points MinPts, the data points are divided into core points, boundary points, and noise points; for a point p , if the number of points in its neighborhood is greater than or equal to MinPts , then p is a core point; if p is within the neighborhood of a certain core point, but the number of points in its own neighborhood is less than MinPts , then p is a boundary point; otherwise it is a noise point; Then, through cluster analysis, the areas where congestion often occurs in the building are found, providing a reference for optimizing the building layout.

[0017] Preferably, in step S6, the model parameters are adjusted and the simulation is repeated until the key indicators are met. According to the analysis feedback results, the agent behavior parameters or the environment model are adjusted, and the simulation is restarted until the ideal evacuation efficiency and pedestrian circulation effect are achieved.

[0018] Set the key indicator thresholds, the evacuation time threshold , the path deviation rate threshold ; If the evacuation time in the simulation result > or the path deviation rate , then adjust the model parameters and then restart the simulation until all key indicators meet the threshold requirements.

[0019] Therefore, the building pedestrian simulation statistics and analysis method of the present invention adopting the above structure has the following beneficial effects: (1) The present invention dynamically plans the path through algorithm, and the system can quickly adapt to environmental changes, provide the optimal evacuation route for pedestrians in real time, reduce congestion, and improve the evacuation efficiency. Combining the heuristic function of congestion measurement, the system can more accurately reflect the congestion situation in the actual evacuation process, help identify and relieve potential bottleneck areas, and prevent stampede accidents.

[0020] (2) The present invention not only considers individual behaviors, but also realizes the cooperation mechanism between agents such as assistants and people with mobility difficulties, which makes the simulation closer to the real situation and is beneficial to evaluating the effectiveness of different evacuation strategies.

[0021] (3) The simulation system in the present invention can collect rich statistical data, including evacuation time, pedestrian flow distribution, congestion point analysis, etc., providing a scientific basis for the safety design improvement and emergency plan formulation of buildings.

[0022] Next, through the drawings and embodiments, the technical solutions of the present invention will be further described in detail. Description of the Drawings

[0023] Figure 1Schematic flow chart of a method for simulating, counting, and analyzing building pedestrians according to the present invention. Detailed implementation manners

[0024] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0025] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the ordinary meanings understood by those of ordinary skill in the art to which the present invention belongs. The "first", "second" and similar terms used in the present invention do not denote any order, quantity or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left" and "right" are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0026] Embodiment As Figure 1 shown, the present invention provides a method for simulating, counting, and analyzing building pedestrians, including the following steps: S1. System requirement analysis: clarify the simulation objectives, evaluate the safety evacuation ability of the building and optimize the daily pedestrian flow line, use BIM software or CAD software for modeling, and collect the specific information of the building; S2. Establishment of the environment and agent model: construct an accurate three-dimensional building environment model, including static elements and dynamic elements, and define the state space, action space, and reward function of the agent; S3. Normal pedestrian cycle simulation: The agent selects a path based on the Markov decision process, collects data in real time, evaluates the rationality of the facility layout in combination with the path deviation rate, and performs real-time visualization display of one-dimensional, two-dimensional, and three-dimensional charts through ScottPlot; S4. Emergency evacuation simulation: When an emergency event is triggered, the agent's goal switches to escape, activates the cooperative rescue rules, pre-computes the shortest path to the safe exit based on the algorithm, avoids obstacles in real time in combination with DWA, manages the obstacle update path set through the KD tree, guides the agent's behavior using the reward function, uses 3D trajectory playback to mark congestion points and rescue events, and generates charts to quantitatively evaluate the utilization rate of the exit and the cooperation efficiency; S5. Multi - mode comparison and optimization: Compare normal and emergency data, generate heat maps and time - series graphs using Python's Matplotlib and Tableau, analyze them in combination with the DBSCAN clustering algorithm, identify building design defects and high - frequency congestion areas, and propose targeted layout optimization plans; S6. Iterative verification: Analyze and feedback based on the simulation results, adjust the agent behavior parameters or the environment model, and conduct the simulation again; Set key indicator thresholds and continuously iterate until the desired evacuation efficiency and pedestrian circulation effect are achieved.

[0027] 1. Independence and relevance of normal and emergency modes In the building pedestrian simulation system of the present invention, the normal and emergency modes share the building environment model and the basic attributes of the Agent (such as movement speed). This means that whether it is the simulation of daily personnel activities or the evacuation simulation in an emergency, it is based on the same building structure and the basic movement ability of pedestrians. For example, the physical characteristics and spatial layout of static elements such as walls, doors, and stairs in the building, as well as dynamic elements such as movable obstacles, are the same in both modes. At the same time, the basic attributes of the Agent, such as speed, reaction time, and perception range, also remain unchanged, which can ensure the coherence and consistency of pedestrian behavior when switching between different modes and avoid unreasonable results caused by model differences.

[0028] In the normal mode, the goal of the Agent is mainly to complete preset activities, such as going to a store to shop or going to an office to work. Its path selection is affected by various factors, and the attraction of facilities plays a key role. Different facilities (such as stores, restaurants, rest areas, etc.) have different attraction values for the Agent, and the Agent will dynamically select paths according to these attraction values and its own goals. For example, an Agent who wants to shop will be more inclined to choose the path leading to the store and will less choose areas far from the store with low attraction.

[0029] In addition, the behavior of the Agent also includes random stops and path preferences. Random stops simulate the situation where pedestrians in reality may stop briefly for various reasons (such as checking mobile phones, admiring the surrounding environment, etc.), increasing the authenticity of the simulation. Path preferences reflect the individual differences that different pedestrians may choose different paths in similar situations. Some pedestrians may prefer to take familiar paths even if this path is not the shortest.

[0030] The Agent optimizes its behavior through the Markov decision process. The Markov decision process is a probability - based decision - making model that assumes that the action taken by the Agent in the current state depends only on the current state and is independent of the past history.

[0031] In this simulation, the Agent takes an action in state s and then transfers to state with a probability of s' . If the immediate reward is , then the long-term cumulative reward of the Agent is ; Among them, is the discount factor, whose value range is (0, 1), used to measure the importance of future rewards. The Agent selects the optimal action strategy by maximizing the long-term cumulative reward. The closer it is to 1, the more the Agent values future rewards and is more inclined to choose actions that can bring long-term benefits; The closer it is to 0, the more the Agent focuses on the current immediate reward.

[0032] When entering the emergency mode, the goal of the Agent is forced to switch to escape. At this time, the obstacle avoidance and cooperation mechanisms are activated to ensure that the Agent can evacuate safely and quickly. Finding the nearest safe exit becomes the primary task of the Agent. The Agent will calculate the distance based on its own position and the positions of each safe exit, select the nearest safe exit as the target, and plan a path to move towards it.

[0033] At the same time, following the instruction signs is also an important rule in the emergency mode. The Agent will recognize the instruction signs during the movement and change its movement direction according to the indicated direction. By calculating the angle between the current movement direction vector and the direction vector pointed by the instruction sign, if the angle is greater than the set threshold, the Agent will adjust its direction according to certain rules to make it closer to the direction of the instruction sign, thus guiding pedestrians to evacuate orderly towards the safe exit.

[0034] The cooperative rescue mechanism plays a key role in the emergency mode. Some Agents are set to have the rescue ability. When a rescue-needed Agent is found, the rescue Agent will calculate the distance between itself and the rescue-needed Agent, select the nearest rescue-needed Agent as the rescue target, and then use algorithm to plan a path to go for rescue. During the rescue process, it follows the obstacle avoidance model and path planning strategy to ensure that it can reach the position of the rescue-needed Agent smoothly and carry out the rescue.

[0035] The switching of modes is achieved through event triggers. For example, when an emergency event such as a fire alarm going off or a smoke sensor detecting smoke occurs, the system will immediately activate the event response module. This module will force the goal of the Agent to switch from normal activities to escape and reset the decision-making logic of the Agent. During the switching process, the Agent will stop executing tasks in the normal mode and instead execute the behavior rules in the emergency mode, such as finding the nearest safe exit, following the signs, and participating in coordinated rescue. This transition mechanism ensures that the system can respond quickly in emergency situations and simulate the behavior changes of pedestrians in real scenarios.

[0036] 2. Statistical Analysis and Visualization Implementation In the normal mode, data collection work is carried out around multiple dimensions, aiming to comprehensively capture the activity characteristics of pedestrians in the building. When recording the pedestrian flow in each area, the system takes a set time period as the statistical cycle, accurately counts the number of Agents entering each area, and then through the formula calculate the pedestrian flow (persons / minute) in area r during the time period t 1 , t 2 . This data can intuitively reflect the intensity of personnel flow in different areas at different times and help analyze which areas are hot spots for personnel activities.

[0037] The statistical analysis of the average stay duration focuses on the stay behavior of Agents in each area. By recording the stay time r of each Agent in area , calculate the average stay duration, which is crucial for evaluating the attractiveness and functional rationality of the area. For example, if the average stay duration in a rest area is relatively long, it may mean that the facility configuration or environmental comfort in this area is relatively high; conversely, if the average stay duration in a certain passage is too long, it may imply that there are factors hindering the passage of people.

[0038] Path deviation rate and path deviation index measure the path selection efficiency of Agents from different angles. The ratio of the actual path to the theoretical shortest path can reflect whether the Agent has chosen an efficient path during the movement. If the deviation rate is relatively high, it indicates that the Agent may be interfered by factors such as facility layout and crowd congestion, and the reasons need to be further analyzed to optimize the layout.

[0039] The calculation of the average pedestrian speed is an important quantification of the movement state of the Agent. By recording the displacement and time interval of the Agent within a certain period of time and combining its velocity vector information, the average speed can be obtained. This data can not only reflect how fast pedestrians move in different areas, but also be correlated with other indicators to analyze the impact of speed changes on the overall pedestrian flow.

[0040] The statistics of facility utilization rate are achieved by monitoring the interaction between the Agent and various facilities. For example, for store facilities, the proportion of the number of Agents entering the store to the total number of Agents is statistically calculated; for vertical transportation facilities such as elevators and stairs, the number of Agent person-times using them is statistically calculated. The facility utilization rate can intuitively show the frequency of use of different facilities in the building, providing a basis for optimizing facility layout and resource allocation.

[0041] Data collection in emergency mode focuses on key indicators during the evacuation process to evaluate the evacuation effect and discover potential problems. The statistics of the evacuation time distribution start from the triggering of an emergency event, precisely record the time when each Agent reaches the safe exit, and then generate a histogram of the evacuation time distribution. By analyzing this histogram, it is possible to understand the change in the number of evacuees in different time periods during the evacuation process and judge the smoothness and efficiency of the evacuation process.

[0042] The exit utilization rate is measured by statistically calculating the proportion of the number of Agents evacuated through each safe exit to the total number of Agents. This indicator can intuitively reflect the degree of use of each safe exit during the evacuation process. If the utilization rate of a certain exit is too low, it may mean that there are problems such as unsmooth paths or unclear signs at this exit, which need to be optimized.

[0043] The statistics of the number of collaborative rescues are used to evaluate the cooperation between Agents in emergency situations. Each successful rescue behavior will be recorded. By analyzing the number of collaborative rescues, it is possible to understand the occurrence frequency of mutual assistance behaviors among people in emergency situations and evaluate the effectiveness of the rescue mechanism.

[0044] In addition, data such as evacuation time, congestion level, effectiveness of escape routes, and overlap rate of bottleneck areas also need to be collected. Evacuation time is the time difference from the triggering of an emergency event to all Agents reaching the safe exit, and it is a key indicator to measure evacuation efficiency. The congestion level can be indirectly reflected by the density of Agents in the area, using the pedestrian density formula in two-dimensional grids or three-dimensional cells or to calculate. The effectiveness of escape routes is comprehensively evaluated by combining factors such as path deviation rate and whether obstacles are successfully avoided to judge whether the escape routes selected by Agents are reasonable. The overlap rate of bottleneck areas is used to quantify the congestion level of areas in the building that are prone to congestion during the evacuation process. is the number of all possible bottleneck areas, is the number of times of personnel congestion overlap occurring within the bottleneck area, is the total number of times an Agent passes through the bottleneck area

[0045] 3. Visualization Tools The Matplotlib library of Python is powerful and is mainly used to generate heatmaps in this simulation system. When generating the normal pedestrian flow heatmap, the building floor plan is divided into numerous small squares. The pedestrian density is calculated based on the number of Agents in each square, and then the density values are mapped to different colors. Usually, high-density areas are represented by red, and low-density areas are represented by blue or green, which can visually display the pedestrian flow density in different areas of the building and help quickly identify the hot spots of personnel aggregation and the sparse areas of pedestrian flow.

[0046] Time series graphs can also be plotted through Matplotlib to compare the changes in key indicators before and after evacuation. For example, with time as the horizontal axis and indicators such as the number of evacuated people and the congestion degree of the bottleneck area as the vertical axis, curves showing changes over time are plotted. By observing the trend of the curves, it can be clearly seen how these indicators change during the evacuation process, such as the growth trend of the number of evacuated people and the alleviation or aggravation of the congestion degree of the bottleneck area, so as to deeply analyze the dynamic changes in the evacuation process.

[0047] Tableau is used to construct an interactive dashboard, which allows users to interact with data through an intuitive interface. In this system, users can view various statistical data and visualization charts in real time through the Tableau dashboard. Users can select different building floors and time periods to view corresponding data such as pedestrian flow density and facility utilization rate, and can also obtain more detailed information by clicking on chart elements, such as the specific number of Agents in a certain area and the average stay duration.

[0048] Through the filtering and sorting functions of Tableau, users can conduct in-depth analysis of the data. Data of specific types of Agents (such as adults, children, the elderly) can be filtered out for separate analysis to understand the activity patterns of different types of pedestrians in the building; different facilities can also be sorted according to the facility utilization rate to find the most popular and least popular facilities, providing strong support for optimizing the building layout.

[0049] ​ScottPlot is mainly used for real-time visual display of one-dimensional, two-dimensional, and three-dimensional charts obtained. In terms of one-dimensional charts, it can record the number of Agents passing through each observation point over a period of time and present it in the form of a line chart or a bar chart. For example, by setting multiple observation points in a certain passage of a building, ScottPlot can real-time plot the change curve of the pedestrian flow at each observation point over time, helping to analyze the fluctuations in the pedestrian flow within the passage.

[0050] In two-dimensional charts, ScottPlot generates a heat map based on the calculated Agent density within each grid. Compared with the heat map generated by Matplotlib, the advantage of ScottPlot lies in its real-time nature, which can update the heat map in real-time as the simulation progresses, showing the dynamic changes in the flow of people. At the same time, it can also add other information in the two-dimensional chart, such as the movement trajectories of Agents, further enriching the visualization effect.

[0051] For three-dimensional charts, ScottPlot divides the building into multiple three-dimensional small cube units, calculates the Agent density within each unit, and presents it in the form of a three-dimensional density model. Through operations such as rotation and scaling, users can observe different parts of the building from different angles.

[0052] Therefore, the present invention adopts the above-mentioned method for building pedestrian simulation statistics and analysis. Through the algorithm for dynamic path planning, the system can quickly adapt to environmental changes, provide instant optimal evacuation routes for pedestrians, reduce congestion, and improve evacuation efficiency. Combining with a heuristic function for congestion measurement, the system can more accurately reflect the congestion situation in the actual evacuation process, help identify and relieve potential bottleneck areas, and prevent stampede accidents. Not only considering individual behaviors, but also implementing a cooperation mechanism among agents such as assistants and people with mobility difficulties, which makes the simulation closer to the real situation and is beneficial to evaluating the effectiveness of different evacuation strategies. The simulation system can collect rich statistical data, including evacuation time, pedestrian flow distribution, congestion point analysis, etc., providing a scientific basis for the improvement of the safety design of buildings and the formulation of emergency plans.

[0053] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that: they can still modify or equivalently replace the technical solutions of the present invention, and these modifications or equivalent replacements cannot make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for building pedestrian simulation statistics and analysis, characterized in that, It includes the following steps: S1. System requirements analysis, clarify the simulation objectives, evaluate the safety evacuation ability of the building and optimize the daily pedestrian flow line, use BIM software or CAD software for modeling, and collect the specific information of the building; S2. Establishment of the environment and agent model, construct an accurate three-dimensional building environment model, including static elements and dynamic elements, and define the state space, action space and reward function of the Agent; S3. Normal pedestrian circulation simulation: The Agent selects a path based on the Markov decision process, collects data in real time, evaluates the rationality of the facility layout in combination with the path deviation rate, and performs real-time visualization display of one-dimensional, two-dimensional and three-dimensional charts through ScottPlot; S4. Emergency evacuation simulation: When an emergency event is triggered, the Agent's goal switches to escape, activating the collaborative rescue rules. Based on the algorithm, pre-compute the shortest path to the safe exit, combine with DWA for real-time obstacle avoidance, manage the obstacle update path set through KD-tree, use the reward function to guide the Agent's behavior, adopt 3D trajectory playback to label congestion points and rescue events, and generate charts to quantitatively evaluate the exit utilization rate and collaborative efficiency; S5. Multi-mode comparison and optimization: Compare the normal and emergency data, generate heat maps and time series graphs using Matplotlib and Tableau of Python, analyze in combination with the DBSCAN clustering algorithm, identify building design defects and high-frequency congestion areas, and propose targeted layout optimization plans; S6. Iterative verification: According to the analysis and feedback of the simulation results, adjust the agent behavior parameters or the environment model, and perform the simulation again; Set the key index threshold, and continuously iterate until the ideal evacuation efficiency and pedestrian circulation effect are met.

2. The architectural pedestrian simulation statistics and analysis method according to claim 1, wherein: In step S1, the specific information of the building includes the floor plan, entrance and exit positions, stair widths, and fire protection facilities; Calculate the accessibility indicators for each area of the building using this data , and the formula is: ; wherein, is the shortest path distance from area i to other area j, and n is the number of areas connected to area i; the accessibility index is used to measure the convenience of personnel flow between different areas in the building, the larger the value, the closer the connection between this area and other areas, and the more convenient the personnel flow.

3. The method for building pedestrian simulation statistics and analysis according to claim 1, characterized in that: In step S2, define the Agent attributes and state space. The Agent attributes include speed, perception radius, and behavior target; different types of pedestrians are represented as adults, children, and the elderly, and the pedestrian distribution characteristics include speed, reaction time, and perception range; at the same time, define the state space, action space and reward function of the Agent motion model; Among them, the state space of the Agent motion model defines the position state, speed state and behavior state in the simulation environment; Position state: Using three-dimensional coordinates to represent the specific position of the Agent within the three-dimensional space of the building, and its change over time reflects the movement trajectory of the Agent; Speed state: Described by the velocity vector, representing the magnitude and direction of the Agent's movement speed in each direction; Behavior state: It is set that the Agent has three basic behavioral states, including walking, waiting, and running, which are represented by a state variable S to represent the behavioral state of the Agent, ; The behavior operations taken by the action space of the Agent motion model include movement behavior and turning behavior, as follows: The forward movement step size is , according to the speed state and time interval Calculate the new position, expressed as: ; Among them, is the old position of the Agent, is the new position after taking the movement action; Total reward function of the Agent: ; Location-related rewards R location : Used to reflect the proximity of the Agent to the target location or the safe exit; Use the reciprocal of the distance to the target reward as the reward. Assume the target position of the Agent is , and its current position is . The expression for the proximity-to-target reward is ; wherein θ is an extremely small constant to avoid a zero denominator; When the Agent successfully reaches the safe exit, give a large positive reward R exit, and this is the reward for reaching the safe exit at this time; Path length reward R path : Used to measure the efficiency of the Agent's movement path; When the Agent completes a move, calculate the actual path length it has traveled L actual and the theoretical shortest path length L optimal The ratio of which is defined as the path length reward , where is a ratio coefficient α = L optimal / L actual ; If the path of the Agent is close to the theoretical shortest path, α close to 1, R path it is relatively small; if the Agent takes a lot of detours, α it is larger, R path it will be smaller or negative; Collaborative Reward R cooperate : Reflect the collaborative behavior among agents; Let the number of other Agents assisted by the Agent be , then the expression for the collaborative reward is , where is a coefficient; The more, the higher the collaborative reward, encouraging Agents to assist each other; is the weight of the reward function.

4. A method for building pedestrian simulation statistics and analysis according to claim 1, characterized in that: In step S3, it specifically includes the following steps: S31. Behavior rule management: The Agent selects a path based on the Markov decision process; in the normal simulation, the Agent dynamically selects a path according to the preset target and optimizes the behavior through the Markov decision process; Suppose the agent takes an action in state s and then transfers to state with a probability of s' , and the immediate reward is . Then the long-term cumulative reward of the agent is ​ ; Among them, is the discount factor, whose value range is (0, 1), used to measure the importance of future rewards. The Agent selects the optimal action strategy by maximizing the long-term cumulative reward; is the state at time t + k; is the action taken at time t + k; is the state at time t + k + 1; S32. Real-time data collection: Record the regional traffic flow, residence duration, and path deviation rate , and the system calculates the pedestrian flow and average residence duration in each area in real time, and combines the path deviation rate to evaluate the rationality of the facility layout; Calculation area r In the time period t 1 , t 2 Pedestrian flow within F r The formula is: ; Among them, N r is the number of Agents that enter the area t 1 during the time period t 2 , r ; Calculate the average residence time of the Agent in the area r inside T r The formula is as follows: ; Among them, is the th residence time of Agent r in the area; S33. Visualization analysis: Display the pedestrian flow density through a heat map and generate a facility utilization rate report; Use ScottPlot to perform real-time visualization of the obtained one-dimensional, two-dimensional, and three-dimensional charts. Determine the content of the one-dimensional data based on the queried information, and record the number of Agents passing through each observation point over a period of time. In the two-dimensional chart, divide the floor plan of a building into small squares, calculate the density of Agents in each square, and generate a heat map to display the crowd flow density. In the three-dimensional chart, divide the building into multiple three-dimensional small cube units and calculate the density of Agents in each unit; At the same time, a real-time heat map is generated by ScottPlot to reflect the regional density, and the average pedestrian speed, path deviation index and facility utilization rate are calculated; For the high-frequency stay areas, which are denoted as potential congestion points for reference in building layout optimization, calculate the pedestrian density within the two-dimensional grid and its expression is as follows ; Among them, is the number of Agents within the grid , and is the area of the grid . Calculating the pedestrian density inside , and its expression is ; Among them, is the number of Agents within the unit, and is the volume of the unit.

5. A method for building pedestrian simulation statistics and analysis according to claim 1, characterized in that: In step S3, the calculation formula for the path deviation rate is , and the area with a deviation rate > 1.5 is marked on the heat map as the key area for optimization.

6. The method for building pedestrian simulation statistics and analysis according to claim 5, characterized in that: In step S4, it specifically includes the following steps: S41. Event trigger mechanism: Switch the Agent target to escape and activate the collaborative rescue rule; when an emergency event is triggered, the system switches the Agent target from the normal activity mode to escape through the event response module and activates the collaborative rescue reward mechanism; S42. Dynamic path planning: Pre-calculate the feasible shortest path based on the A algorithm and avoid obstacles in real time in combination with DWA; specifically as follows: Based on A the algorithm pre-computes the feasible shortest paths from each Agent to the safe exits and dynamically updates the path lengths , the Agent selects the exit with the smallest value as the target, queries the positions of obstacles through a real-time KD tree, and uses the dynamic window approach (DWA) for local obstacle avoidance to ensure the feasibility of the path; Manage the obstacle positions based on the KD tree and update the feasible path set in real time; use the reward function to guide the Agent behavior, and its expression is as follows: ; Among them, is the total reward value; R location is the position-related reward, R path is the path length reward, R speed is the speed-related reward, which is used to punish the speed reduction caused by obstacle avoidance or detouring; R speed = k speed ( v normal - v actual );in, v normal For normal speed, v actual is the actual speed, k speed is the coefficient; In the A algorithm, a KD - tree is constructed and data points are inserted. The KD - tree is used to process various object information in the environment. The position coordinates of rescue agents, agents to be rescued, other agents walking normally, and static obstacles are inserted into the KD - tree as data points; Initialize the relevant parameters of the A algorithm, define a node class to represent the nodes in path planning, and each node contains the position coordinates ( ), the parent point, and initialize g the point to 0, where g the value is the actual cost from the rescue Agent's position to the current node, and the h value represents the heuristic estimated cost from the current node to the position of the Agent to be rescued. According to the current node coordinates ( ) and the coordinates of the Agent to be rescued ( ), it is calculated through the Euclidean distance formula, and the specific expression is: ; with a value of , which is used to evaluate the priority of nodes . Nodes with smaller values have higher priorities; and create an open list and a closed list. The open list is used to store nodes to be expanded. Initially, add the node corresponding to the rescue Agent's position to the open list and set its value. The closed list is used to store nodes that have been expanded and is initially empty; The main loop of the algorithm. After entering the loop, as long as the open list is not empty, perform the following operations: Take out the current node; Determine whether the target has been reached; Update the information of neighbor nodes; Add the current node to the closed list; In DWA, the agent selects the smallest exit and adjusts the real-time movement direction through DWA. The formula is as follows: ; Among them, is the speed adjustment amount, is the obstacle distance, is the deceleration coefficient, is the safety distance threshold, representing the minimum safety distance between the Agent and the obstacle or other pedestrians; During the movement of the rescue agent, it continuously queries the surrounding area through the KD tree to sense neighbor information within the perception radius, and its perception radius is , and determines whether there are obstacles or other pedestrians approaching. If the detected distance to other objects is less than the safety distance threshold , adjust the speed or change the walking direction according to this formula to avoid collisions; S43. Data evaluation: Statistically calculate the evacuation time and the overlapping rate of bottleneck areas, and mark the congestion points in the 3D trajectory playback; Run the evacuation simulation to collect data on evacuation time, congestion level, and the effectiveness of escape routes; Use the 3D trajectory playback technology to mark the bottleneck areas and rescue events, and synchronously generate a histogram of evacuation time distribution and a matrix of path overlapping rate to quantitatively evaluate the utilization rate of exits and the cooperation efficiency; Calculating the evacuation time It is the time difference from the emergency trigger to the time when all agents reach the safety exit; calculating the overlapping rate of bottleneck areas O The formula is ; Where m is the number of all possible bottleneck regions, is the number of times of personnel congestion overlap occurring within the bottleneck region, is the total number of times an Agent passes through the bottleneck region ​ 7. A method for building pedestrian simulation statistics and analysis according to claim 5, characterized in that: The main loop of the algorithm. After entering the loop, as long as the open list is not empty, perform the following operations: Take out the current node: Take out the node with the smallest value from the open list as the current node, and check whether the position coordinates of the current node are equal to the position coordinates of the Agent to be rescued; ​ Judge whether the target has been reached: If they are equal, it means the target node has been found. At this time, a complete path from the rescue agent to the agent to be rescued is constructed by backtracking the parent node, and then the path planning process ends; If they are not equal, expand the current node. Query the neighbor nodes within the sensing radius around the current node through the KD - tree; Update neighbor node information: For each queried neighbor node, calculate the new g value from the rescue agent passing through the current node to this neighbor node. Assume the g value of the current node is g current , and the movement cost from the current node to the neighbor node is cost move . Then the new g value g new =g current +cost move ; Recalculate the new value of the neighbor node in the same way as during initialization. Calculate it using the Euclidean distance formula based on the position coordinates of the neighbor node and the position coordinates of the agent to be rescued; Calculate the new value as , if the neighbor node is not in the open list and the closed list, add it to the open list and set its value; if the neighbor node is already in the open list and g new < g old , then update the value of this node in the open list; Add the current node to the closed list: Add the current node to the closed list, indicating that it has been expanded and will not be expanded repeatedly later.

8. A method for building pedestrian simulation statistics and analysis according to claim 1, characterized in that: In step S5, compare the normal and emergency data, identify design defects, and propose a layout optimization plan; Analyze the simulation results, use Python Matplotlib and Tableau to generate heat maps to show the normal pedestrian flow distribution, compare the changes in key indicators before and after evacuation through time - series graphs, combine clustering algorithms to identify high - frequency congestion areas, and propose improvement measures for problem points to provide a basis for decision - making; Use the DBSCAN clustering algorithm to perform clustering analysis on pedestrian trajectory data in normal and emergency modes to identify high - frequency congestion areas; The DBSCAN algorithm divides data points into core points, border points, and noise points by defining the neighborhood radius and the minimum number of points MinPts . For a point p , if the number of points in its neighborhood is greater than or equal to MinPts , then p is a core point; if p is in the neighborhood of a certain core point, but the number of points in its own neighborhood is less than MinPts , then p is a border point; otherwise it is a noise point Then, through clustering analysis, find the areas in the building where congestion often occurs to provide a reference for optimizing the building layout.

9. A method for building pedestrian simulation statistics and analysis according to claim 8, characterized in that: In step S6, adjust the model parameters and repeat the simulation until the key indicators reach the standard; According to the analysis feedback results, adjust the behavior parameters of the agents or the environment model, and re - perform the simulation until the desired evacuation efficiency and pedestrian circulation effect are achieved; Set the threshold of key indicators and the threshold of evacuation time and the threshold of path deviation rate ; If the evacuation time in the simulation results > or the path deviation rate , adjust the model parameters and then re - conduct the simulation until all key indicators meet the threshold requirements.

Citation Information

Patent Citations

  • Crowd evacuation method and system based on multi-carrier intelligent guidance

    CN111767789A

  • Crowd evacuation simulation method and system based on deep reinforcement learning

    CN112231967A

  • Layered passenger ship personnel emergency evacuation method considering deadline and congestion relief

    CN117371760A

  • Crowd evacuation simulation method and system based on multi-agent deep reinforcement learning

    CN118296938A

  • Elevator evacuation optimal scheduling method based on multi-agent reinforcement learning algorithm

    CN118365022A

Cited By

  • Pedestrian circulation and personnel evacuation evaluation simulation system in public building

    CN120562155A

  • A pedestrian circulation and evacuation assessment simulation system in public buildings

    CN120562155B

  • Processing method and device for automatically processing multi-layer BIM model based on AI model

    CN121637750A

  • Underground space exit area pedestrian flow state perception and risk early warning method

    CN122529497A

  • A high flow area early warning management and control method and system

    CN122596589A