Simulation of Pedestrian Movements Using Fine Grid Cellular Automata Model

Crowd simulation is used for evacuation and crowd safety inspections, study of performance in crowd systems and animations. Cellular automata has been extensively used in modelling the crowd. In regular cellular automata models, each pedestrian occupies a single cell with the size of a pedestrian body. Since the space is divided into relatively large cells, the movements of pedestrians look like the movements of pieces on a chess board. Furthermore, all pedestrians have the same body size and speed. In this paper, a method called fine grid cellular automata is proposed in which smaller cells are used and pedestrian body may occupy several cells. The model allows the use of different body sizes, shapes and speeds for pedestrian. The proposed model is used for simulating movements of pedestrians toward a target. A typical walkway scenario is used to test and evaluate the model. The movements of pedestrians are smoother because of the finer grain discretization of movements and the simulation results match empirical speed-density graphs with good accuracy.


INTRODUCTION
Crowd simulation models can be used to predict crowd efficiency and performance issues in designing buildings and public facilities.Moreover, such models are useful in estimating the evacuation time during emergencies.The simulation of crowd and pedestrian movements is also effective in producing animations.
The collective movements of individual pedestrians form the behaviors and movements of a crowd.Therefore, an approach toward crowd modeling could start from the creation of a model that simulates the movements and behaviors of individual pedestrians.The large-scale behaviors of pedestrians, such as way finding and navigational decision making, can be dealt with in a separate model from small-scale behaviors, such as collision avoidance while walking.However, some of the existing models combine these behaviors in a single model [1].Navigational and way finding behaviors are referred to as macroscopic movements, whereas small-scale behaviors are called microscopic movements.In contrast to the categorization of "microscopic and macroscopic behaviors", another categorization divides crowd models into "macroscopic, mesoscopic, and microscopic models".
In macroscopic models, such as Hughes' continuum theory of pedestrian flow [2], a crowd is considered as a single liquid-like entity with varying densities and speeds in its different parts.In these models, the overall properties of a crowd, such as flow, density, and speed, in different parts of the system  ISSN: 2252-8938 Int J Artif Intell, Vol.11, No. 4, December 2022: 1197-1212 1198 are estimated using differential equations [2]- [7].Such calculations are easy and require minimal computations because they do not involve simulating thousands of pedestrians.Mesoscopic models consider individual pedestrians but do not simulate pedestrian movements.Løvås [8] performed crowd modeling with discrete event and queuing network methods.In the model, a crowd system is represented by a network of nodes (rooms) and links (doorways).The capacity of doorways and corridors is used to calculate flow and predict congestion and queuing.The model considers the way selection of individual pedestrians but uses the information only to estimate flow in each path; moreover, the model does not simulate movements.Another mesoscopic model is that of Hanicsh et al. [9].Mesoscopic models provide the number of pedestrians and the average density, flow, and speed in a region, but they do not indicate the different points inside a region.If detailed information such as density and speed for different points in an area is required, these models are not applicable.By contrast, microscopic models model the behaviors and movements of individual pedestrians in a crowd and use the emerging behavior of these pedestrians to simulate the behaviors of the whole crowd.Microscopic models allow users to observe details on the behaviors of pedestrians in different situations (e.g., emergency evacuation), their interactions with obstacles and building elements, and the flow, density, and speed of the pedestrians.High computing power requirement is not a major concern today because of the availability of powerful multi-core computers.
A few dominant approaches have been used to model microscopic movements.Physics-based methods utilize the laws of physics to model pedestrian movements.Attraction and repulsion forces are used in Teknomo's forces model [10], Helbing's social forces [11], and Okazaki's magnetic force method [12].However, the three models utilize various physical concepts and rules to model pedestrian interactions.Helbing and Molnár [11] proposed a model that describes movements in a crowd in terms of imaginary forces applied to pedestrians.Such movements are then calculated as if pedestrians are particles with a specific mass subjected to physical attraction and repelling forces.These forces include the repelling force between pedestrians, which represents the tendency to avoid collisions; the repelling force between pedestrians and obstacles (e.g., walls), which represents the pedestrians avoiding collision with walls and obstacles; and the attraction force between pedestrians and target points, which represents the inclination of pedestrians to walk toward their target.These forces, which are called "social forces" are not physical, and they symbolize internal motivations.The velocity-based collision avoidance or velocity obstacle models (VO) [13]- [17] are another group of physics-based models.In this group of models, collision is avoided by calculating the feasible velocities (i.e., speed and direction) for pedestrians that will not cause collision in a specific time frame.If no collision potential is calculated, then pedestrians can walk with their free flow speed.The VO model is similar to rule-based models (in which collision avoidance is not guaranteed).The models in this category use continuous movement (as opposed to discrete moves in cellular automata).In dense crowds comprising more than 5-6 pedestrians/m 2 , people tend to walk very near to each other and almost collide.Curtis et al. [18] utilized this model type to simulate dense crowds, but because collisions are totally avoided by velocity adjustment, they found that simulations might not simulate dense crowd-specific phenomena, such as pushing and trampling.However, extending the model to support dense crowd features might be possible (similar to the work done by Henein and White [19] for cellular automata).Continuous methods for crowd simulation, produce smooth movements and could potentially generate accurate and realistic results for low to medium density crowds.Several reserchares have attempted to improve these models to allow realistic simulations of dense crowds [20].However, these models use complex mathematical rules.Adding features to such models (e.g.social forces) requires the modification of relatively complicated differential equations.In addition, solving such systems of equations using numerical methods is computationally expensive, and model modification may require altering the numerical methods as well.
Cell-based methods divide a movement space into cell grids and utilize cellular automata [1], [21]- [24], distance maps [25]- [27], or other methods to calculate the transition of pedestrians between cells.Lattice gas models could also be considered a modification of cellular automata models [28], [29].Cellular automata models belong to a category of models that divide a simulation area into grid cells.In terms of cell occupation, cellular automata models can be categorized into three types.In the first and most common type, no more than one pedestrian can be present in each cell.Collision is automatically avoided because applying this rule implies that pedestrians cannot overlap each other.In these models, each pedestrian spreads and occupies only one cell.Most of the conventional cellular automata crowd simulation models [1], [21]- [24] fall in this type.The uniform size of the grid cells limits the size of agents and the speed values they might take.They are unable to simulate moving objects with sizes that are different from a pedestrian.Furthermore, the chess like, large movements are neither smooth nor realistic.In the real world, pedestrians have various sizes, and their average movement speeds could be different.Non-square cells with different sizes (e.g.0.4m x 0.2m) were used by some researchers to produce more realistic results for denser crowds [30].Ji et al. have used triangular cells to model dense crowds [31].The second type of models allows more than one pedestrian in each cell [32], [33].Such models can be considered as a hybrid between macroscopic and Int J Artif Intell ISSN: 2252-8938  Simulation of pedestrian movements using a fine grid cellular automata model (Siamak Sarmady) 1199 microscopic (i.e., mesoscopic) models.Each large cell in this category can contain numerous pedestrians.These models lack adequate details about the movements of individual pedestrians.In the third type, each pedestrian occupies more than one cell.Thompson et al. [25] studied the possible benefits of such models and simulated pedestrians occupying 2×2 cells.They suggested that this category could represent geometries accurately, simulate higher than normal velocities, and fill the gap between discrete grid-based and continuous models.The present study proposes a model that fits this category.In the model, each pedestrian may occupy and spread to several cells.The collision between bodies of different pedestrians can still be avoided.
Pedestrian transition to neighboring cells is based on simple rules.The cellular automata transition rule is a set of simple mathematical equations that determine the next transition cell for each pedestrian.The next cell is normally one of the adjacent cells.The selection is normally performed by calculating the distance of neighboring cells to a target, desired movement, or an evacuation path.Some of the models use pre-calculated maps that determine the distance and desirability of each cell in the simulation environment in terms of movement toward a target.Kretz et al. [27] extensively reviewed the different methods for calculating distance maps.Given that the rules are simple and flexible and the calculations are performed for individual pedestrians almost independently from others (i.e., with the exception of checking the occupancy of grid cells by others), integrating high-level behavioral models (e.g., way finding, decisions, and actions) is easy, and fast simulations can be performed.Even though the movement rules of individual pedestrians are simple, the collective and emergent behaviors of a pedestrian crowd could be complex and sometimes unpredictable.Such complexity is one reason that simulations are performed in the first place.Several crowd simulation models use the cellular automata approach.Nagel and Schreckenberg [34], Biham et al. [35], and Nagatani [36] utilized cellular automata to model vehicle movements in streets and highways and pedestrian movements.Blue and Adler [21], Dijkstra et al. [22], Burstedde et al., Kirchner et.al.,and Schadschneider [1], [23], [24] also employed cellular automata to simulate pedestrian movements.
Another major crowd simulation approach uses high-level behaviors that can be observed in a crowd.The rule-based model utilizes behavioral rules to simulate flocks of birds, groups of fishes, and herds of animals [37].Creatures in the model behave on the basis of their perception of other group members and their surrounding environment.Three behavioral rules are used in the model.Creatures in the flock try to avoid collision with others (collision avoidance), attempt to follow and match their speed with the group (velocity matching), and finally seek to stay near the other members of the group (flock centering).The model has also been used to simulate the movements of pedestrian groups.However, the microscopic behaviors of such movements (e.g., collision avoidance, density effects, and behaviors at narrow passages) are more suitable for making animations than for performing scientific simulations.They can hardly produce realistic simulations of collision avoidance, density effects and behaviors of pedestrians in narrow passages.Recent models in this category use more complex rules to achieve realistic results [38].
The fast and simple nature of cellular automata models makes them favourable.However, the large size of the cells and the discrete nature of the models dictate the use of the same size and speed for all of the pedestrians.In real world scenarios, pedestrians come in various sizes, and their movement speeds could significantly vary [39], [40].The present study improves the accuracy of cellular automata models while keeping their advantages.Specifically, we use a fine grid cellular automata model to simulate the least effort straight line movement toward a specific target.The finer grained cells reduce the movement speed error, and allow the pedestrians to have different speeds in different situations such as on slope and in fatigue.An adaptive method auto-calibrates the model to any empirical speed-density graph.The method allows simulating different types of moving objects such as proms, wheelchairs and cars.The evaluation of the model shows that the accuracy of the model in matching empirical data is acceptable.
Different patterns can be observed in pedestrian movements.However, the majority of pedestrian movements can be described in terms of movement toward successive targets.The concept of least effort [41] path selection can be observed in pedestrian movement behavior in such situations.For example, in a walkway, pedestrians walk in an almost straight path toward the end of the walkway and sometimes exit somewhere in the middle.The concept of least effort mostly results in a shortest path of straight line walking toward the target.In addition to the least effort movement behavior, pedestrians show collision avoidance, density and congestion aversion, and group formation.This paper first presents the basics of the fine grid cellular automata model and then formulates a variation of the least effort movement model for this type of cellular automata.In our previous work [42], we introduced a multi-layer model of human actions and movements, which uses discrete event simulation methods to simulate the actions of pedestrians.A macroscopic movement layer simulates large-scale navigational movement behaviors, and a cellular automata movement layer is used to simulate the small-scale microscopic movements of pedestrians.We also reported the early results of a cellular automata model that uses finer grain cells in another publication [43].In this paper, we extended the work by adding more features to the model and an adaptive speed control mechanism that can match any empirical density-speed data with low error.We also provide optional The organization of the paper explained by: section 2 introduces the fine grid cellular automata model.Section 3 presents the simulation results and evaluation of the model.Section 4 concludes the paper.

