From dawn to dusk: daily fluctuations in pedestrian traffic in the city center

Pedestrian traffic in a city is subject to fluctuations throughout the day due to a variety of factors. The understanding of these variations can be achieved using properly calibrated agent-based simulation models that capture the dynamics of pedestrian movement. However, despite their significance, such models are currently underrepresented in scientific discussions. In addition, acquiring real-world pedestrian localization data for model calibration poses challenges. To address these issues, this paper presents an agent-based model specifically designed to examine pedestrian traffic fluctuations at a mesoscale level. The model uses popular times data from the Google Places service and population data from the Geographic Information System (GIS) for accurate calibration. As a result, it effectively captures the real-world dynamics of pedestrian movement in the city center. By harnessing the advantages of agent-based modeling (ABM), the model generates several valuable insights into daily pedestrian traffic. It estimates the capacity and speed of pedestrian flows and determines the daily load within the simulated area. Moreover, it enables the identification of bottlenecks and areas characterized by varying levels of pedestrian density. The model’s validation process involves comparing its output with empirical studies and pedestrian traffic data from selected points of interest (POIs). The model successfully captures key aspects associated with fundamental diagrams of pedestrian flow. Furthermore, the dynamics of pedestrians closely align with Google Places popular times data for the chosen POIs. Overall, this research contributes to advancing pedestrian traffic management and optimizing public transport organization by employing empirically calibrated agent-based simulation models.


Introduction
Friendly open spaces may encourage people to walk, 1 thus helping to deal with several urban concerns such as congestion, 2 pollution, 3 population health, 4 or even the social capital level. 5It is also easy to notice that pedestrian traffic fluctuates significantly during the daytime.These fluctuations depend mainly on the specificity of a given place, time, and day of the week, e.g., fluctuations in transportation hubs in cities are generated by commuters during working days (e.g., Deal et al. 6 Yang, 7 and Ren et al. 8 ), fluctuations in city centers may be associated with inhabitants running their errands, commuters (e.g., Gorrini et al. 9 ), or tourists. 10,11Therefore, the investigation of these ''waves'' may be an important element of improving pedestrians' well-being and safety in open spaces.
Batty et al. 12 has already suggested that properly calibrated simulation models of pedestrian dynamics could help in management of walkable environments or identify the potential barriers and threads inside the existing urban fabric.In this regard, Kim et al. 13 underline that data are key components in finding a calibrated set of parameters to replicate real-world observations; however, simulation models are often adjusted on the basis of an arbitrary set of parameters, which may decrease the robustness of output. 10,11arious methods can be employed to gather data on pedestrian behavior, including field observation, experiments, surveys, and dedicated apps (e.g., Feng et al. 14 ).However, these approaches come with challenges such as high costs, privacy concerns, and ethical issues. 15,16An alternative data source could be mobile phones or social media, which collect large amounts of instant localization data.Nonetheless, accessing such data are nearly impossible due to the aforementioned issues and corporations' reluctance to share even aggregated data sets because of their perceived value and sensitivity (see Tomasin et al. 17 for an overview of the problem or Rajpurohit et al. 18 for a case study on Facebook and WhatsApp).
Furthermore, most models of pedestrian behavior are microscopic models that focus on intricate details of pedestrian movements (e.g., communication, emotions, panic) and small-scale applications (e.g., room evacuations, cross roads, corridors analysis). 19While this approach enhances low-level realism, it also increases computational demands and hinders the analysis of other aspects of pedestrian dynamics.Consequently, there is a research gap when it comes to understanding more general or larger scenarios such as the cyclical dynamics of pedestrian traffic.
In our papers, we tackle these challenges by developing a pedestrian model that can replicate large-scale fluctuations in pedestrian traffic in the large city center.This model strikes a balance by capturing the dynamics of a large number of pedestrians while also considering microlevel interactions between agents.To calibrate the model, we propose using pedestrian traffic parameters based on Google Places (GP) popular times data obtained from the Google Maps service.In addition, we accurately represent the outdoor environment and population density using Geographic Information System (GIS) and census data, respectively.To evaluate the effectiveness of this approach, we employ empirical data on pedestrian traffic from selected points of interest (POIs) as well as existing scientific contributions.
By integrating different data sources and addressing the limitations of the existing models, our paper contribute to a better understanding of pedestrian dynamics in urban areas and provide valuable insights for managing pedestrian traffic.Mainly, the model captures capacity and speed of pedestrian flows together with bottlenecks and high/low density zones.As a consequence, it determines the daily load of pedestrian traffic in a simulated area.