MODELS
This study mainly aims to improve cellular automata-based models for pedestrian movements.The improvements are focused on smooth and accurate movements and on the ability to match different crowd types.Specifically, we propose a cellular automata model that uses small cells, simulates small and fine movements, and considers pedestrians with different body sizes, shapes, and movement speeds.We also propose a method that permits the use of any empirical speed-density graph for simulations and therefore, can match different types of crowd.

Fine grid model
Pedestrians occupy a single cell shown in Figure 1 in the majority of popular cellular automata models, such as those described in [1], [21]- [24].In each simulation step, some pedestrians move to empty neighboring cells, whereas others stay at their current positions when their desired neighboring cells are already occupied.The rules used for such transitions are simple and entail lower computational cost in comparison with that used to solve partial differential equations in the social forces model.However, the movements of pedestrians are not smooth and realistic because of the coarse grain discretization of the space.The movements resemble those of chess pieces on a chessboard that jump large distances in each step (i.e., 0.4-0.56m in a 0.4×0.4m grid).

Figure 1. Transition of pedestrians into neighboring cells in regular cellular automata
In addition to unsmooth movements, pedestrians can only reach a few speed levels.If each cell measures 40×40 cm, pedestrians are able to move 0, 1, 2, 3, or 4 cells in a time unit, with the moves equivalent to speeds of 0, 0.4, 0.8, 1.2, and 1.6 m/s respectively.The speed range of 0-1.6 m/s is acceptable considering that the average speed of a pedestrian is around 1.3 m/s [44].However, it is shown that pedestrian with different ages and health conditions have different walking speeds [39], [40].These discrete choices (i.e., five possible values) limit the accuracy of the simulation and hinder the fine adjustments to the model with regard to pedestrian speed.Consequently, the capability of adjusting other model parameters related to speed, such as density, becomes limited.Using small cells (i.e., fine discretized speed steps) along with the speed control method, which is described later, minimizes the aforementioned problem.Small cells allow small displacements in each simulation step and thus permit more speed levels.Grid cells could be 5×5 cm or even smaller depending on the requirements.In a 5×5 cm grid and a 0.025 s period for each time step, 41 possible speed values (i.e., moving 0, 1,…40 cells per second) can be produced.
The top view of a pedestrian body is mapped to small cells; therefore, each pedestrian occupies more than one cell.In the fine grid cellular automata, pedestrians can feature different body shapes, sizes, and speeds.Different profiles with various settings that represent different groups in a society (e.g., children, teenagers, and adults) could be created and used.Moreover, the speed of pedestrians may vary in different situation.For example the walking speed may reduce due to fatigue or walking on a slope.Large number of maps could be generated for pedestrians moving in different directions with different orientations (e.g., 36 maps for 0°, 10°, 20°, and 30°…directions).However, in this work, we only use eight maps for eight major directions.Producing additional maps would make the implementation increasingly difficult without adding much benefit.For small-sized grid cells, creating additional maps could result in natural and smooth visual results.Figure 2  Figure 3(a) and 3(b) compare the maximum number of pedestrians in a square meter in the fine grid and traditional cellular automata models.Fine grid cellular automata can accommodate pedestrian densities of up to 7-8 pedestrians/m 2 with the presented body map.More pedestrians could possibly fit into 1 m 2 if small maps (i.e., for children and adults with small body sizes) are used.The algorithm used for the next cell selection (i.e., small-scale movements) is a modified version of the least effort straight line movement algorithm [45] adapted to the fine grid method.In the least effort algorithm, pedestrian movements are calculated on the basis of the assumption that the desired movement path needs the least effort.The least effort usually indicates the shortest path (i.e., the direct line) between the current position and the target.In each simulation step, the center point of each pedestrian is moved to one of the neighboring cells or stays at the same cell.All cells of the pedestrian map are moved along with the center cell in the same simulation step.The neighboring cell closest to the target location is often selected.The movements continue until the pedestrian reaches the target cell.At this point, a small-scale movement is completed, and the pedestrian proceeds to the next small-scale movement toward another target.A "largescale" or macroscopic navigational movement consists of a series of "small-scale" or microscopic movements, which eventually bring the pedestrian to the final target.

Probability model for cellular automata transitions
Transition probability Pi is the probability of the center point of the pedestrian map moving into neighbor i.It is given by ( 1) For each neighbor i, the parameter Mi is calculated using by (2): = (  ),   ∈ {0,1},  ≫ 0,   ≠ 0 N is a normalizing parameter that adjusts the sum of the probabilities for all neighbors to one.It is calculated as In (2), Ri is the distance between cell i and the target, and Rmin is the minimum distance to the target among all neighboring cells.Rmin/Ri therefore shows the ratio of the distance of cell i to the target in relation to the minimum distance to the target among the cells.As mentioned in the conditions, the equation is only valid when R i ≠ 0. Ri = 0 means that neighbor i is the target.If such is the case, cell i gets a probability of 1 (multiplied by ni for collision detection).All other cells obtain a probability of 0, and the pedestrian tries to move into the cell on the target.Including the condition in the equation results in the following alternate form: The basic concept behind the calculation of Mi values is the probability of selection for each neighbor, which is inversely proportional to its distance to the target.If the distance is short, the cell receives a high probability, and vice versa.However, the difference between the distances to the target could be very small for the neighboring cells.The small difference between the distances equates to a small difference between probabilities.The cell nearest to the target should be selected most of the time, whereas the cell farthest from the target should rarely be chosen.An additional parameter β is used as an exponent to increase the difference between the probabilities for the eight neighboring cells.
If moving into the i-th neighbor of the center point would cause collision, entry into that cell should be avoided (5).Such avoidance is achieved with the parameter ni.All j-th cells of a pedestrian map are checked to ensure that none of them collides with an obstacle or another pedestrian's map.The collision of the j-th cell of the map (i.e., lj=1) causes (1−lj) to become zero.Therefore, ni becomes zero for the i-th neighboring cell, and the probability of moving into that neighbor is zero.Using very large values for parameter β (i.e., β→∞) causes the neighboring cell nearest to the target to be selected all the time.The extreme case could be shown using by (6):