Literature review: agent-based modeling applied in an outdoor environment
1][22] Macroscopic models utilize differential equations to capture pedestrian dynamics, while micro-and mesoscopic models focus on agent interactions and their environment.The micro-and mesoscopic approaches have gained prominence in pedestrian research, offering a deeper understanding of pedestrian behavior. 23With advancements in computational efficiency and software capabilities, these models have become more prevalent in empirical research.Early computational microscopic models were based on social forces, with seminal work by Helbing and Molnar 24 and subsequent enhancements by other researchers (e.g.Kang et al. 25 and Zhou et al. 26 ).
In terms of the built environment, Johansson et al. 27 developed a social force model calibrated using video recordings and tracking software, specifically focusing on the Jamaraat Bridge scenario with large-scale pedestrian dynamics.The model successfully reproduced highdensity and pressure zones around the circular basins on the bridge.Torrens 28 presents an alternative approach based on behavioral geography and agent automata.While the paper primarily focuses on methodological advancements, it also showcases high-density walking scenarios in a streetscape environment, highlighting complex crowd patterns such as temporary and long-lasting lane formation or buffered space around assertive walkers.Both papers provide specific applications of their frameworks, but adapting them to more natural situations may require further research and development.Crooks et al. 29 present a data-driven general pedestrian model in an outdoor environment.They extract pedestrian trajectories from a video surveillance system to calibrate the model and enhance its predicting capabilities.The mechanics of pedestrian behavior is based on a gradient approach-a simple method by way of which realistic patterns of pedestrian movement can be produced.The model replicates pedestrian trajectories in the center of Edinburgh with high accuracy.The work of Gorrini et al. 9 is also based on empirical observation of crowd density on video images.The density level was estimated on the basis of camera images by counting the number of pedestrians over a given period of time.The researchers identified some repeated fluctuations in pedestrian movement that were related to public transport services and periodic arrivals of vehicles.While the former contribution is based on sensitive data from a videosurveillance system, the latter presents only some observations without an example of application.Hussein and Sayed 30 developed a microscopic agent-based model of pedestrian behavior in the crossroads at the Oakland downtown.The authors studied several low-level interactions between agents such as following, passing maneuvers, group formation, etc.The validation results show a high precision of the model in terms of the accuracy (between 80% and 100%) of the produced trajectories and the ability to reproduce pedestrian behavior, although model lacks interactions with other users of the road (drivers, cyclists).The study by Knura 31 shows useful but an oversimplified approach of modeling pedestrian dynamics in an open environment.The author presents a networkbased approach to wayfinding and navigating.On the basis of Open Street Map data, the network of lines is created, Simulation: Transactions of the Society for Modeling and Simulation International 100 (3)     which determines the shortest paths.By contrast, Puusepp et al. 32 underline that it is difficult to reduce pedestrian traffic to a network of paths as represented in graph-based approaches because human walking behavior can be much more unpredictable.
Among the most recent studies, Filomena et al. 33 developed a region-based route choice model.The authors claim that some features such as parks or water bodies together with urban subdivisions impact route choice decisions of pedestrians.The work is based on accurate theoretical foundations; the model, however, is not calibrated and validated accurately.Further work of Filomena and Verstegen 34 introduced some enhancement of this approach-a pedestrian model based on the landmarks, which they define as relevant elements of urban architecture.In the model, the wayfinding procedure is compared across models with and without landmarks.The general results show that introducing landmarks increased the model ability to replicate human walking behavior.The developed model could be enriched with a more general concept of landmarks (e.g.rivers, parks).Almahmood and Skov-Petersen 35 present an alternative approach.They investigate the potential of agent-based modeling (ABM) and artificial intelligence (AI) from computer games.The authors consider three types of agents' behavior: goaloriented behavior, browsing behavior, and social behavior.Their study suggests that the conjunction of ABM with game technology may lead to powerful possibilities of exploring social life in urban spaces.The major drawbacks are lack of interactions between agents as well as movement patterns that rely on the data obtained from one day in the year.The study by Paciorek et al. 36 presents a microscopic model of pedestrian traffic in an urban environment, focusing specifically on the transmission of the severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) virus.The model incorporates violations of pandemic restrictions, primarily social distancing, and considers fluctuations in pedestrian behavior associated with commuting.The volume of pedestrian traffic is estimated based on observations and photo images.The model successfully reproduces variations in pedestrian traffic, but it is computationally demanding.The validation procedure relies on comparing model outputs with photos at specific locations, which may be considered insufficient.Asriana, 37 on the contrary, introduces an agent-based model that focuses on tourists' pedestrian behavior in a historic city center.Pedestrians in this model have a two-stage destination that is a temporary and final destination.The author demonstrates that pedestrian movement is influenced by various attractors, which describe the density level of pedestrian activity in the tourist area.While the paper presents an interesting application, there is a limited effort put into both validating and calibrating the model using empirical data.
Current studies presenting a microscopic approach often focus rather on specific indoor applications, which, along with complex and uncertain calibration processes, limit the framework's applicability. 38,39Other contributions in this area typically concentrate on the mechanics of pedestrian movement with specific improvements such as transmission of emotions, 40 kinematic contact, 41 bottlenecks study, 42,43 evacuation scenarios, 44 or disease spread. 45It is often mentioned that such models are computationally expensive and overly represented in pedestrian research (e.g., Tordeux et al. 19 ).
By contrast, the papers exploring a mesoscopic approach are much less frequent than those investigating a microscopic one, and oriented mostly toward outdoor applications.The contributions started with the works of Batty et al. 12 and Jiang. 46Batty et al. 12 present a cellular automata pedestrian model of the Wolverhampton Town Center, examining various simulation scenarios whereby changes in spatial geometry can influence pedestrian behavior.Subsequently, Jiang 46 develops an agent-based pedestrian model, featuring 21 streets and popular sites (church, hotel, school, etc.).These early studies demonstrate coherent patterns in pedestrian behavior but lack interactions and incorporate simplistic assumptions about agent behavior.Further applications of pedestrian models can be found in the study by Maeda et al., 47 where a model of pedestrian flow presents geographic points and streets as nodes and edges.Pedestrians are grouped and represented using fluid terms, enabling the simulation and measurement of pedestrian density across streets for wireless networking purposes in downtown Osaka.Although this model employs a unique calibration approach, the representation of pedestrians in fluid terms aligns it more closely with macroscopic models, making it impossible to identify the exact location of individual agents.Among the recent contributions that have strictly developed mesoscopic models of pedestrian behavior, a study of Tordeux et al. 19 is a good example.The authors propose the approach that is described by aggregate density-flow relationships.They calibrate the model with empirical data and carry out several numerical experiments to present key properties of the model and possible applications for the simulation of large-scale scenarios, which are usually beyond the reach of microscopic models.While the model is inventive, it is also quite close to the macroscopic one whereby pedestrian dynamics is based on flows.
In the realm of urban modeling, Batty 48 has emphasized the ongoing need for accurately modeling and predicting pedestrian movement in outdoor city environments.However, there have been limited attempts to address this challenge.Despite years of research, there is still a gap in utilizing ABM to evaluate pedestrian movement in largescale scenarios within built environments.Existing studies have primarily focused on specific applications, such as street crossing, crowd behavior, or navigation issues.
Consequently, there is a lack of thorough examination of daily fluctuations in pedestrian traffic within the center of a large city using ABM.This is the gap our paper aims to fill.
Table 1 provides a comprehensive overview of previous research (both micro-and mesoscopic) focused on simulating pedestrian behavior in outdoor environments, relevant to this study.Nevertheless, the study closely aligns with most aspects of Crooks et al. 29 regarding pedestrian movement mechanics, and Knura 31 in terms of the concept of gates through which agents enter the simulation.

GP as a proxy for the volume of pedestrian traffic
GP is a service provided by Google as part of Google Maps, offering users access to a vast amount of rich place Table 1.The synthetic review of pedestrian models in an outdoor environment.

Authors Main assumptions/approach
Outdoor environment/limitations Batty et al. 12 Pedestrian system based on cellular automata approach Wolverhampton Town Center/ limited interactions and low heterogeneity of agents in terms of behavior and spatial response Jiang 46 Model bases on space syntax Hypothetical urban system containing 21 streets and buildings such as schools, churches, shops, etc./lack of (global) interactions; arguable ''vision'' parameter Maeda et al. 47 Generate scenario called urban pedestrian flow/ multiple pedestrian groups with similar behavior patterns Real 500 m × 500 m region including buildings in downtown Osaka city/pedestrians are modeled as ''aggregate flows'' Johansson et al. 27 Social force model calibrated with evolutionary optimization algorithm to determine optimal parameter specifications Jamaraat Bridge-pedestrian bridge in Mina, Saudi Arabia/very specific outdoor scenario Torrens 28 Behavioral fidelity, dimensionality, analytical finesse, dynamic user experience, multi-spatial representation, dynamic information scaling, spatial extensibility, and efficient computing Realistic urban environment: synthetic downtown setting with sidewalks, roads, and road crossings/presentation of general methodology rather than specific real-life case Crooks et al. 29 Use real scene mobility information to improve performance and accuracy of pedestrian ABM Open space in center of Edinburgh/sensitive and hard-to-access data used for calibration Tordeux et al. 19 Mesoscale pedestrian model/pedestrian movements described with aggregate density-flow relationships One of real-world scenarios involving Indonesian city of Padang: area of 7 km × 4 km/no interaction between agents; closer to macroapproach with aggregate flow rates of agents Hussein and Sayed 30 Microscopic model calibrated with data extracted from real pedestrian trajectories Signalized intersection in Oakland, California (four conventional crosswalks in addition to two diagonal crosswalks)/very small area; lacks interaction with other road users Knura 31 ABM model based on social forces concept with urban environments represented by GIS Inner city of Hamburg, Germany/insufficient details on model mechanics and calibration Filomena et al. 33 ABM of pedestrian movement deriving from perception of regions and barriers in pedestrian navigation Central region of Greater London area (8 km × 8 km) and Me ´tropole du Grand Paris/fixed knowledge of agents; absence of calibration and validation with empirical data Almahmood and Skov-Petersen 35