Simplified and fast probability model
The probability model presented in the previous section is computationally expensive because it involves floating number exponentiation and several multiplications.This model also suffers from another important drawback.In long distances to the target, the difference between the values of Ri and Rmin (the smallest Ri among the neighbors) is very small.To assign high probabilities to the nearest cells to the target, large β values should be used in (2).Consequently, the use of programming variables with large capacities and slow calculation speeds becomes an important requirement.Considering that millions of these calculations may take place in every simulation step, an effective and inexpensive method would be beneficial.
According to the fact that cells closest to the target are selected most of the time, a random number with a suitable distribution may be utilized to achieve the same.The probabilities of moving into neighboring cells become inaccurate in proportion to their distance to the target, but the distribution parameters can be adjusted to sufficiently reproduce the empirical data.Mi for each of the neighboring cells is calculated by simplifying (2) into ( 8 = (  ),   ∈ {0,1},   ≠ 0 In the next step, the neighbors are sorted according to their Mi value in descending order.Given that Mi is directly proportional to the desirability of a cell, the cell with the highest Mi and superior rank (i.e., small index) should be selected most of the time.The Poisson statistical distribution (with a λ≤1) can be used to randomly select the next cell.In addition, a softmax function can also be used for the target cell selection process.However, since softmax function uses an exponential term, it could be more expensive for large simulations.
Given that the new approach utilizes the ranking of the neighbors according to their distance to the target, in ( 8) can be further simplified to (9), which reduces the large number of calculations.The proposed model uses a randomized order of movement for pedestrians and performs the movements in a single cycle.These steps guarantee that pedestrians do not always perform their moves in the same order (which would be unrealistic).Furthermore, an additional mechanism of density perception is used to control pedestrian speed and movement direction.

Speed-density model
In most conventional cellular automata crowd models, simulated pedestrians move with their full free flow speed unless they arrive at an obstacle or encounter another pedestrian.This unrealistic behavior affects the visual outcome and the quantitative results of the simulation.Therefore, a model that uses density perception to adjust pedestrian speed has been used.
Based on the fact that density affects pedestrian speed and that pedestrians adjust their speeds according to their perceptions, the proposed model uses density perception as the basis for speed adjustment.Local density is measured for a rectangular area along the walking path of a pedestrian.The forward local density is then used in the speed adjustment algorithm.The local perception area size is an adjustable model parameter.The size represents the area that affects pedestrian speed adjustment decisions, and its length is thus likely to be in the range of a few meters.
In our implementation, the possible heading directions are divided into 12 sectors, and the density calculation (i.e., perception) area is determined on the basis of the sector of the heading, as shown in Figure 4.A rectangular area along the movement direction is used for density measurement.Figure 5 shows the density rectangles for sectors 1, 4, 7, and 10 of Figure 4.In regular cellular automata crowd models, the relation between density and speed is an outcome of the equations, parameters, and settings of the models.Researchers adjust and calibrate model settings in such a way that the speed-density graph roughly matches existing empirical graphs.This technique is sometimes tricky and difficult because of numerous model parameters.Finding settings that provide the best results becomes complicated as well.In addition, the non-fine grain size of the cells in regular cellular automata models limits the accuracy of speed adjustments.
A new active and adaptive approach is used to tackle the problem of calibrating simulations with empirical graphs.Perception information (i.e., local density around a pedestrian) is used to adjust the speed of each pedestrian in such a way that it matches the empirical graph at any moment.According to the local density, a matching speed value is extracted from the desired empirical speed-density graph.
Figure 6 shows the extraction using Weidman's empirical data for a pedestrian who perceives a density of 2.25 pedestrians/m 2 .The graph specifies that the pedestrian speed should be approximately 0.46 m/s for this specific density.Empirical speed-density graphs are available in the form of a two-dimensional array of speed-density data.If a specific density value is not in the array, the speed value is found using linear interpolation.The following equation shows how the interpolation is performed.In the equation, ρ1 and ρ2 are the two existing values in the array, and ρ is the desired density, where ρ1<ρ<ρ2 and V1<V<V2.V is the speed of the pedestrian in a crowd with a density of ρ.
As discussed previously, free flow speed varies for different pedestrians according to the normal distribution.On the basis of this distribution, a free flow speed is randomly determined for each pedestrian.The speed value extracted from the speed-density graph is then adjusted to the specific pedestrian using by (11): (11) In the equation, Vp is the maximum speed of the specific pedestrian, Vfp is the free flow speed of the pedestrian that is randomly calculated from the normal distribution, and Vmax is the maximum speed on the empirical graph (i.e., speed for the density=0).The calculated speed is then forced to the specific pedestrian in the simulation.By forcing the speed-density graph values to the simulated pedestrians, an almost similar speed-density graph can be obtained for the whole crowd in the simulation results.
Speed control is achieved by limiting the number of cells to which each pedestrian travels in a second.For example, if the size of the grid cells is 5×5 cm, the maximum number of moves in each second is 40 cells, the pedestrian speed is supposed to be 1.3 m/s, and its path is parallel to the grid lines (i.e., not diagonal).Hence, the pedestrian should only travel 26 cells per second.The 26 direct moves are randomly distributed among the 40 simulation steps in each second, as shown in Figure 7.The "X" marks show the turns in which a move is performed, whereas the empty cells represent the turns in which no move is performed.
In each step, the total displacement performed (RP), remaining displacement (RR), maximum remaining moves (MM), and maximum moves allowed (MA) are calculated.A binary random decision of the Bernoulli distribution is then used to determine whether a move should be performed in the next simulation step, as shown in Figure 7.By using this method, the desired speed is applied to each pedestrian.
In using Bernoulli distribution to generate random "move-do not move" speed control decisions, the Bernoulli probability must be calculated.The maximum number of remaining moves (MM) is calculated by deducting the moves performed in the current one-second period (n) from the number of run steps or possible moves in a second (T), which is 40 possible moves in a second in our example.
The maximum number of allowed moves (MA) is then calculated by dividing the remaining displacement allowed for the specific pedestrian in the current one-second period (RR) by the size of the cell (C).Notice that no differentiation is made between diagonal and direct moves in the calculation of the maximum number of moves.However, in each step, the total displacement is calculated, and the error arising from this compromise is minimized.On the basis of the number of moves allowed and possible moves, the desired binary decision probability P is calculated as in (14).After calculating the Bernoulli probability, a random number generator with the distribution is used to determine the "move-do not move" decisions in each time step for each pedestrian (15).
~(1, ) Figure 6.Matching speed for a specific density value Figure 7. Random distribution of moves among 40 possible moves in a second

Discretization error
Cellular automata models provide a limited choice of movement in each simulation time step.Each pedestrian can move into one of its eight neighboring cells or stay in its current position.However, the displacement of the pedestrian is different during movement into the four direct neighbors and during movement into the four diagonal neighbors, as shown in Figure 8. Kretz and Schreckenberg [46] discussed the issue of discretization errors in regular cellular automata and its effect on pedestrian speed.They suggested a cell selection method that yields optimal speed values that produce the least error from a desired movement speed.In a previous work [42], a method was proposed to cap the movements of each pedestrian in each second of the simulation if the combination of movements results in a displacement bigger than the free flow speed of the pedestrian.Our speed control method essentially uses the speed cap method.
As described in the previous section, the displacement of each pedestrian is measured in every step, and the speed is adjusted.As a result, the speed error is limited to a maximum of the diagonal size of a cell in each second.The improvement in the accuracy of the fine grid model is due to the use of small movement steps.Given that the displacement in each time step is small, adjusting the displacement in a time unit (i.e., speed) with high accuracy, as shown in Figure 9 is possible.The comparison between the two is illustrated by Figure 9(a), which is the fine grid cellular automata and Figure 9(b), the regular cellular automata.The desired speed of an agent is assumed to be 1.4 m/s.Depending on the cell size and movement direction, the pedestrian could be moved over a specific number of cells.The displacement should be as close to the desired displacement as possible, but it should not exceed such displacement, as shown in Table 1.The error in a fine discretized grid is relatively low.Considering the size of each single move (i.e., jump) in each simulation step on 40×40 cm and 5×5 cm grids, we can deduce that the movements on the finer grid are smoother and more natural.A grid with even smaller cells could produce visual results comparable to those of continuous models.

RESULTS AND DISCUSSIONS
One of the challenges in the use of crowd simulation models, including the cellular automata model in our previous research [42], [45], is the number of adjustable model parameters.Excessive parameters make crowd simulation models complex and difficult to adjust and calibrate.The combination of several parameters creates a huge search space from which values that produce reasonable accuracy in matching the empirical data should be found.
The speed control mechanism of the new model (i.e., the fine grid cellular automata) involves less adjustable parameters because of its self-adjusting nature.The small number of parameters (i.e., the width and length of the perception area) facilitates the investigation of the small space of possible values.The selfadjusting speed control mechanism also helps reach good accuracy in matching the empirical data.

Optimal size of the density perception area
As described previously, the fine grid cellular automata model with adaptive speed control does not involve a large number of parameters for adjustment and calibration.The width and length of the perception area (i.e., the area that each agent uses to measure its perceived density) need to be adjusted.This section attempts to calibrate the fine grid cellular automata to match Weidmann's empirical speed-density graph [47].An optimal size of the density perception area, which minimizes the error of the simulation speed-density graph relative to the desired empirical speed-density graphs, is found.To find the optimum width and length of the perception area, a range of 0.5-3.5 m for both width and length is checked.The range is divided into 0.5 m increments (i.e., 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, and 3.5 m).Therefore, 7×7 combinations of width and length are investigated.For each perception area size, a 2,000 s simulation is run.In the 1207 simulation, the demand starts from 1 pedestrian/s and gradually increases to 7 pedestrians/s.The demand schedule creates a low-density crowd at the beginning of the simulation, but the density reaches 4-5.5 pedestrians/m 2 .The gradual increase in density allows the speed information for different densities to be gathered.The software stores the speed-density pairs gathered for each pedestrian in a specific reporting area (i.e., a less disturbed area used for gathering speed-density data from the simulation).
In considering the randomness of the experiments, the main experiment is repeated five times for each of the 49 sizes of the perception area (i.e., 245 simulation sessions).The results for each run are compared with the Weidmann empirical graph values, and a mean square error (MSE) is calculated for each simulation session.An average MSE (AMSE) is then calculated for the five MSE values obtained from the five repeated experiments.In addition, a standard deviation is calculated for the five MSE values.AMSE indicates the degree of adherence of the simulation results for the specific perception area size to the empirical graph.The standard deviation shows the degree of fluctuation between the five experiments (i.e., the consistency of the results).The intention is to find the perception area with the lowest AMSE and a reasonably low standard deviation.
Figurre 10 shows the error for different perception area sizes with widths of 2, 3, and 3.5 m.For different widths (or lengths), increasing the size of the area initially results in reduced error, but when the area size exceeds 6-7 m 2 , the error starts to increase again.Therefore, the minimum point of error is somewhere between 6 m 2 and 8 m 2 depending on the area width.The length and width of the area are also important.Areas of 3.5 m (L)×2.5 m (W) and 2.5 m (L)×3.5 m (W) both equate to 8.75 m 2 , but the errors they produce are different.In our simulations, a perception area of 3.5 m (L) × 2.5 m (W) produces the least amount of error and causes an acceptably low fluctuation in the results.Figure 10.Error for different perception area sizes (m 2 ) and widths Steffen and Seyfried [48] discussed the measurement of crowd parameters, which includes density calculations.Density measurement that uses the pedestrian/m 2 unit is prone to large fluctuations because the number of pedestrians is a discrete value and increases in steps (rather than in continuous increments, such as that in liquids).In small areas, this variation might be considerably large most of the time.Considering slightly large areas for the density measurement could reduce these fluctuations, as shown in Figure 11.However, considering large areas for density calculations is not always appropriate.If the area is homogenous and covered with almost the same density of pedestrians, then the results would be correct.However, if some parts of the area contain a very dense crowd while other parts are empty, then the calculated density does not represent the status of the area, and any conclusions (e.g., speed-density diagrams) would be incorrect.These effects explain why small areas produce large fluctuations and cause significant errors in the results.

Trade-off between accuracy and simulation speed
Figure 12 provides an insight into the performance of the model.A scenario using 5 and 10 cm grid cells is simulated.The pedestrians are added gradually, and the computing time needed to obtain 1 s of the simulation time is measured.The data for the 5 and 10 cm grid cells exhibit a linear form, and the lines shown in the graph are fitted to the results.The graph clearly shows a trade-off between the selection of small cells (i.e., high accuracy and realistic results) and computation time.Users may select any cell size between 0 and the size of the body of a typical pedestrian (e.g., 40 cm).Although no limit is imposed on the number of pedestrians being simulated, excessive simulation time might result in the impracticality of using large numbers of pedestrians, especially for small grid cells.

Evaluation of the model using speed-density graph
For the experiments, we first use one of the most popular and representative empirical speed-density graphs by Weidmann [47].Note that any empirical graph can also be utilized, as shown in section 3.4.Figure 13 shows the comparison of the fine grid cellular automata simulation results with Weidmann's speed-density data in different densities using a 3.5 m (L)×2.5 m (W) perception area.The simulation model clearly matches the empirical results with good accuracy.Moreover, the simulation graph continues until a density value of 4.25 because such value is the practical density value that could be reached in the simulations of narrow and long walkways.The specific scenario prevents high densities from being reached.High density values may be observed in cases of congestion or in cases in which the output of the system is much lower than the input.The data by Helbing et al. [49] are also tested on the model to show its flexibility.A curve is fitted to Helbing's data and fed to the model.In the new experiment, a 10×10 cm grid is used; thus, a lower accuracy is expected for matching the empirical data.After performing 245 simulations (49 perception area sizes, with each experiment repeated five times), a perception area with a size of 2.5 m (L)×3.0m (W) is found to produce the least amount of error.As pedestrian maps use few cells and perform few calculations, the simulation is considerably faster for a 10 cm grid than for a 5 cm one.However, the experiments show that the error is at least two times larger than that in the previous experiment with Weidmann's graph.This result can be explained by the fact that the 10 cm grid provides lesser fine grain control over speed in comparison with the 5 cm grid and that the coarse discretized speed steps result in high accumulated errors.Therefore, a trade-off is expected between accuracy and simulation speed.Figure 14 compares the simulation speed-density graph with the curve representing Helbing's data.The accuracy is still reasonable, and using a 10 cm grid size for large-scale scenarios that involve large simulation areas and large numbers of pedestrians remains rational.
Figure 15 shows the snapshots of the simulation in low-to high-density crowds.The fine grid cellular automata model is now calibrated to Weidmann's speed-density graph with good accuracy.Considering that the model is calibrated, it can be used to simulate different scenarios in which pedestrians travel between a source and a destination point at different crowd densities.

CONCLUSION
This study attempts to introduce improvements to existing cellular automata crowd simulation methods in terms of accuracy and realistic simulations.A new cellular automata model called fine grid cellular automata is proposed to obtain smooth movements and fine control over the speed of pedestrians and their specifications, such as body size and shape.Small cells provide fine speed value selections while body maps allow different body shapes and sizes.An active speed control method allows the simulations to match the desired empirical speed-density graphs.Furthermore, as pedestrians move in small distances in each simulation step in the proposed model (e.g., 5 cm or less instead of approximately 40 cm in regular cellular automata models), the pedestrian movements seem to be relatively smooth.The results of the evaluation show that the model is capable of matching speed-density empirical data with good accuracy.However, the simulation speed in the proposed model is compromised in favor of higher accuracy in comparison with that in regular cellular automata models.Slightly large cells may be used to improve performance, whereas small cells may be utilized to produce smooth and accurate results.Competition between pedestrians during emergency situations (i.e., evacuation) creates dense crowds at specific parts of a crowd system (e.g., exits).In these situations, specific behaviors, such as pushing, falling, trampling, and friction, can be observed, especially at narrow areas, such as exits.In normal crowd simulations, maintaining a proper speed-density relation is enough for most cases, but in emergency, panicky situations, small-scale interactions between individuals are important as well.Future research will attempt to adapt fine grid cellular automata to evacuation and emergency situations.


ISSN: 2252-8938Int J Artif Intell, Vol.11, No. 4, December 2022: 1197-1212 1200 simplifications that will reduce computational complexity of the model.The new model could replace the conventional cellular automata models to allow more realistic simulations of pedestrian movements.
shows the maps of the four out of the eight orientations.During the simulation, the orientation is identified by using the direction of the target point.One of the cells in the weight center of each map is considered as the center point.Cellular automata transition rules and next cell calculations are applied Int J Artif Intell ISSN: 2252-8938  Simulation of pedestrian movements using a fine grid cellular automata model (Siamak Sarmady) 1201 to the center point.Other map cells are moved along with the center point.Collision avoidance is completed for all map cells.None of the map cells can overlap the map cells of other pedestrians.

ISSN: 2252- 8938 
Simulation of pedestrian movements using a fine grid cellular automata model (SiamakSarmady)

Figure 11 .Figure 12 .
Figure 11.Fluctuation in density value caused by the entry of one pedestrian into the area

1209 Figure 13 .
Figure 13.Comparing the fine grid simulation results with Weidmann's empirical speed-density graph

Table 1 .
Discretization error in regular and fine grid cellular automata