ABM and artificial intelligence in computer game technology to develop interactive pedestrian simulation
Virtual environment of Torvehallerne and surrounding area, Copenhagen, Denmark/lacks interaction between agents; based on nonrepresentative data Filomena and Verstegen 34 ABM of pedestrian movement that incorporates role of on-route and distant landmarks in agents' route choice behavior City center of London (United Kingdom), delimited by Congestion Charge Zone/concept of landmarks could be wider Asriana 37 Study develops a design strategy for urban pedestrian behavior using ABM.It aims at improving the planning and design of urban spaces Historic city of Palembang, South Sumatra classified into four zoning activities/ arbitrary calibration procedure; no validation Paciorek et al. 36 Scalable microscopic simulation model with HPC application/route selection based on signal propagation through grid One of housing estate in Cracow, Poland with population density over 90 persons/ha and dimensions 800 m × 960 m/very limited validation of model output data for over 200 million POIs. 49This service provides various features, including geocoding that converts addresses into geocoordinates, as well as access to photos and detailed information about specific places.One of the notable features of GP is the availability of place details.This feature offers a range of characteristics related to a place, such as ratings, addresses, opening hours, and popular times (including traffic data).The popular times feature displays traffic data in the form of an hourly bar chart, providing an estimate of the crowd levels at a particular place.The traffic data are derived from the localization information of mobile devices, making it relatively accurate.
For the purposes of a case study, the Old Market Square in Poznan ´, Poland, along with its surrounding historic streets, was selected as a simulation area.The Old Market Square is a regular square with each side measuring 140 m.It is located in the center of a network of streets that intersect at right angles.The area attracts both tourists interested in exploring historical sites and locals who visit the place for daily errands or to enjoy a cafe ´.The Old Market Square is easily identifiable on Google Maps and has its dedicated GP service, providing detailed information and insights about the location (see Figure 1).To approximate pedestrian traffic in the area with the simulation model, the popular times data from GP were used.
GP provides application programming interface (API) for basic data, the available requests include also pedestrian traffic data (popular times).To extract popularity scores, we used recent R populartimes package by Parry. 50opulartimes provides access to the GP nearby and detail API endpoints.It also retrieves popular time data, if available and requested.The data come with a predefined scale from 0 to 100, where 0 means the lowest pedestrian traffic and 100 means the largest traffic.Figure 2 presents pedestrian traffic in the Old Market Square for 7 days of the week and 24 h starting from morning.
According to GP, maximal values of pedestrian traffic are observed on Sunday and Saturday between 12 p.m. and 1 p.m.These time data correspond to traffic density equal to 100.On the contrary, minimum values are observed in early mornings on Friday and Saturday, which corresponds to close to zero values.The estimates are based on average popularity of the place; however, Google does not include the information on the real number of pedestrians that is associated with specific time (https://support.google.com/business/answer/6263531?hl = en).Therefore, we had to associate the values from Google popular times scale with the specific numbers of pedestrians.We used census data on the number of inhabitants of the Old Town quarter obtained from the Web Map Service of the Poznan ´City Hall (The WMS server is available at: http://sip.geopoz.pl/sip/uslugi/get_uslugi_lay/.The data are official statistical data collected during national census).The Old Town quarter is inhabited by 1421 citizens in total.As our simulation sandbox covers two-third of the area, we assumed that the maximum value for pedestrian traffic is 1000 persons, which is an approximation.Not all inhabitants are on ´.Source: Google Maps. the streets at the same time, but one has to include also some number of tourists or pedestrians from other quarters or districts.However, more accurate data on this issue are unavailable.
The precise values for the number of pedestrians were adjusted according to the scale from GP (0-100).These values are assumed to be maximal values of pedestrian traffic, i.e., the number of pedestrians can be lower but it should not exceed the threshold values.However, the model has both stochasticity as well as inertia, thus, slight deviations from the threshold numbers are possible, which in fact is closer to real live conditions.For convenience, in the first interval, we assumed the maximum number of pedestrians to be 10.In this case, there is a possible situation with 0 pedestrians in the simulation; however, it should not be (much) more than 10 of them (see Table 2).

The model of pedestrian traffic 4.1. General assumptions and sandbox details
We consider recreational and touristic walking patterns during non-working days (Sunday); commuting, shopping, running errands, etc. are skipped due to the specificity of pedestrian dynamics during this day.We chose Sunday because the day is characterized by a whole range of pedestrian traffic values (from minimal values observed in the early morning to maximal values observed about noon).We assume that Sunday is an average Sunday, with common weather conditions and no unpredictable events that may disturb regular traffic.
The general mechanics of agents' movement rests on the gradient method described by Dietrich and Ko ¨ster 51 and used by Crooks et al. 29 We also drew on our previous works. 52,53This approach assumes that each agent is seeking one destination point.The closer the agent is to the point, the stronger he or she is attracted by it.In this case, these POIs are shops, cafes, museums, or other amenities available in the Old Town area.
The agents are born in the entry points.The higher the pedestrian traffic declared by GP data, the higher the probability of creating new pedestrians.Similarly, if the agents want to exit the simulation, they randomly select one of the exit points and navigate to it.If they reach the point, they permanently leave the sandbox.The concept is similar to the gateways described by Knura 31 or Filomena et al. 33 However, we did not associate probability values with entry/exit points as in the study of Crooks et al. 29 In the model, the gateways are situated in the locations linked to

Controlling for time and traffic
Each side of the simulation box has 201 equal patches.Thus, the total area is 40,401 patches.The length of a single patch corresponds to 2.25 m (450 m is 200 patches).On the basis of a single patch length, the preferred speed of agents was adjusted to one patch per tick.It means that during each simulation step (tick), the agent can traverse a maximum of one patch (2.25 m).
The preferred human pace during walking activity is ~1.4 m/s (~5 km/h; The preferred walking speed is the speed at which humans or animals choose to walk.According to research, many people tend to walk at about 1.4 m/s; Mohler et al. 54 ).Therefore, to traverse 2.25 m (one patch) at the preferred speed human needs 1.6 s.Combining it with one simulation step means that it covers ~1.6 s of the real time as the agent traverse 2.25 m/tick.Therefore, 1000 ticks are comparable with 1600 s (26 min).A total of 2250 ticks are approximately 1 h.
Agents may roam the space with lower speed according to the principles of navigation described in the next subsection.We used excellent NetLogo time extension by Collin Shepard (The extension and Quick Start Guide are available at: https://github.com/colinsheppard/time)to set and manage the exact daytime in the simulation.According to the previous derivation, the value of 1.6 s was anchored to one simulation tick.The simulation starts on Sunday at 4 a.m., ends on Monday at 4 a.m., and covers 24 h, which makes up 54,000 ticks in the simulation sandbox.
The number of pedestrians in the simulation evolves according to agent creation and agent destruction conditions.The births of new pedestrians are possible only at the entry points and take place with an endogenous creation formula.If the number of agents is lower than the threshold value provided by GP data, the given number of agents (This number is drawn at random from 1 to 10 interval) is created with the probability equal to (However, if the number of agents is higher than the threshold provided by GP, parameter a switches to a/2, and if it is lower, a turns to a 3 2) as follows: Therefore, the l strongly depends on the total number of agents in the simulation (N) and parameter a.As the number of agents rises, the probability also rises.Parameter a dynamically changes during the daytime and depends on an hour.The more agents in the simulation, the smaller the parameter a is to keep l in a reasonable threshold.Consequently, the birth or the creation rate of agents g is as follows: where n is the inflow of new agents to the simulation.Consequently, the agents leave the simulation when they locate the target and then complete the route to the chosen exit point.Each agent decides which exit to choose and how to navigate to it, therefore the pedestrians disappear with some endogenous rate d as follows: where d is the number of agents leaving simulation.The system is in the equilibrium if the condition g t = d t is fulfilled.However, such situations may be momentary as the simulation constantly evolves according to the actual state and conditions 1-3.If g t .d t , the number of agents rises.If g t \ d t , the number of pedestrians decreases.From this perspective, the proper choice of value of parameter a is the key element of providing reasonable fluctuations in pedestrian movements as well as the accurate number of agents roaming the Old Market Square.The parameter values were adjusted according to the grid-search procedure.We carried out multiple repetitions of the simulation to find proper a values that kept the number of agents in a range provided by GP data.In Table 3, we included the values of parameter a for a given traffic size and hour.

Principles of navigating
The navigation is made as easy as possible.Artificial pedestrians regulate speed and distance from other agents.They avoid collisions by choosing the patches that are not settled by other agents.Each pedestrian starts the simulation with speed = 1 patch/tick (1.4 m/s or 5 km/h), then speed evolves according to the behavioral rules described below.Agents, however, tend to travel at the preferred speed of 5 km/h, which, by assumption, cannot be exceeded.There is also a lower speed threshold which we set at 0.2 patch/tick.It means that speed cannot fall below 0.3 m/s (1 km/h), which can be considered as a very slow walk.Figure 4 presents three main principles of interactions with other pedestrians.Principle A of collision avoidance says that each agent has a vision distance = two patches in his or her moving direction.If the agent identifies another pedestrian coming from the opposite direction, he or she turns randomly by 15°.However, under heavy traffic, if principle A cannot be fulfilled the agent just choose the nearest patch at an angle of 180°, which is free (principle B).Principle C says that agents dynamically adjust the pace to other pedestrians that move in the same direction.
If other walkers are too close, the agent adjusts speed to the speed of the nearest pedestrian and slows down to maintain the distance.
Each agent choses the route on the basis of the calculation of patch values (m).These values are calculated according to the formula as follows: where s is the value of a destination patch; d is the distance in patches from the destination; u is a random parameter whose values are drawn for each agent from normal distribution with a given mean and standard deviation every 40 ticks (If the drawn number is lower than 0, then the value is set at 0. In this special case, the value of all patches is equal for the agent, and he or she randomly roams the space until the next drawing changes the value).However, if one of the walkable patches shares at least one border with a building or other obstacles, the value of such a patch is diminished by exogenous discount rate r according to the formula as follows: To decrease the computational demand of the model, the agents calculate values of patches only in a given range ahead.Mainly, during each simulation step, the pedestrian calculates values for six patches, which are in front of him or her.Assuming s = 20, u = 2 and r = 0:5, the calculation of values of patches for a given target would look like as shown in Figure 5.

Calibration
Apart from the job creation rate that relies on l and the value of pedestrian traffic parameter (a), the model consists of some other inputs that affect walking decisions.
The number of parameters is rather small, as we present a mesoscopic perspective and avoid some low-level pedestrians' interactions.
The next important parameter is u that governs the decisions about assigning values to patches.u diminishes the attractiveness of patch by some fixed value depending on the distance.Therefore, it should be set somewhere between 0 and 1 interval.If u is 0, all patches have equal values and the agents walk at random.If gravity is equal to 1, the attractiveness of patch is diminished by the full distance to the destination.Thus, normal distribution with mean equal to 0.1 and standard deviation equal to 0.1 were chosen to sampling gravity for each agent.The individual differences in u reflect different walking strategies as the parameter directly impacts walking behavior (lower values of gravity are associated with recreational, unhurried walk; higher values are associated with rush to the target).According to Open Street Maps, there are 60 pubs and restaurants as well as 43 shops of different kinds in the Old Market Square.Consequently, the number of targets for agents was set at 100.The list of all parameters included in the model with benchmark values is presented in Table 4.

Benchmark simulations
The simulations were performed in NetLogo 6.0.4 and R 4.1.0together with RNetLogo 1.0-4 extension. 55As was mentioned earlier, we also used NetLogo time extension 56 to manage time in simulation and NetLogo GIS extension 57,58 to set up and manage a GIS environment (Shapefiles were prepared with QGIS3 and OSM plugins).Figure 6 presents a cross-correlation plot for the major model outputs that we analyze and assess in the further steps of the research procedure.The average speed in the simulation was 0.83 patch/tick (4.17 km/h).The higher the number of agents, the lower the speed (significant dependency is observed through the correlation score and scatterplot).This negative relationship has been confirmed in several empirical studies (Pinna and Murrau 59 ).Speed also falls together with increased agents' inflow and time that agents spent in the simulation.The average time spent   in the simulation was 11 min; the minimum time was less than a minute and the maximum time was about 62 min.The mean number of pedestrians is reported to be 249, with a minimum value of 0 and a maximum value of 1008.This indicates a significant variation in pedestrian presence during different time periods.It is worth noting that the model demonstrates a positive relationship between the number of pedestrians and travel time or the flow of agents, which aligns with findings from empirical research, such as the study conducted by Tipakornkiat et al. 60 The boxplots in Figure 7 provide a visual representation of the distribution of pedestrian agents across different hours.They offer insights into the variability and trends in pedestrian traffic throughout the day.
The model captures the complex mechanisms behind the immediate changes in pedestrian quantities, whereas GP data primarily reflects the intensity of pedestrian traffic.The maximum number of agents is observed between 12 p.m. and 1 p.m., with the peak closer to 1 p.m. due to the time it takes for the area to fill with agents.As the number of pedestrians increases, the inertia of the crowd rises, leading to longer adjustment times for the model.This is influenced by the limited capacity of the area and the location of entry/exit points, which pose challenges for route finding as bidirectional flows intensify.
Figure 8 displays pedestrian trajectories and densities during selected hours, showing significant variations in the number of pedestrians.Between 8 and 9 a.m., the pedestrian count remains below approximately 50, increasing to around 75 between 9 and 10 a.m.A significant rise to approximately 250 pedestrians occurs between 10 and 11 a.m., with a peak of around 1000 pedestrians between 12 and 1 p.m.After 2 p.m., the number gradually decreases to a maximum of around 600, stabilizing at approximately 450 pedestrians around 5 p.m.These findings demonstrate the model's ability to capture the complex dynamics and fluctuations in pedestrian numbers throughout the day in the city center, providing deeper insights into pedestrian behavior than GP data alone.
During Sunday morning (8-11 a.m.), popular pedestrian routes are observed from the southern to the northern part of the area.The historic streets in the southern and eastern areas experience increased pedestrian density.The highest density of pedestrian traffic occurs between 12 and 1 p.m., particularly in the streets leading to transportation and parking facilities located in the bottom left and upper right quarters of the simulation area.During peak hours, congestion zones shift from the historic streets to areas where pedestrians are entering or leaving the Old Market Square and navigating through narrow surrounding streets.This phenomenon represents a bottleneck scenario in the outdoor environment with natural obstacles, confirming observations from empirical studies such as Campanella et al. 61 or Luo et al. 62 Figure 9 illustrates the speed and density in specific quarters of the simulation area, providing further insights into the dynamics of pedestrian flow.
The quarter with the highest speed (Q1) also exhibits the lowest density of agents.This can be attributed to the relatively small area covered by historic streets in Q1, along with the greater distance between entry/exit points.On the contrary, the quarter with the highest density (Q3) is associated with slower speeds, as indicated by the heatmaps in Figure 8. Q3 experiences increased density because of two entry/exit points located in close proximity, resulting in agents choosing a common route and creating a bottleneck.Q2, characterized by the second slowest speeds, may be influenced by both the larger area covered by historic streets and the presence of three entry/exit points in this quarter.Q4 also exhibits low density and high speed, which can be attributed to having only one entry/exit point located in this quarter.Figure 10 provides additional insights through line plots of birth and death rates of pedestrians (lambda) per minute, as well as a bar plot showing the inflow of new agents.The birth and death rates drop as the probability of agents creation (l) rises; both rates also highly depend on the number of agents in the simulation as well as the number of agents entering and leaving the sandbox, while l evolves together with hourly adjusted parameter a.These rates are lower for the hours with the higher number of pedestrians and higher if the number of simulated pedestrians decreases (As both rates are the result of division by the number of agents in the simulation area, they drop together with the increased traffic).It can be also observed that these indicators share a common trend and similar values.This means that if the number of agents entering the simulation is large, also the number of agents leaving the simulation is large (and vice versa).The probability of agents' creation rises during the most popular hours of the day to fulfill the traffic intensity conditions provided by GP data.The inflow of new agents per minute is highly cyclical.Despite the generation of the day trend, the inflow fluctuates significantly over minutes.Usually the minutes with a lower inflow are followed by the minutes with a higher inflow.This phenomenon could be interpreted as pedestrian waves resulted from the public transportation arrivals as described by Gorrini et al. 9 Then, in Figure 11, we present inflow of agents in the Old Market square per hour together with the cumulative sum of pedestrians during the daytime.
The total average capacity of the area on Sunday was about 28,000 agents (there are, however, simulation runs with lower and higher capacities as shown by error bars).The highest inflow of new pedestrians was observed  Figure 10.Probability of the creation, birth and death rates of agents together with an inflow of agents per minute.Birth rate is the number of new turtles in simulation/minute/the total number of turtles; death rate is the number of turtles leaving the simulation/minute/total number of turtles; the red line is a LOESS regression curve for highly volatile time-series; reported values make up the average of 10 simulations.
facilities on Sunday could be expected between 10 a.m. and 1 p.m.; however, an intensified pedestrian flow may be observed up to 7 p.m.-8 p.m. Finally, Figure 12 plots the average speed of agents and time they spent in the simulation.
The agents travel around the preferred speed up to 10 a.m.Then, because of increased density, they reduce their speed by 20%-30%.The lowest average speed is observed between 11 a.m. and 4 p.m.It is connected with higher pedestrians' density that intensifies before midday and lasts till afternoon.In addition, the average speed drops fast between 250 and 800 agents; however, the further increase in the number of agents does not impact the speed so significantly.The mean speed during the daytime was 3.96 km/h (1.1 m/s) with the standard deviation equal to 1.12 km/h (0.31 m/s).The larger standard deviation means larger diversity of individual speeds.The standard deviation drops during peak hours and is higher for neighboring time periods that have larger differences in the number of pedestrians, e.g., transition from 250 to 800 agents (10-11 a.m.) is associated with the highest standard deviation.It may be the result of intensified pedestrian flows that increase speed heterogeneity as noted by Yang et al. 63 During the peak hours, agents spend the longest time in the simulation (up to 25 min) but the mean value is about 11 min (with the standard deviation equal to 5.8 min).The empirically measured time to cross the simulation area from the northern to the southern exit point was about 5 min.According to GP, people spent up to 30 min at the Old Market Square.

Model validation
In this study, the validation method used is limited by the availability of real-life data, but still meets the requirements established during the model creation process.The validation process involves comparing the model output with the existing empirical contributions on pedestrian  traffic as well as data obtained from GP.To evaluate the model's performance, we selected four different POIs located in the Old Market Square and the surrounding streets.These POIs include the Old Market Square (in general), the Poznan ´Museum (Detailed coordinates for Town hall Poznan museum: 52.40926746157, 16.9341414883), the Chocolate Cafe ´(Detailed coordinates for Chocolate Cafe ´(orig.Cafe ´Czekolada): 52.40898679634, 16.9339130928), and one of the groceries' stores (Detailed coordinates for _ Zabka grocery store: 52.40741166852, 16.9342671056).However, it should be noted that these places have different opening hours, which means we could only evaluate the pedestrian traffic during specific periods when the data were available.
Figure 13 presents the mean value of pedestrian traffic generated by the model compared to the data obtained from the popular times rank at the specific POIs.This comparison makes it possible to assess how well the model aligns with the observed pedestrian traffic patterns at these locations.
The model replicates the general dynamics of pedestrian traffic at all selected places; however, there are some significant differences regarding the precision of the replication.The best accuracy is kept at the Old Market Square (as the average traffic around the square), good results was also obtained for Poznan museum, which is located at the Old Market Square.Less accurate estimations were observed at Cafe Czekolada and the grocery store that are located outside the central place at the historic streets surrounding the market.Table 5 presents model prediction errors at the selected POIs.
In order to validate the model, we also conducted a comparison between the model-generated outputs and previous empirical works.One key aspect we examined was the relationship between pedestrian density and speed, which has been investigated by Virkler and Elayadath 64 using seven different models.They found a significant negative correlation between these two variables, and our model confirms this finding, with a correlation coefficient of -0.96 (see Figure 6).This dependency is consistent with the results of Nikolic ´et al. 65 and aligns with fundamental diagrams of pedestrian flows as observed in studies by Campanella et al., 66 and Vanumu et al. 67 During rush hours, we identified two significant bottlenecks occurring in the areas connecting the Old Market Square and the narrow historic streets.These bottlenecks   6 presents a comparison between the results of these studies and our model output.

Conclusion and discussion
In this paper, we developed an agent-based model to simulate pedestrian fluctuations in the city center.We calibrated parameters related to pedestrian traffic and density using data from GP popular times and Geographic Information Systems (Web Map Service).The simulation area was accurately represented using GIS data, and we paid close attention to time and speed as key elements of the simulation approach.We aimed to bridge the gap between utilizing ABM and evaluation of pedestrian movement within built environments.Especially, we focused on properties of daily fluctuations in pedestrian traffic, which have not yet been thoroughly examined within the framework of ABM.
The model's ability to generate intricate pedestrian flow patterns offers valuable insights into pedestrian dynamics.It provides practical information for effective pedestrian traffic management in the city.Key findings include estimating the daily pedestrian capacity of the area, determining the size and speed of pedestrian inflow and outflow, and identifying ''waves'' of irregular pedestrian movement characterized by periods of high inflow followed by reduced outflow.These irregularities may be linked to factors such as public transport schedules, and result from the model's creation and destruction conditions.By considering these factors, the model aids in developing strategies for optimizing pedestrian traffic management and enhancing overall urban mobility.
The model effectively identifies lower and higher speed zones.The lower speed zones occur in transition areas between the Old Market Square and the historic streets, where pedestrian density increases.These areas experience bottleneck scenarios due to bidirectional flows, as pedestrians entering the Old Market Square have to navigate through the departing crowd.Furthermore, the presence of tram/bus stops and parking areas, represented as entry/exit points, can contribute to high-density zones and mobility challenges, particularly when these locations are in close  proximity to each other.On the contrary, quarters with less frequent and more distant entry/exit points exhibit lower pedestrian density and higher average speeds.The model's ability to identify these variations in density and speed supports understanding and managing pedestrian mobility issues in different areas of the city (different spatial context).We validated the model using existing empirical studies and GP popular times data for four selected POI in the Old Market Square and the surrounding historic streets.We also compared the model-generated fundamental diagrams of pedestrian flow with empirical studies conducted in outdoor environments, finding close alignment in several cases.
In conclusion, the model replicates certain patterns of pedestrian dynamics and offers new possibilities for studying pedestrian fluctuations.This approach has practical implications for managing public transport and pedestrian traffic.The model is quite simple and computationally efficient, as we were able to generate results in a reasonable time frame using average class PC.However, it has also limitations.First, it relies on historical data, which means stochastic changes in pedestrian flows may be limited and not reflect actual current conditions.In addition, we lacked real-time information about the number of people walking in the study area but living outside of it.The model's mechanics also assume basic locomotion principles without accounting for group formation or other types of social interactions, which could be avenues for further investigation and model enhancements.

Figure 2 .
Figure 2. Pedestrian traffic on the Old Market Square in Poznan ´according to Google Places popular times.

Figure 3 .
Figure 3.Old Market with the surrounding streets-Google Maps view and the extracted polygons used in simulation.On the right panel, circles with crosses are the entry/exit points.

Figure 5 .
Figure 5. Route choice on the basis of values of patches.Red rectangles are obstacles that diminish values of patches; the blue star is the destination patch; numbers are values of patches computed based on formulae (4) and (5).

Figure 6 .
Figure 6.Pairplot for model generated output.Upper panel shows a cross-correlation score between variables; diagonal panel shows density plots; lower panel shows scatterplots; plots were produced based on 10 simulations.

Figure 7 .
Figure 7. Boxplots for the number of agents by hour.Reported values make up the average of 10 simulations.

Figure 8 .
Figure 8. Agents' trajectories and densities for selected hours during the daytime.

Figure 9 .
Figure 9. Agents' average speed and density in the quarters of the Old Market Square during the day.Blue circles with crosses are the entry/exit points.

Figure 11 .
Figure 11.The inflow of agents and the cumulative sum of pedestrians per hour.Bars show standard deviation; reported values make up the average of 10 simulations.

Figure 12 .
Figure 12.Boxplots for speed (patches/tick) and time the agents spent in the simulation by hour.Reported values make up the average of 10 simulations.

Figure 13 .
Figure 13.Evaluation of the model-generated traffic against popular times data at the selected POIs.

Table 2 .
Numerical scale associated with the number of agents.

Table 4 .
Basic model parameters with calibrated values.

Table 5 .
Prediction errors of model generated traffic against Google Places popular times data.

Table 6 .
Validation of the selected model output against empirical research.