Manon Prédhumeau
email: manon.predhumeau@gmail.com

Lyuba Mancheva
email: manchevalyuba@gmail.com

Julie Dugdale
email: julie.dugdale@univ-grenoble-alpes.fr

Anne Spalanzani
email: anne.spalanzani@univ-grenoble-alpes.fr

Agent-Based Modeling for Predicting Pedestrian Trajectories Around an Autonomous Vehicle

This paper addresses modeling and simulating pedestrian trajectories when interacting with an autonomous vehicle in a shared space. Most pedestrian-vehicle interaction models are not suitable for predicting individual trajectories. Data-driven models yield accurate predictions but lack generalizability to new scenarios, usually do not run in real time and produce results that are poorly explainable. Current expert models do not deal with the diversity of possible pedestrian interactions with the vehicle in a shared space and lack microscopic validation. We propose an expert pedestrian model that combines the social force model and a new decision model for anticipating pedestrian-vehicle interactions. The proposed model integrates different observed pedestrian behaviors, as well as the behaviors of the social groups of pedestrians, in diverse interaction scenarios with a car. We calibrate the model by fitting the parameters values on a training set. We validate the model and evaluate its predictive potential through qualitative and quantitative comparisons with ground truth trajectories. The proposed model reproduces observed behaviors that have not been replicated by the social force model and outperforms the social force model at predicting pedestrian behavior around the vehicle on the used dataset. The model generates explainable and real-time trajectory predictions. Additional evaluation on a new dataset shows that the model generalizes well to new scenarios and can be applied to an autonomous vehicle embedded prediction.

Introduction

Modeling and simulating the movement of pedestrians around an autonomous vehicle (AV) is of major concern for AV navigation and pedestrian safety in urban environments. Classical approaches are interested in predicting whether a pedestrian will cross the road in front of the AV or not. Predicting pedestrian movement is more complex in a shared space because pedestrians are free to move around in a wider area than just being constrained to a pavement. Shared spaces are a relatively new urban design where the segregation between pedestrians and vehicles is minimized by removing curbs, road surface markings, traffic signs, and traffic lights. Shared spaces, which include pedestrian areas, parking lots, as well as streets, crossroads and squares, have been shown to reduce car speed and the number of accidents [START_REF] Kaparias | Analysis of pedestrian-vehicle traffic conflicts in street designs with elements of shared space[END_REF][START_REF] Monderman | Shared space: The alternative approach to calming traffic[END_REF]. The concept of shared space is increasingly being applied by urban planners (National Association of City Transportation Officials (NACTO), 2019; WSP Parsons Brinckerhoff [START_REF] Farrells | Making better places: Autonomous vehicles and future opportunities[END_REF]. In cities, AVs will therefore have to navigate these spaces and interact with crowds of pedestrians.

To navigate in crowded spaces, the AV navigation system must be able to anticipate pedestrian reactions. To this end, a key step is the development of models for accurate, realtime and explainable prediction of pedestrian trajectories in various interaction scenarios.

To simulate interactions between pedestrians and vehicles in shared spaces, several microscopic approaches with behaviors defined at the individual level, have been developed: expert models and data-driven models. Expert models, like the Social Force Model (SFM) by [START_REF] Helbing | Social force model for pedestrian dynamics[END_REF], are based on rules developed by human modelers and have been widely used to model movement in shared spaces. However, existing expert models are either designed for public policy evaluation, such as anticipating the implementation of a shared space, or for generating optimal crowd navigation trajectories. These models are therefore not designed to accurately reproduce or predict individual trajectories. Trajectories are sometimes validated by macroscopic measurements, but lack microscopic validation and the models ignore the social dimension of human behavior, such as the presence of social groups or respecting social norms. Moreover, when these models represent a shared space scenario, pedestrians often cross laterally to the vehicle, whereas in real shared spaces interactions can be much more varied. Providing more accurate results than expert models, data-driven models are increasingly used for prediction. However, these models require a lot of data to learn robust representations, and data involving pedestrian-vehicle interactions in a shared space are rare. Based on a very limited number of scenarios, these models are not scalable to new situations. Finally, to be used in AV navigation, the AV's predictions must be real-time and explainable. However, data-driven models are generally slower and difficult to explain.

A pedestrian motion model, which integrates the behaviors observed in various cases of interaction with a car in shared spaces, including group behaviors, and which is accurate and fast enough to be used in predicting each pedestrian's trajectory, is currently missing. To address this gap, this work provides the following contributions:

• We propose an expert model of pedestrian reactions to an AV in a shared space.

The model consists of the SFM for distant interactions and a new decision model for conflicting interactions. The model includes various observed pedestrian behaviors, as well as social group behaviors.

• We calibrate the proposed model and evaluate its predictive ability by qualitative and quantitative comparisons of the simulated trajectories with ground truth trajectories. Several pedestrians-vehicle interaction scenarios are considered. The results are compared with the SFM and show that the proposed model better reproduces observed pedestrian behaviors. The analysis of results indicates that the model generates realtime and explainable trajectory predictions.

• We evaluate the applicability and generalizability of the proposed model on a new dataset, consisting of data recorded by car sensors among pedestrians. The results show that the model generalizes well to new real-world scenarios and that it could be used by an AV to predict the trajectories of surrounding pedestrians.

The main contribution of this work (i.e., the decision model) was previously published as a conference paper authored by the same researchers (Prédhumeau et al., 2021). In this extended article, a more in-depth state of the art is added. The proposed model is presented in a more complete way than before by including more details, as well as new illustrations and algorithms in the appendices. The model is calibrated in a more formal way and the calibration process is detailed. Moreover, the qualitative and quantitative evaluation on two datasets in the original paper is performed in this extended paper on the model after its formal calibration. An evaluation of the generalizability and applicability of the model using a new dataset is added. Finally, the paper was completed with a discussion on what was learned and on research directions for future work.

The paper is structured as follows. Section 2 presents the pedestrian behaviors observed when interacting with a vehicle in a shared space. Some pedestrian-vehicle interaction models are then presented, together with their limitations. In Section 3, we propose a new model for pedestrian reactions. This section first explains the general approach and core model concepts, then details the decision model. Sections 4 and 5 describe the implementation, the calibration of the model's parameters, and the experimental setup for evaluating the model's validity. Section 6 presents the model evaluation against ground truth trajectories, using several datasets. Finally, Section 7 concludes the paper and discusses future work.

Related Work

Based on the literature, this section presents the different pedestrian behaviors observed when interacting with a vehicle in a shared space. The section then reviews pedestrianvehicle interaction models across two categories: expert models and data-driven models.

Pedestrian-Vehicle Interaction Observations

Pedestrians-AV interactions are relatively new and there are still very few observations of pedestrian reactions to an AV in the real world. The majority of studies that include pedestrian reactions to an AV use a Wizard of Oz experiment [START_REF] Currano | ¡Vamos!: observations of pedestrian interactions with driverless cars in Mexico[END_REF][START_REF] Fuest | Using the driving behavior of an automated vehicle to communicate intentions -a wizard of Oz study[END_REF][START_REF] Habibovic | Communicating intent of automated vehicles to pedestrians[END_REF][START_REF] Palmeiro | Interaction between pedestrians and automated vehicles: A wizard of Oz experiment[END_REF][START_REF] Rothenbucher | Ghost driver: A field study investigating the interaction between pedestrians and driverless vehicles[END_REF] or Virtual Reality [START_REF] Chang | Eyes on a car: an interface design for communication between an autonomous car and a pedestrian[END_REF][START_REF] Deb | Investigating pedestrian suggestions for external features on fully autonomous vehicles: A virtual reality experiment[END_REF], and look at the AV's intention communication and not at pedestrian trajectories. Moreover, these studies are based on initial experiences with an AV and not on pedestrian reactions over a long period of time.

In several previous studies, researchers have conducted experiments with a vehicle that appears to be autonomous in interaction with pedestrians, like [START_REF] Clamann | Evaluation of vehicle-to-pedestrian communication displays for autonomous vehicles[END_REF], [START_REF] Palmeiro | Interaction between pedestrians and automated vehicles: A wizard of Oz experiment[END_REF], and [START_REF] Rothenbucher | Ghost driver: A field study investigating the interaction between pedestrians and driverless vehicles[END_REF]. These three studies have all reported that pedestrians behaved with the AV as they would have done with a conventional vehicle. We can therefore reasonably assume that pedestrians' behavior with an AV will be very similar to their behavior with a conventional vehicle. Due to the limited data on pedestrian behavior with AVs, we also observed pedestrian behavior when encountering a conventional car in shared spaces. [START_REF] Madigan | Understanding interactions between automated road transport systems and other road users: A video analysis[END_REF] are among the only ones that have reported on the natural (i.e. in uncontrolled experiments) behaviors of pedestrians when they shared their space with an autonomous vehicle. They analyzed 22 hours of video, recorded in La Rochelle (France) and Trikala (Greece) during demonstrations of the CityMobil2 autonomous shuttle. We used their observations to build our model. We also observed pedestrian behaviors in videos of pedestrians interacting with conventional vehicles in shared spaces, from [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF]. The recordings were made with a drone on two campuses, in China and the United States. Finally, observations of pedestrian behavior during lateral interactions with vehicles by [START_REF] Zhuang | Pedestrians' crossing behaviors and safety at unmarked roadway in China[END_REF] in Hangzhou (China), and observations of pedestrian group behavior reported by [START_REF] Currano | ¡Vamos!: observations of pedestrian interactions with driverless cars in Mexico[END_REF] in two cities in Mexico, and by [START_REF] Faria | Collective behavior in road crossing pedestrians: the role of social information[END_REF] in Leeds (UK), were used to build our model. In shared spaces, interactions between pedestrians and an AV may be diverse, as illustrated in Figure 1. Pedestrians may be on a direct collision course with the AV, or may be close, interacting with the AV from the side, front, or rear. In frontal or rear interactions, pedestrians slow down and deviate from their trajectory to avoid the car path and pass alongside the car [START_REF] Madigan | Understanding interactions between automated road transport systems and other road users: A video analysis[END_REF][START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF]. In a lateral interaction, pedestrians adapt their speed, without deviating from their trajectory; they may accelerate or run to cross in front of the car, slow down or stop to let it pass, or hesitate and step back [START_REF] Madigan | Understanding interactions between automated road transport systems and other road users: A video analysis[END_REF][START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF][START_REF] Zhuang | Pedestrians' crossing behaviors and safety at unmarked roadway in China[END_REF].

Moreover, a pedestrian is often not alone in a shared space, and interactions with surrounding pedestrians influence his trajectory. Pedestrians moving in social groups remain grouped and avoid the car together [START_REF] Currano | ¡Vamos!: observations of pedestrian interactions with driverless cars in Mexico[END_REF][START_REF] Madigan | Understanding interactions between automated road transport systems and other road users: A video analysis[END_REF]. However, if a collision with the car is imminent, pedestrians in a group will prioritize their own individual safety and separate from the group to avoid the car [START_REF] Faria | Collective behavior in road crossing pedestrians: the role of social information[END_REF].

Pedestrian-Vehicle Interaction Modeling

Pedestrian-vehicle interaction models can be categorized into two approaches: expert models and data-driven models. Through a comparison of these two approaches to modeling trajectories in shared spaces, [START_REF] Cheng | Trajectory modelling in shared spaces: Expert-based vs. deep learning approach?[END_REF] have shown that each approach has its own strengths and weaknesses, but both can generate realistic predictions. In the following two sections we present a review of the main models for pedestrian-vehicle interaction and their limitations for our case study.

Expert Models

Expert models can be based on cellular automata, geometric velocity obstacles or social forces.

The environment of a cellular automaton consists of a grid of cells, each with a discrete state, and transition rules that allow cells to change from one state to another. Pedestrians move from cell to cell according to the cells states. A cellular automaton model for pedestrian movement at signalized and unsignalized intersections was developed by [START_REF] Crociani | An integrated model for the simulation of pedestrian crossings[END_REF]. The model incorporates cars and pedestrians cooperating to avoid accidents: cars give way to pedestrians if they are perceived early enough, and pedestrians give way if the car cannot stop before the pedestrian crossing. Cellular automata for when pedestrians cross at unsignalized crossings have also been proposed by [START_REF] Chen | Interaction between vehicles and pedestrians at uncontrolled mid-block crosswalks[END_REF], [START_REF] Feliciani | A simulation model for non-signalized pedestrian crosswalks based on evidence from on field observation[END_REF][START_REF] Lu | A cellular automaton simulation model for pedestrian and vehicle interaction behaviors at unsignalized mid-block crosswalks[END_REF] and more recently by [START_REF] Wu | Game theory modeling for vehicle-pedestrian interactions and simulation based on cellular automata[END_REF]. However, all these cellular automata models are designed for the evaluation of public policies, such as assessing the need for a new pedestrian crossing or designing a shared space, and not for the accurate reproduction of pedestrian trajectories. Moreover, the interactions between pedestrians and cars in these models are lateral crossings, whereas in a shared space, interactions can be much more varied.

In geometric models based on velocity obstacles, pedestrians anticipate future collisions by predicting the trajectories of other pedestrians by extrapolating their velocities. The Reciprocal Velocity Obstacle (RVO) algorithm assumes that when a collision is about to occur, the two colliding entities use similar reasoning to avoid the collision. This model has been adapted by [START_REF] Ma | AutoRVO: Local navigation with dynamic constraints in dense heterogeneous traffic[END_REF] in AutoRVO to simulate several road users: pedestrians, cars, bicycles and scooters, in the same space. In particular, a more accurate representation of the form of the entity, rather than the usual circle shape has been proposed. The algorithm provides an efficient optimization of each trajectory taking into account the kinematic and dynamic constraints, and has been evaluated with real scenarios. Similarly, a variant of the RVO model, called Optimal Reciprocal n-Body Collision Avoidance (ORCA), has been extended by [START_REF] Luo | PORCA: Modeling and planning for autonomous driving among many pedestrians[END_REF] for pedestrian behavior prediction by an AV. This model, called PORCA, combines the ORCA model with a planning of pedestrian intentions. Recently, extensions to ORCA have been introduced by [START_REF] Charlton | Simulating crowds and autonomous vehicles[END_REF] to simulate AVs and pedestrians sharing an urban space, but without considering car-specific movement constraints. An important limitation of geometric models is that they compute a set of optimal collision-free trajectories for all road users. These models are not suitable for accurately reproducing pedestrian trajectories, which depend greatly on the social dimension of human behavior, such as the presence of social groups or respecting social distances.

A widely used technique for pedestrian simulation is the SFM of [START_REF] Helbing | Social force model for pedestrian dynamics[END_REF]. This model uses physical forces of Newtonian dynamics to model the movement and local interactions between pedestrians. Several studies of pedestrian-vehicle interaction in shared spaces have combined the SFM with decision models for conflict resolution. [START_REF] Anvari | Modelling shared space users via rule-based social force model[END_REF] were one of the first to develop a model of pedestrian-car interactions in a shared space. The model combined an adaptation of the SFM with a collision detection and conflict resolution layer using the geometrical "shadow" method. However, when applied to our case study some shortcomings can be noted, such as the lack of diversity in pedestrians movement. With the model of [START_REF] Anvari | Modelling shared space users via rule-based social force model[END_REF] pedestrians always decelerate and deviate when they are on a collision course with a car, which is unrealistic. This model does not take into account the diversity of observed behaviors: pedestrians sometimes behave in a risky way because they do not have a perfect perception of the situation [START_REF] Dommes | Crossing a two-way street: comparison of young and old pedestrians[END_REF], or because they prefer to run to go first [START_REF] Zhuang | Pedestrians' crossing behaviors and safety at unmarked roadway in China[END_REF]. Moreover, pedestrian groups are not modeled, even though they can have a strong influence on trajectories. This model is not representative of the variety of behaviors observed and is unsuitable for predicting pedestrian trajectories.

Similarly, the SFM was adapted by [START_REF] Chao | Vehicle-pedestrian interaction for mixed traffic simulation[END_REF] and combined with a decision model. In case of a potential future collision with a car, pedestrians stop or continue depending on whether they arrive at the crossing point first or second. The results show that this approach is promising. However, only lateral interactions have been studied, and the model lacks validation against real-world data. Furthermore, groups of pedestrians are not modeled. [START_REF] Pascucci | Modeling of shared space with multi-modal traffic using a multi-layer social force approach[END_REF] and [START_REF] Rinke | A multi-layer social force approach to model interactions in shared spaces using collision prediction[END_REF] have developed quite complete models, integrating pedestrian groups, cars, and bicycles, as well as modeling the urban infrastructure. To model pedestrian-car interactions, these models combined the SFM for short-range conflicts with a decision model for long-range conflicts. However, these models were designed with the aim of assessing if a shared space design would be more suitable that a conventional intersection. They do not aim to accurately predict the individual trajectories of pedestrians. Moreover, only lateral interactions were studied.

Models that integrate different interaction scenarios have been proposed by combining the SFM with game theory. This approach was developed by [START_REF] Schönauer | A Microscopic Traffic Flow Model for Shared Space[END_REF] to model road user behaviors in shared spaces. The model incorporates pedestrian-car conflict detection and several adaptation strategies for pedestrians: continue, slow down, deviate left, deviate right or speed up. Johora and Müller (2018) extended the model with interactions involving several road users at the same time and the politeness of drivers. The model is based on a sequential leader-follower game where pedestrians have three possible actions: continue, decelerate or deviate, and the car has two possible actions: continue or decelerate. Pedestrian groups interacting with vehicles have then been added to the model by [START_REF] Ahmed | Investigating the role of pedestrian groups in shared spaces through simulation modeling[END_REF]. However, with a game theory approach, the computational needs are prohibitively large when there is a large number of simulated entities. Being so computationally expensive and slow makes this approach unsuitable for an AV to use to predict pedestrian trajectories, which must work in faster than real-time.

Finally, [START_REF] Yang | Social force based microscopic modeling of vehiclecrowd interaction[END_REF][START_REF] Yang | A social force based pedestrian motion model considering multi-pedestrian interaction with a vehicle[END_REF] recently proposed a unified SFM to represent a vehicle's influence on pedestrians in shared spaces. The SFM model was adapted by adding a repulsive force exerted by the car on pedestrians, which differs according to the front, middle and rear of the car. However, the model uses a single calibration for the magnitude and direction forces for all types of interaction (frontal, lateral, rear) and thus cannot be applied to all cases of interaction. A comparison between simulated and observed trajectories by [START_REF] Yang | A social force based pedestrian motion model considering multi-pedestrian interaction with a vehicle[END_REF] shows that simulated pedestrians do not turn enough to avoid the vehicle in a front or rear interaction, and deviate too much from their trajectory during a lateral interaction. In addition, the model does not include social groups.

In conclusion, most expert models represent a specific shared space scenario, often at the lateral crossing of a road, in order to study its feasibility for urban planning. The models are difficult to generalize to other scenarios. Our work focuses on more diverse shared spaces, such as large pedestrian squares, where pedestrians will completely share their space with AVs and where interactions will be more varied than simple road crossing. In some models, the trajectories are efficient but not necessarily realistic because the model does not consider the complex and sometimes imperfect behavior of pedestrians, nor the social aspect of navigation in crowds. Our model overcomes these problems by integrating all of the observed behaviors, including social groups. As the objective in the works was not to accurately reproduce or predict individual trajectories, trajectories are sometimes validated macroscopically, but lack microscopic validation. Consequently these approaches result in less precise trajectories than with our approach. Finally, some models are not usable for prediction because they cannot run in real time. Our model gives accurate results in real-time, and the simulator can be accelerated to run faster than real-time.

Data-Driven Models

Another approach is to build a data-driven model, which learn pedestrian motion from realworld datasets. [START_REF] Ren | Heter-Sim: Heterogeneous multi-agent systems simulation by interactive data-driven optimization[END_REF] proposed a data-driven model applicable to shared spaces with heterogeneous road users, such as pedestrians, bicycles, tricycles and cars. This model, named Heter-Sim, uses data-driven optimization by choosing a velocity from a real-world dataset that tends to minimize the energy function of the simulated entities. Using videos of crowds, road traffic and shared spaces, several scenarios were studied and the model was executed in real time for up to 5000 road users. However, individual trajectories were not empirically validated. Moreover, the simulated trajectories depended on the datasets used for the optimization, and the datasets for mixed pedestrian-car scenarios contained very few pedestrians and so the model cannot be used to study their interactions.

Models based on recurrent neural networks have recently met great success in designing human trajectory models, and outperformed expert models for trajectory prediction [START_REF] Alahi | Social LSTM: Human trajectory prediction in crowded spaces[END_REF]. This approach was applied to mixed traffic prediction in shared spaces by [START_REF] Ma | TrafficPredict: Trajectory prediction for heterogeneous traffic-agents[END_REF], and [START_REF] Cheng | Modeling mixed traffic in shared space using LSTM with probability density mapping[END_REF]. By taking real-world data as input, the models learn either individual movements and interactions or collision risks from real trajectories. The models were evaluated on scenarios where vehicles, bicycles and pedestrians share the space. However, the model by [START_REF] Ma | TrafficPredict: Trajectory prediction for heterogeneous traffic-agents[END_REF] focuses on a scenario with many more vehicles than pedestrians, and the model by [START_REF] Cheng | Modeling mixed traffic in shared space using LSTM with probability density mapping[END_REF] does not run in real time.

To conclude, data-driven models can accurately predict pedestrian trajectories, but require a large amount of data to learn robust representations. In the absence of many pedestrian-vehicle interactions in the datasets, the data-driven models are currently unable to represent the variety of existing behaviors in shared spaces, and are not scalable to new scenarios. Finally, these models often do not enable real-time simulation, and are "black box". The underlying generation of trajectories is difficult to explain, which is an issue when predictions are used for AV decision-making. Our model does not need huge datasets to produce accurate results in varied interaction scenarios, and in real-time.

Model of Pedestrian Reactions

To model pedestrian reactions to an AV in shared spaces, we use a microscopic approach where pedestrians are represented as agents with behaviors defined at the individual level. This approach is also known as Agent-Based Modeling (ABM) or bottom-up modeling. ABM can accurately reproduce individual movements, and observed individual behaviors can be directly integrated into the model, without too much abstraction. By using multiple agents, we simulate a "classic" crowd of walking pedestrians, such as can be found every day on pedestrian streets or on a campus, i.e. an ambulatory crowd according to [START_REF] Berlonghi | Understanding and planning for different spectator crowds[END_REF].

This section presents the proposed pedestrian behavior ABM. We first explain the approach adopted to build the model, combining the SFM and a new decision model. We then present the three key concepts underlying the decision model, before going on to detail the decision model.

General Approach

In our approach, at each simulation time step, the motion behavior of a pedestrian is composed of three steps, as presented in Figure 2. First, the agent perceives its environment. The agent updates its perceptions by considering static obstacles, pedestrians, and the AV in its perception zone.

Then, the agent uses its perceptions to compute its future movement. This computation is done with the SFM that uses physical forces to represent the internal pedestrian motivations to perform actions. The agent wants to move toward its destination, avoiding static obstacles, other pedestrians and the AV. If the agent travels in a social group, it tries to stay cohesive with other group members.

In the original SFM by [START_REF] Helbing | Social force model for pedestrian dynamics[END_REF], an internal attractive force, the "desired acceleration force" represents the agent's motivation to move towards its desti-nation. A repulsive force is exerted from static obstacles so that they can be avoided by the pedestrian. A "social" force is exerted from nearby pedestrians, repelling the agent to avoid collisions. Finally, a small random force represents variations that allow the agents not to have too rigid behavior. For these forces, we use a modified version of the SFM that we previously developed to take into account individuals in open environments like shared spaces [START_REF] Prédhumeau | Adapting the social force model for low density crowds in open environments[END_REF]. The proposed version considers the visual perception and attention of pedestrians, and the adaptations of their personal space depending on the crowd density around them.

In shared spaces, pedestrian social groups constitute a large part of crowds: depending on the environment and the time of day there may be more pedestrians moving in groups than there are single pedestrians [START_REF] Moussaïd | The walking behaviour of pedestrian social groups and its impact on crowd dynamics[END_REF]. Pedestrians form a social group when they are at least two pedestrians who intentionally move together and who have a persistent social relationship, such as friends, couples, coworkers and families [START_REF] Adrian | A Glossary for Research on Human Crowd Dynamics[END_REF]. To simulate realistic crowds in a shared space, pedestrian movement in social groups should be modeled. [START_REF] Moussaïd | The walking behaviour of pedestrian social groups and its impact on crowd dynamics[END_REF] expanded the SFM for group behaviors by adding a cohesive force to keep the group members together, and a gaze force to reproduce groups members maintaining visual contact with each other. For these group forces, we use a version of the SFM that we previously developed, that integrates four different social groups relationships: couples, friends, families and coworkers, with different levels of attraction between the pedestrians [START_REF] Prédhumeau | Modeling and simulating pedestrian social group behavior with heterogeneous social relationships[END_REF]. This version can reproduce the structure, movement and collision avoidance of different types of groups. Thus, pedestrian social groups can be integrated into the simulated crowd to represent various contexts, e.g. a business zone, a campus, a shopping street.

To represent the pedestrian's reactions to an AV, two levels of treatment are used. When they interact with a moving obstacle, pedestrians evaluate the time-to-conflict (TTC), sometimes referred to as the time-to-contact, to know if the interaction will lead to a conflict/contact or not [START_REF] Cutting | How we avoid collisions with stationary and moving obstacles[END_REF][START_REF] Todd | Visual information about moving objects[END_REF]. The TTC is therefore used in our model to distinguish conflicting interactions from non-conflicting ones.

A non-conflicting interaction occurs when the minimal predicted distance (which was defined by [START_REF] Olivier | Minimal predicted distance: A common metric for collision avoidance during pairwise interactions between walkers[END_REF] for pedestrian-pedestrian interactions) between the pedestrian and the AV is large enough to be considered as safe, or when the conflict occurs in the distant future. For non-conflicting interactions with the AV, the SFM is used. A repulsive force, similar to the social force used for pedestrian-pedestrian interactions, comes from the AV and repels the pedestrian, as defined by [START_REF] Yang | A social force based pedestrian motion model considering multi-pedestrian interaction with a vehicle[END_REF]. The social force parameters were adapted to represent the AV characteristics, as detailed in Section 4. This force enables pedestrians to adapt their speed (slowing down or accelerating) and trajectory (deviating) ahead of time to avoid being close to the AV.

For conflicting interactions, i.e. close approach (or collision) in the near future, a decision model is used. Indeed, in case of future conflict with the AV, pedestrians must take a decision to be sure to avoid the collision. Although the SFM can represent some interactions well, on its own it cannot represent discrete actions, which involve a decision. This occurs when a pedestrian takes the decision to run in front of the car, to stop and wait for it to pass or to step back. It also occurs when a pedestrian in a group decides to temporarily separate from the group for his individual safety. This decision depends on the type of interaction (back, front or lateral) and on the expected crossing order for lateral interaction [START_REF] Cutting | How we avoid collisions with stationary and moving obstacles[END_REF]. The proposed decision model is then based on the interaction angle and on the expected crossing order at the conflict point. Depending on these parameters, pedestrians decide to run, stop, step back or turn. The decision model also incorporates a joint decision for groups so that group members avoid the AV together. If a collision is imminent for a pedestrian in a group, an individual decision is taken.

The agent's decision is then translated into action by modifying the forces previously calculated in the SFM. For example, an agent who has decided to stop will get its "desired acceleration force", which initially makes it move towards its goal, changed to an opposite force, which makes it slow down and stop. After forces have been calculated, the agent computes the sum of all the forces in order to obtain an acceleration.

Finally, the agent acts: it updates its velocity by using the computed acceleration and moves.

Core Concepts

The decision model uses three key concepts from accidentology and cognitive science: the T T C, the interaction angle θ and the expected crossing order at the conflict point.

TTC

The T T C is the time required for two agents to enter in conflict if they continue on their trajectory at their current speed. In the decision model, we define 3 novel conflict zones for pedestrian-AV interaction, illustrated in Figure 3. A collision zone is delimited by the physical size of the agents. A danger zone, where the agents are very close, is delimited by radius danger . A risk zone, where the agents are close, is delimited by radius risk . The danger zone corresponds to the distance limit that pedestrians are willing to keep around a vehicle, while the risk zone can be seen as a "comfort" distance. An intrusion into the danger zone will trigger a strong reaction from pedestrians, while an intrusion into the risk zone will not cause a reaction but prolong the pedestrian's current reaction. The zones were first determined by visually analyzing videos of pedestrians-car interactions, and then were further calibrated by testing several margin values as described in Section 4.

Figure 3: The 3 conflict zones in the decision model: collision zone (red), danger zone (orange) and risk zone (yellow). At time t 0 , the positions of p and AV appear opaque. t seconds later, p will enter the danger zone around AV . radius collision = radius p + radius AV radius danger = radius collision + margin danger radius risk = radius collision + margin risk A danger conflict will occur in T T C danger = t seconds if the distance between the pedestrian p and the AV in t seconds is equal to the danger radius, as shown in Figure 3:

d(pos p (t 0 + t), pos AV (t 0 + t)) = radius danger (1)
The future positions of p and AV at time horizon t are given by:

pos p (t 0 + t) = pos p (t 0 ) + t × v pref p (t 0 ) (2) pos AV (t 0 + t) = pos AV (t 0 ) + t × v AV (t 0 )
where t 0 is the current simulation time, pos i (t) is the position of the agent i in the environment at simulation time t, defined by its Cartesian's coordinates (pos i,x , pos i,y ); and v i (t) is the velocity vector of the agent i at simulation time t, defined by its Cartesian's coordinates (v i,x , v i,y ). The pedestrian agent p perceives the current AV's position, pos AV (t 0 ), and velocity, v AV (t 0 ), and assumes that the AV will continue in its current direction at its current speed. The vehicle tangential acceleration is ignored: if the vehicle is accelerating or slowing down, this will not be directly considered by the pedestrian, but will be perceived indirectly through the vehicle speed. The linear extrapolation of the vehicle movement is valid for the shared spaces under consideration where the vehicle must maintain a relatively low speed and will not show strong accelerations. The agent p calculates its own future position if it continues in the same direction at its preferred speed, v pref p (t 0 ). Its preferred speed, rather than its current speed is used because we want to know what would happen if it walked at its ideal speed, without adaptation. This prevents oscillations in the decision-making process when the agent is walking at a speed different from its preferred speed.

The resolution of Equation 1 is detailed in Appendix B. By computing the discriminant ∆ danger of the quadratic Equation 1, we determine if a danger conflict is possible between p and AV , and by solving the equation, we find T T C danger . A T T C danger ≥ 0 means that a danger conflict will occur between the two agents in T T C danger seconds.

danger = true, if ∆ danger ≥ 0 f alse, otherwise
If ∆ danger = 0, Equation 1 has one solution, equal to T T C danger . The agents are in danger conflict at a single instant (in T T C danger seconds), i.e. the pedestrian touches the danger zone without entering it. If ∆ danger > 0, then Equation 1 has two solutions. The first solution is the instant when the pedestrian enters the danger zone and the second solution is the instant when the pedestrian leaves the danger zone. T T C danger is equal to the first solution because we want to know when the pedestrian enters the danger zone.

The same reasoning is done with radius risk to find T T C risk , with the difference that T T C risk is equal to the second solution because we want to know when the pedestrian leaves the risk zone.

For pedestrians in a group, the T T C collision is also computed, using radius collision instead of radius danger in Equation 1. This T T C collision determines if an individual in a group is in imminent collision with the AV and needs to separate from his group. T T C collision is equal to the first solution because we want to know when the pedestrian will enter in collision.

Interaction Angle

The interaction angle θ indicates the type of interaction: back, frontal or lateral. θ denotes the angle in degrees between v AV (t 0 ) and v p (t 0 ), as illustrated in Figure 4. Note that the model also applies if the vehicle is driving in reverse.

To classify the interaction, a threshold φ is used. Several values for φ have been tested, and φ has been calibrated on real-world pedestrians-car interaction data from Yang et al. ( 2019), as detailed in Section 4.

interaction =      back, if θ ∈ [-φ; +φ] f rontal, if θ ∈ [180 -φ; 180 + φ] lateral, otherwise (a) (b) (c)

Expected Crossing Order

The expected crossing order at a conflict point is key information used by pedestrians in order to adapt their trajectory [START_REF] Olivier | Collision avoidance between two walkers: Role-dependent strategies[END_REF]. Pedestrians visually perceive obstacles under a given angle i.e. the bearing angle α [START_REF] Cutting | How we avoid collisions with stationary and moving obstacles[END_REF]. For example, at time t 0 , a pedestrian p perceives the AV under α, as defined by Equation 3:

α(t 0 ) = ( ---→ v p (t 0 ), ---------------→ pos p (t 0 )pos closest AV (t 0 )) (3)
The pedestrian considers the position of the closest car surface to him in the calculation of α. Thus, the physical size of the car is taken into account for the expected crossing order at the collision point.

When interacting with a moving obstacle, the time derivative of the bearing angle, α, indicates the magnitude of change of α over time:

α(t 0 ) = α(t 0 + 1) -α(t 0 ) (4)
The expected order of passage of the pedestrian at the conflict point, i.e, first or second, can be inferred from α and its time derivative α [START_REF] Ondřej | A synthetic-vision based steering approach for crowd simulation[END_REF]:

pedestrian expected to arrive      f irst, if sgn(α) × α > 0 second, if sgn(α) × α < 0 simultaneously, if α = 0 (a) (b)
Figure 5: Two interactions with different expected crossing order: (a) α > 0 and increasing ( α > 0) so the pedestrian is expected to arrive first, (b) α > 0 and decreasing ( α < 0) so the pedestrian is expected to arrive second.

If the AV comes from the left, as illustrated in Figure 5, α > 0. Then, if α > 0, α increases, which means that the pedestrian is expected to arrive first. On the contrary, if α < 0, α decreases, which means that the pedestrian is expected to arrive second. When the AV comes from the right, the angle α is < 0. Then if α > 0, the pedestrian is expected to arrive second, and if α < 0, the pedestrian is supposed to arrive first.

However, pedestrian behavior is not perfect. Their perception of the situation may be erroneous [START_REF] Dommes | Crossing a two-way street: comparison of young and old pedestrians[END_REF] or they may act in a way that seems irrational, e.g. speeding up to go first when they are expected to pass second. If the crossing order is not clearly defined, pedestrians may hesitate. An hesitation threshold was then added to α. We tested several values by observing the behavior produced during simulations of lateral interactions and chose a threshold of 0.1 rad s -1 . This value can be reduced to 0 to eliminate hesitant behavior or can be increased for more erratic behavior.

When the pedestrian clearly arrives first, i.e. sgn(α) × α > 0.1, he decides to go first. When the pedestrian clearly arrives second, i.e. sgn(α)× α < -0.1, he decides to go second. If the crossing order is unclear, i.e. α ∈ [-0.1; 0.1], there is hesitation.

Decision Model

A flowchart of the decision model is shown in Figure 6.

For individuals, all calculations (T T C danger , T T C risk , θ, α and α) use the AV's current position and velocity, the pedestrian's current position, and his direction and preferred walking speed. For the calculation of α and α, the AV's position and velocity are used to derive the position of the closest car surface to the pedestrian.

The pedestrian calculates whether he will be in danger in the near future. If so, he examines the type of interaction. If the AV comes from the front or the back, the pedestrian decides to turn sharply. Otherwise (i.e. lateral interaction), the pedestrian estimates the expected crossing order if the AV continues its trajectory and if the pedestrian continues walking in his current direction at his preferred speed. If he will clearly arrive first at the crossing, he runs in order to arrive earlier and puts some distance between him and the AV at the moment of the crossing. If he will clearly arrive second, he decides to stop. In cases where the crossing order is unclear, there is hesitation. Then, several cases are possible. Either the pedestrian came second and decided to stop and is now hesitating; in this case, he steps back to clarify his decision to let the AV pass. Or, the pedestrian was supposed to go first and was running and momentarily hesitates; in this case, he will keep running. Finally, the pedestrian may also hesitate and has not yet made a decision. In this case, the pedestrian will randomly decide to either run or stop.

After detecting a future conflicting interaction, the pedestrian has made a decision and has left the danger zone, but has not yet left the risk zone. As long as the pedestrian is in the risk zone, he continues to act according to the decision he has made. Thus, he continues to run, stop or step back until he is out of the risk zone.

The pedestrian's decisions are translated into actions as follows. When a pedestrian decides to turn sharply, the social force is replaced by a force perpendicular to the car direction (to the left or to the right depending on the pedestrian's relative position). When a pedestrian decides to run, the social force is set to 0 and the desired acceleration force is replaced by a force in the pedestrian's current direction, at running speed. Moreover, the pedestrian is no longer limited by his walking speed, but by his running speed. When a pedestrian decides to stop, the social force is set to 0. When the conflict is imminent, i.e. T T C danger ≤ 1.5s according to [START_REF] Hydén | The development of a method for traffic safety evaluation: The Swedish Traffic-Conflicts Technique[END_REF], the pedestrian effectively stops: the desired acceleration force is replaced by a force in the direction opposite to the current direction. When a pedestrian decides to step back, the social force is set to 0 and the desired acceleration force's direction is reversed. The social force is set to 0 because when pedestrians are on a collision course with a vehicle, this interaction prevails over other interactions. Only a force for physical collisions between agents is maintained, to prevent overlap between agents in case of collision.

For each pedestrian moving in a group, the T T C collision is computed. If there is no imminent collision with the AV, the pedestrian takes his group into account. The computations of θ, α and α are then made using the AV's current position and velocity, and the group's current center of mass, average direction and average speed. If a collision is imminent, then the pedestrian temporarily leaves his group and considers his individual safety. For the calculations, he uses his group's average direction and speed, but uses his individual position instead of the group's position. In addition, the pedestrian will ignore forces that make the group move together.

With these changes, the calculated interaction angle and crossing order will be the same for all pedestrians in a group. Thus, all members of a group will make a joint decision. If hesitating, a pedestrian in the group follows the decision of the first group member to decide. If hesitating, but in an imminent collision situation, he makes an individual decision, regardless of the group's decision. In addition, all members of a group act jointly. When they decide to turn sharply, all members turn in the same direction, depending on the group's position. When they decide to run, all members run in the same direction, i.e. in the current average group direction.

Implementation and Calibration

After a presentation of the model implementation, this section details the calibration of the proposed model including the dataset used, the calibration of the SFM and the calibration of the decision model.

Implementation

The model proposed in Section 3 has been implemented in C++ using Pedsim ros [START_REF] Okal | Github repository srl-freiburg/pedsim ros[END_REF]. Pedsim ros is an open source crowd simulator that was adapted to implement the SFM described by [START_REF] Prédhumeau | Adapting the social force model for low density crowds in open environments[END_REF][START_REF] Prédhumeau | Modeling and simulating pedestrian social group behavior with heterogeneous social relationships[END_REF], and integrates a set of software libraries and tools to develop robot applications.

The decision model presented in Section 3.3 has been translated into algorithms, which can be found in Appendix C. The main algorithm (Algorithm 2) is executed at each simulation time step, for each pedestrian agent p who is perceiving the AV. Three boolean variables are used to store the pedestrian's decision from time step to time step: isRunning, isStopped and isSteppingBack. These three variables are initialized to f alse when the agent is created at the start of the simulation. They are modified according to the pedestrian's decision as long as the AV is perceived. When the AV is no longer perceived by the pedestrian, the three variables are reset to f alse.

Calibration

The goal of the calibration is to find the best values for the model parameters. These values minimize the error between simulated and observed pedestrian trajectories so that the model can simulate trajectories close to the observed ones with the highest accuracy.

Dataset Used for Calibration

We used the CITR dataset [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF] as reference data for real pedestrian trajectories. The CITR dataset focuses on fundamental scenarios in controlled experiments. The dataset has been recorded in a parking lot at The Ohio State University, USA, and is presented in detail by [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF]. The CITR dataset contains 4 types of interaction scenarios between 8 pedestrians and one vehicle (a Golf Cart): a front interaction (vehicle arriving in front of pedestrians), a back interaction (vehicle coming from behind pedestrians), an unilateral interaction (vehicle approaching from the right side of pedestrians), and a bilateral interaction (vehicle approaching from the side of pedestrians, with 4 pedestrians facing 4 other pedestrians). The CITR dataset contains 4 instances of each type of scenario, resulting in 16 interaction scenarios between 8 pedestrians and a vehicle.

SFM Calibration

For pedestrian-pedestrian interactions, the SFM and its parameters are the ones used by [START_REF] Prédhumeau | Adapting the social force model for low density crowds in open environments[END_REF], based on the work of [START_REF] Moussaïd | Experimental study of the behavioural mechanisms underlying self-organization in human crowds[END_REF], for individual pedestrians, and by [START_REF] Prédhumeau | Modeling and simulating pedestrian social group behavior with heterogeneous social relationships[END_REF], based on the work of [START_REF] Moussaïd | The walking behaviour of pedestrian social groups and its impact on crowd dynamics[END_REF], for pedestrian groups. Parameters values have been previously calibrated in these works and are kept here.

For pedestrian-AV interactions, the SFM is similar to that for individual pedestrians with some parameters adapted to represent the AV. The adapted parameters and their values for pedestrian-pedestrian and pedestrian-AV interactions are in Table 1. In the SFM, γ makes the interaction range dependent on the relative speed of the two agents. γ is lower with the AV than with pedestrians because the AV has a high relative speed compared to pedestrians; a too high γ would make the pedestrians avoid the AV too early. γ and the social force factor were calibrated by hand with a visual analysis of the magnitudes of vehicle influence and by comparing the vehicle's influence to ground truth.

The perception zone of pedestrians is extended behind them since pedestrians perceive a vehicle from a greater distance than another pedestrian because of engine noise. Even for electric and hybrid vehicles, the use of acoustic warning systems is mandatory in many countries. For example, in the European Union, as of July 2019, any vehicle must emit a continuous sound level of at least 56 dBA if traveling at less than 20 km/h (Commission delegated regulation (EU), 2017). The value of 3.3 m is approximated from the CITR dataset [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF]. The AV's margins are zones around the vehicle that pedestrians absolutely avoid. The values of 2 m at the back, on the sides and at the front are derived from the CITR dataset [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF]. The AV's size and speed are extracted from real data and can be modified to represent any vehicle. The focus is not on a perfect calibration of the SFM parameters since calibrating the magnitude and direction forces cannot fit with all of the interaction cases.

Decision Model Calibration

The parameters of the proposed decision model and their default values are in Table 2. The AV and pedestrians' radii are the circles that enclose the physical sizes of the agents. The running speed of pedestrians interacting with a car is set to 2 to 3 times the preferred individual walking speed, according to the literature [START_REF] Huang | Analysis of car-pedestrian impact scenarios for the evaluation of a pedestrian sensor system based on accident data from sweden[END_REF][START_REF] Almodfer | Pedestrian crossing speed patterns and running frequency analysis at a non-signalized marked crosswalk: Quantitative and qualitative approaches[END_REF]. For the other parameters, the default values were from the literature or were obtained by trial and error, with a visual inspection of the simulation output over an acceptable range of values. For example, we choose φ = 25 • after trial and error, because an angle too close to 0 • would ignore some frontal cases, and a too large angle (close to 45 • ) would identify some interactions as being frontal, when they were actually lateral. The proposed model with these default values has been evaluated in our previous work (Prédhumeau et al., 2021). In order to improve the reliability of the model, we calibrated the five parameters: margin danger , margin risk , φ, T T C danger considered and T T C imminent with an optimization algorithm. We searched for the best-fitting parameter values using pedestrian trajectories from the CITR dataset [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF].

Optimization Algorithm

The search of the best-fitting parameter values is also called model calibration. It consists of maximizing or minimizing an objective function while exploring the parameter space. A widely used technique to explore the parameter space is the exhaustive search. It examines every value in the parameter space and is suitable for models with a small number of parameters. Genetic algorithms is another technique to explore the parameters space. This technique is fast and does not require the exploration of the whole parameter space. However, there is no guarantee of finding the optimal solution and it requires the tuning of hyper-parameters. For our calibration process, we used an exhaustive search because: (1) it finds the optimal solution among the tested values, (2) it is easy to implement, (3) no hyper-parameter tuning is needed.

Goodness of Fit Metrics

A second step in the calibration process is to define the objective function. In this work, we want to minimize the distance between real and simulated trajectories. [START_REF] Hussein | A bi-directional agent-based pedestrian microscopic model[END_REF] defined an objective function using the average and maximum displacement error. The average displacement error (ADE) provides an indication of the overall accuracy of the simulated trajectories and the maximum displacement error (MDE) gives an idea about the ability of the model to reproduce specific behaviors. In addition, they examined the model's ability to reproduce the collision avoidance strategies taken by pedestrians. The ADE was also used as a goodness of fit metric by [START_REF] Rudloff | Can walking behavior be predicted? analysis of calibration and fit of pedestrian models[END_REF]. In another study, [START_REF] Hussein | Validation of an agent-based microscopic pedestrian simulation model at the pedestrian walkway of brooklyn bridge[END_REF] used the ADE combined with the average speed error (ASE). [START_REF] Zeng | Specification and calibration of a microscopic model for pedestrian dynamic simulation at signalized intersections: A hybrid approach[END_REF] used a combination between the relative distance error and the relative angle error considering that the pedestrian trajectory is 2-dimensional. They found that the two criteria are independent in the minimization process and should both be considered when calibrating pedestrian model.

In summary, different objective functions were used to calibrate models that simulate pedestrian trajectories. We decided to implement and calculate the following metrics in our calibration process in order to explore their effect on the calibration results:

1. average displacement error ADE, 2. average speed error ASE, 3. average displacement error ADE + maximum displacement error MDE, 4. average displacement error ADE + average speed error ASE, 5. average orientation error AOE, 6. average distance of closest approach error DCAE.

The distance of closest approach is the minimum distance measured between the pedestrian and the vehicle, considering the entire interaction. The DCAE measures the error in the distance of closest approach, i.e. the absolute difference between the distance of closest approach measured in simulation and the distance of closest approach in ground truth. This measure was inspired by the M P D(tcross) measure for pedestrian-pedestrian interaction defined by [START_REF] Olivier | Minimal predicted distance: A common metric for collision avoidance during pairwise interactions between walkers[END_REF]. In addition, we calculated the occurrence of collisions between the vehicle and pedestrians in the simulated trajectories.

Method -Parameter Values Tested

Several values were tested in order to determine an optimal set of parameters, i.e. producing trajectories as close as possible to the observed trajectories. After defining a range of plausible values for each parameter, several values to be tested were selected, as presented in Table 3. The exhaustive search explored the 486 combinations of values for the parameters {margin danger ; margin risk ; φ; T T C danger considered; T T C imminent }.

Method -Simulation Setup

The CITR dataset [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF] was used as a baseline for the real pedestrian trajectories. We simulated the same 16 scenarios: 4 frontal, 4 rear, 4 lateral and 4 bilateral interactions with the AV. In order to reproduce the scenarios, we defined the coordinates of the start and end points of each of the 8 pedestrians similar to the coordinates in the dataset. The AV speed and trajectory were defined as observed in the CITR dataset. For each of the 486 parameter combinations tested, the simulation of each of the 16 scenarios with the proposed model is repeated 5 times in order to smooth out stochastic errors and obtain more robust results, giving a total of 38,880 simulations. For each simulation, we recorded the simulated trajectories for the pedestrians and the AV.

Method -Cross-Validation

We used a 3-block cross-validation method in order to select the best-fitting parameter values so the model can generalize over different datasets. Our final goal is to simulate and reproduce human behavior in various situations of interaction with an AV in a shared space. The model should therefore be as general as possible and not over-fitted on a specific dataset. The method used for the cross-validation is illustrated in Figure 7.

We split the dataset scenarios into a training set (the data known by the model), a test set (data unknown by the model used in the cross-validation loop) and a validation set (data unknown by the model). We randomly selected 12 scenarios for the training and test set, shown in orange in Figure 7 and 4 scenarios for the final validation set, shown in blue in Figure 7. The training and test set was then split in 3 in order to have 8 scenarios for the training set and 4 scenarios for the test set.

The model was initially fit on the training set, shown in red in Figure 7. We used the objective functions previously defined to calculate the difference between simulated and real trajectories for each parameter combination. The exact algorithm for calculating the mean values of the objective functions is shown in Algorithm 1. A best parameter combination was then selected for each of the 3 training sets, based on the best metric value. Since we calculate 6 objective functions and in some cases they give different parameter combinations as optimal, we decided to use only one of them as a criteria for selection: the ADE. The ADE is the most important criteria while calibrating spatial data such as trajectories. We also considered if a collision occurred between a pedestrian and the vehicle and used it as a criteria to exclude parameter combinations since in real observations no collisions were observed.

For each of the 3 parameter combinations, we then computed the corresponding test errors on the remaining 4 scenarios, shown in purple in Figure 7. We selected the parameter combination producing the lowest ADE among the 3 test sets. This parameter combina-tion is indeed the best-fitting parameter value tuple and was finally used to calculate the validation error.

Method -Calibration Results

The best-fitting parameter set selected for each training set and the associated test errors are reported in Table 4: The best-fitting parameter set is not the same for all test sets. We selected the set of parameters that produced the smallest ADE, i.e. the set of parameters {0.45m; 1.4m; 25°; [-1,5]s; 2s} obtained on test set n°2. It turns out that among the three best-fitting parameter sets, this set produces smallest errors for 5 of the 6 objective functions. These results may suggest that the ADE is a good metric for model evaluation and in general for trajectory comparison.

The validation errors were computed using the best-fitting parameter values from test set n°2 on the 4 scenarios kept for validation. From Table 5, we can see that the model performed well on the validation test. The error values are close to the values obtained in the training and testing phase, which shows the robustness of the model. It produced small ADE (1.39m), which was different from the training set by only 14cm. We can observe the same trend for other validation errors; the ASE is 0.39 m/s compared to 0.33 m/s with the training set and the AOE is 14.5°compared to 16.0°with the training set. Finally, we did not observe any collision between the vehicle and pedestrians during the validation testing, which is realistic. The simulated pedestrian trajectories for the 5 repetitions for each of the 4 validation scenarios are presented in Appendix D. The set of calibrated parameters {margin danger : 0.45m ; margin risk : 1.4m ; φ: 25°; T T C danger considered: [-1,5]s ; T T C imminent : 2s} is very close to the default values fitted by hand (in Table 2). Our initial estimation of the parameter values was therefore sound. The validation results show the ability of the proposed model to predict pedestrian behavior in various interaction situations with an AV. This will be further explored in the next sections.

Experimental Evaluation Setup

In order to evaluate the performance of the proposed model, we performed several simulations. This section presents the research questions under consideration, the three datasets used to evaluate the model and the evaluation process.

Research Questions

The objective of this work is to predict trajectories for pedestrians interacting with an AV, knowing their initial position, speed, and orientation. However, trajectories cannot be perfectly reproduced (i.e. a zero prediction error), because there is a risk of overfitting. Overfitting occurs when the model is too closely matched to the limited data available and does not account for the variability of behaviors, and therefore cannot be applied to new situations. The model must be able to realistically handle various interaction situations and behaviors in a shared space. In Section 6, we answer the following research questions:

1. Does the model capture the variety of observed pedestrian behaviors? 2. How accurately does the model predict pedestrian trajectories? 3. How well does the model generalize and apply to real-world scenarios?

Datasets Used for the Evaluation

In order to evaluate the realism of the simulated trajectories we compared them to real trajectories from three datasets. These datasets include videos and trajectories of pedestrians and vehicles interacting in several shared space scenarios, as shown in Figure 8.

The DUT dataset [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF] consists of uncontrolled interactions in a crowded campus at Dalian University of Technology, China. Part of the dataset has been recorded in a large shared space, in which pedestrians and vehicles can move freely. The main interactions are lateral crossings between a pedestrian flow and a car.

The CITR dataset [START_REF] Yang | Top-view trajectories: A pedestrian dataset of vehicle-crowd interaction from controlled experiments and crowded campus[END_REF] has been previously presented in Section 4. It contains pedestrians-vehicle interactions in 4 fundamental scenarios. It has been recorded during controlled experiments in a parking lot at The Ohio State University, USA.

The Nantes dataset similarly focuses on fundamental scenarios in controlled experiments. The dataset has been recorded in a parking lot at the École Centrale de Nantes campus, France. The dataset is composed of 19 various interaction scenarios between several pedestrians and one vehicle (a Renault Fluence car): frontal, back, unilateral, bilateral and more mixed interactions are represented.

While the DUT and CITR datasets have been recorded from a top view with a drone, the Nantes dataset has been recorded by on-board vehicle sensors (cameras, Velodyne, Inertial Movement Unit and GPS). This dataset therefore represents a use case for on-board trajectory prediction that is closer to reality, where the vehicle navigates among pedestrians and retrieves all pedestrian information from its sensors.

Evaluation Process

We adopted an approach commonly applied by similar works [START_REF] Yang | A social force based pedestrian motion model considering multi-pedestrian interaction with a vehicle[END_REF][START_REF] Anvari | Calibration and validation of a shared space model: Case study[END_REF][START_REF] Zeng | Specification and calibration of a microscopic model for pedestrian dynamic simulation at signalized intersections: A hybrid approach[END_REF]. After a qualitative evaluation, we first evaluated the model on the dataset that was used for calibration, using only the 4 scenarios kept for the validation set, to indicate the performance that can be obtained after the model calibration. We then evaluated the model on a new dataset without prior recalibration in order to study the generalizability of the model to new situations. We first used the DUT dataset to perform a qualitative evaluation of the simulated pedestrian behavior. The scenario is a lateral interaction between a car and a pedestrian flow, as in the dataset. The simulation has been replicated 20 times in order to smooth out stochastic errors. The simulation was run both with the SFM only and with the proposed model for comparison. The SFM is used as a reference to show the potential benefits of the proposed solution. The SFM models pedestrian reactions with a repulsive force, while the proposed model combines a repulsive force for non-conflicting interactions and a decision model for conflicting interactions.

This qualitative evaluation validates whether the proposed model can reproduce well the variety of pedestrian behaviors observed in the dataset (research question 1).

We then used the CITR dataset to perform a quantitative evaluation of the model. For each of the 4 scenarios of the validation set (i.e. back1, front2, unilat1 and bilat3), we simulated pedestrians with the same initial conditions as in the data. In order to have the same rate as in the dataset we set the simulation time step to 0.033s, i.e. 30 frames per second. Simulated agents were placed at positions corresponding to their initial positions in the dataset and given a destination point corresponding to a straight line trajectory from their initial position to the arrival point. The agents were assigned a preferred walking speed following the normal distribution generally observed in real pedestrians with µ = 1.34 m/s and σ = 0.26 m/s [START_REF] Bosina | Estimating pedestrian speed using aggregated literature data[END_REF]. The simulated AV moves in the simulation according to its ground truth trajectory.

The model is partially stochastic, that is, the pedestrians' preferred speeds, body size, the small random force, and the decision to run or stop when hesitating, are random variables. Each of the simulation cases was repeated 20 times in order to obtain average results.

This quantitative evaluation provides an indication of the model's accuracy for prediction, and a comparison of the accuracy of the model's predictions with the SFM predictions (research question 2).

We finally used the Nantes dataset to evaluate the generalizability and the applicability of the proposed model for an on-board prediction by an AV. For each of the 19 scenarios, we extracted a snapshot of the vehicle perceptions at the moment when it detects at least one pedestrian within 10m of it. The snapshot is reproduced in simulation by placing the simulated agents (pedestrians and AV) at their detected position at the snapshot time. The pedestrian agents were given a destination point corresponding to a straight line trajectory from their initial position to the arrival point, and were assigned a preferred walking speed following a normal distribution with µ = 1.34 m/s and σ = 0.26 m/s [START_REF] Bosina | Estimating pedestrian speed using aggregated literature data[END_REF]. The simulated AV moves in the simulation according to its ground truth trajectory. Each of the 19 simulation cases was replicated 20 times in order to obtain average results. This evaluation gives a measure of how well the model generalizes to new scenarios without prior recalibration, and whether it could be used by a real AV to predict the trajectories of surrounding pedestrians (research question 3).

The experimental setup is summarized in Table 6.

Model Evaluation

This section presents the results of the evaluation process and addresses each of the three research questions considered.

6.1 Pedestrian Behavior Variety (Research Question 1)

Table 7 shows the pedestrian behaviors identified in the DUT dataset that are reproduced by the SFM and by the proposed model. A video (Prédhumeau et al., 2021) 1 illustrates the simulated pedestrian behaviors in both models. The proposed model reproduces new observed behaviors, in addition to the behaviors that were already reproduced by the SFM. Pedestrians with the proposed model run to cross in front of the vehicle, stop to wait for the vehicle to pass, and pedestrian group members avoid the vehicle together without colliding with it. Moreover, the pedestrians' trajectories observed during a lateral interaction with a vehicle are more accurately reproduced with the proposed model than with the SFM. In empirical observations, pedestrians accelerate (or run) to cross, or slow down (or stop) to wait without deviating from their trajectory. Figure 9a shows that observed pedestrian trajectories remain straight. With the SFM, the agents deviate from their trajectories as shown in Figure 9b. This deviation is caused by the SFM calibration, which was carried out on a mix of several scenarios. As discussed in Section 2.2, the SFM cannot accurately reproduce all possible interaction cases. A different set of parameter values, calibrated for each interaction case, is required. With the proposed model, the agents adapt their speed and do not deviate from their trajectory during lateral interactions, as shown in Figure 9c.

With regard to pedestrian groups, empirical observations show that group members try to together during an interaction with a car. With the SFM, group forces make group members stay together but they collide with the car and deviate from their initial trajectory. In case of imminent collision, an agent either follows his group and collides with the car, or separates from his group but still walks very close to the car. In the SFM, the group coherence force can actually counterbalance the repulsive force emitted by the car. A calibration of repulsive forces with a different magnitude from individual forces is needed for groups. With the proposed model, group members stay together; they all stop to wait or all run to cross. In case of imminent collision, an agent temporarily abandons his group and acts individually to avoid the car.

Does the model capture the variety of observed pedestrian behaviors? The proposed model, with a decision model integrated with our adapted SFM, better captures the diversity of pedestrian behaviors observed than the standard SFM.

Trajectory Predictions Accuracy (Research Question 2)

The results presented in this paper are different from those obtained in our previous work (Prédhumeau et al., 2021) because the models are calibrated more finely (see Section 4) and the results here only consider the 4 scenarios of the validation set.

In order to evaluate the predictive ability of the proposed model, we used measures commonly used in the literature for trajectory prediction [START_REF] Alahi | Social LSTM: Human trajectory prediction in crowded spaces[END_REF][START_REF] Bi | Joint prediction for kinematic trajectories in vehicle-pedestrian-mixed scenes[END_REF][START_REF] Kabtoul | Towards proactive navigation: A pedestrianvehicle cooperation based behavioral model[END_REF]. In order to compare and aggregate prediction errors, the prediction time horizon is limited by the shortest interaction time in the dataset, which was 5s.

For each measure, we computed the prediction error in each simulation for each pedestrian. For each scenario (front, back, unilateral and bilateral), we then computed the average and median error, the first and third quartiles, and the minimum and maximum values. All of the following figures show error measures; smaller values are better. For each figure, the box extends from quartiles Q1 to Q3 of the data, with a line at the median. The whiskers show the range of the data, and the mean is shown with a cross. We compared the prediction errors of the proposed model and the SFM with a Mann-Whitney U test to determine if the errors produced by the models differ significantly, i.e. if the model with the lowest error produces a significant improvement in prediction. The Mann-Whitney U test is used because the test does not meet the normality assumption (the errors follow a right-skewed distribution).

The Final Displacement Error (FDE) is the distance between the position in a predicted trajectory and the position in ground truth at the prediction horizon of 5s. The FDEs with the proposed model and the SFM are shown in Figure 10 on the 4 scenarios.

The two models produce very similar FDEs. Our model tends to produce better predictions for the unilateral and bilateral scenarios whereas the SFM tends to produce better predictions for the back and front scenarios. This confirms the qualitative evaluation: our model better reproduces the movement of pedestrians in lateral interactions than the SFM, Figure 10: Final displacement error with the proposed model (red) and the SFM (blue), for a prediction time of 5s and for each interaction scenario. because they do not deviate from their trajectory as with the SFM. However, in all cases no significant differences between the two models were found (p-values > 0.05).

The Final Speed Error (FSE) is the absolute difference between the speed in a predicted trajectory and the speed ground truth at prediction horizon of 5s. The FSEs with the proposed model and the SFM are shown in Figure 11 on the 4 scenarios. Again, the two models produce very similar FSEs. In all scenarios no significant differences between the two models were found (p-values > 0.05).

The FSE is higher for the unilateral and bilateral scenarios than in back and front scenarios. This is expected because in lateral interactions, pedestrians need to adapt their velocity, and depending on whether the pedestrian is accelerating or slowing down, the speed error can be large. Moreover, an analysis of the dataset videos show that in bilateral scenarios some pedestrians have more unusual behaviors; running to pass when the car is close or stopping early when they would have had time to pass. More data are needed to study these behaviors since other factors can affect pedestrians' reactions (e.g. influence of surrounding pedestrians, trust in the AV, etc.).

During the analysis, we noted that the FSE remains almost constant with an increasing prediction time for the back, front and unilateral scenarios. This indicates that the speed error is mainly due to errors in the initialization of the walking speed. We therefore assume that with a more accurate speed initialization, better predictions would be made. The model is generic; simulated pedestrians have a generic preferred walking speed as detailed in Section 5. However, with more data available, we could observe the first few seconds of data to compute each pedestrian's preferred speed and use it to initialize the simulation.

The Final Orientation Error (FOE) is the absolute difference between the pedestrian's orientation in a predicted trajectory and the orientation in the ground truth at the prediction horizon of 5s. The FOEs with the proposed model and the SFM are shown in Figure 12. Our model tends to produce better predictions for the unilateral and bilateral scenarios whereas the SFM tends to produce better predictions for the back and front scenarios. This confirms the observations in lateral interactions in Section 6.1. With the SFM, the simulated pedestrians deviate from their initial trajectory and orientation; which is contrary to what is observed empirically and leads to a higher error. The proposed model produces no deviation during a lateral interaction, which is closer to reality. However, the two models produce very similar FOEs: in all cases no significant differences between the two models were found (p-values > 0.05).

An important limitation of how prediction errors are measured is that it does not take into account the different possible trajectories for a pedestrian. In some cases, two pedestrians in the exact same situation with the vehicle may take very different decisions. For example, we observed in the dataset that in a lateral interaction, one pedestrian decides to run in front of the car while another pedestrian decides to stop to let the car pass. In such a case, two very different trajectories may be realistic for a given pedestrian. However, if the real pedestrian stops, the error will be smaller for a simulated trajectory where the agent collides with the car than for a simulated trajectory where the agent runs in front of the car and avoids collision.

We therefore completed the quantitative evaluation with additional measures. In each simulation and for each pedestrian, we computed the error in the distance of closest approach with the vehicle (DCAE). The DCAE measures the model's ability to predict the minimum distance kept by each pedestrian around the vehicle. For each scenario, the DCAE is shown in Figure 13. Again, we used a Mann-Whitney U test to determine if the errors produced by the two models significantly differ. For the back scenario, both models accurately predict the distance of closest approach of the pedestrians around the vehicle. No statistically significant differences were found in the DCAEs produced with the two models (p-value of 0.163). However, for the front, unilateral and bilateral scenarios, the proposed model in red produces significantly smaller DCAEs than the SFM in blue (p-values of 1.544 × 10 -3 , 3.228 × 10 -2 and 1.766 × 10 -4 respectively).

Finally, we computed the percentage of agents that collided with the AV with both models, in order to check that there are no simulated trajectories leading to a collision. For each scenario, the collision rate is shown in Table 8: With the SFM some collisions happened; 0% to 5% of the agents collided with the AV, depending on the scenario. The SFM forces sometimes counterbalance each other and produce unrealistic behaviors. Very few collisions were observed with the proposed model; 0% to 0.63% of interactions led to a collision. This is coherent with the model implementation; simulated pedestrians perceive the AV before it reaches the crossing point and they have enough time to avoid the collision. All 4 scenarios considered, the SFM produces collisions between pedestrians and the vehicle in 2.19% of cases. The proposed model produces 14 times less collisions, with 0.16% of agents colliding with the vehicle.

A collision rate close to 0 is more in line with the observations; collisions can happen in real life but in the cases considered, this is very rare. Unfortunately, real world data about pedestrian-vehicle collisions is very difficult to find, especially for the low traffic speed considered. At this speed, a collision is very unlikely to be fatal or serious and is thus not reported in the available collision statistics. If collision data were available, they could be used to further evaluate the simulation results.

How accurately does the model predict pedestrian trajectories? Overall, the proposed model performs very similarly to the SFM for predicting pedestrians' displacement, speed, orientation, while better predicting pedestrian behavior in close-to-collision situations. The proposed model better predicts the approach distance around the AV in fundamental interactions and produces more realistic collision rates than the SFM. The proposed model produces less accurate predictions on the Nantes dataset than on the CITR dataset. This is expected because part of the CITR dataset was used to calibrate the model. However, the prediction errors remain in acceptable ranges: the mean ADE is 0.89m on CITR and 1.21m on Nantes; the mean ASE is 0.43m/s on CITR and 0.48m/s on Nantes; the mean AOE is 12°on CITR and 31°on Nantes; the mean DCAE is 0.71m on CITR and 1.93m on Nantes. Mann-Whitney U tests confirm that there is a significant difference in the ADE, FOE, AOE and DCAE (p-values < 0.01) produced on the two datasets. However, for the FDE, FSE and ASE, the tests found no significant differences between the two datasets.

In addition, for all of the Nantes' scenarios considered, the proposed model produces collisions between pedestrians and the vehicle in 0.35% of cases, thus twice more than on the CITR dataset but still very few.

The proposed model remains reliable for predicting pedestrian speeds and movements in a new context and without prior recalibration. The proposed model produces trajectories that are realistic in terms of collisions with the car. However, the model is more limited in predicting pedestrian orientations and approach distances around the vehicle in a new context. For approach distances, this may be due to cultural differences. Indeed, the social distances pedestrians keep vary with culture [START_REF] Hall | The hidden dimension[END_REF]. We have calibrated the model on the CITR dataset recorded in the USA, and it is possible that in the Nantes dataset recorded in France, the distances kept around a car are different. Moreover, the AV's size impacts a pedestrian's feeling of safety [START_REF] De Clercq | External Human-Machine Interfaces on Automated Vehicles: Effects on Pedestrian Crossing Decisions[END_REF], as well as the novelty of the AV design [START_REF] Dey | Pedestrian road-crossing willingness as a function of vehicle automation, external appearance, and driving behaviour[END_REF]. The CITR dataset uses a golf cart, which can be representative of small AVs, like the Waymo Firefly car, but pedestrian approach distances can differ with bigger AVs.

The application of the model on data from the car's on-board sensors helps to anticipate problems that will be encountered in a real-life application. Detection and tracking problems, e.g. undetected pedestrians, pedestrians detected twice, pedestrians perceived too late, have an influence on the predictions' quality. In the Nantes dataset, not all pedestrians are perceived and detected correctly by the sensors; some pedestrians appear in the dataset videos but are not present in the dataset trajectories because they are not perceived by the sensors. Therefore, some pedestrians are not reproduced in the simulation and are not included in the predictions. However, the real trajectories are influenced by these undetected pedestrians. Contrary to the CITR dataset, where we have access to all pedestrians' information at any time during the interaction, in the Nantes dataset, accurate predictions are more difficult, because they are based on incomplete data.

Similarly, in the Nantes dataset videos, some static obstacles, i.e. cars parked on the side of the parking lot, constrained pedestrian movements. These obstacles are not recorded in the dataset and are therefore not reproduced in the simulation or incorporated in the predictions.

Finally, with the proposed model the simulation runs in real time even with a large number of pedestrians. At 25Hz, a simulation with an AV in a crowd of 100 pedestrians at a density of 0.5 pedestrian/m 2 runs in real time on a standard PC hardware (Intel Core i7-7920HQ, 4.10GHz). The simulator can be accelerated to run faster than real time and thus be used for online predictions.

How well does the model generalize and apply to real-world scenarios? Overall, the proposed model is reliable for predicting pedestrian trajectories in a new context, even if the model is less accurate on a new dataset than on the dataset used for calibration. The model could be used by a real AV to predict the trajectories of surrounding pedestrians, coupled with advanced detection and tracking systems.

Conclusions

This section synthesizes the work that has been done, what has been learned in doing this work, and summarizes the unresolved issues that should be the subject of future work.

What Was Done?

We proposed a new ABM for pedestrian reactions to an AV in a shared space. The model combines the SFM with a new decision model, which integrates various observed reactions of pedestrians and pedestrian groups, using cognitive science and accidentology concepts. We implemented the proposed model and performed a qualitative and quantitative evaluation, through comparisons of the simulated trajectories with ground truth trajectories. We evaluated the generalizability of the proposed model on new scenarios and its applicability for on-board prediction.

We identified some pedestrian behaviors that were not reproduced accurately by the SFM: running to cross, stopping to wait without deviating, and staying in social group to avoid the AV. The proposed model reproduces well these various behaviors. Moreover, the proposed model performs better than the SFM for predicting the pedestrians approach distances around an AV in fundamental interactions. In addition, the proposed model produces fewer collisions than the SFM, while maintaining a similar accuracy in predicting pedestrians' displacement, speed and orientation.

The proposed model generalized well to a new dataset, without prior recalibration. The evaluation of the model's accuracy on a dataset recorded from on-board sensors shows that the model is applicable for in-vehicle prediction, in real-time. Moreover, the approach can anticipate problems that will be encountered when applying the model to real-world cases.

What Was Learned?

From this work, lessons have been learned that can be applied to other works.

• If the predictions are to be used for decision making by an AV, it is essential that the model is transparent and that the predicted trajectories are explainable for ethical or legal issues. In addition, our work shows that providing explainable trajectories is crucial to assess the realism of the predictions with respect to human behavior, as error measures alone are insufficient to evaluate a model's realism. Sometimes two predicted trajectories produce similar prediction errors, while one produces a collision and is less realistic than the other. It is therefore important to carry out both a qualitative and quantitative evaluation, and to have explainable models and results.

• Whereas in simulation a scenario can be repeated many times in order to generate several possible trajectories, real pedestrians trajectories are rarely repeated in the datasets. It is therefore difficult to know if, given the same external conditions, the trajectory taken by the pedestrian would have been exactly the same by repeating the experiment. Moreover, pedestrian trajectories are often interdependent: if the trajectory of one pedestrian changes, it will impact the trajectories of all of its neighbors. This confirms that the evaluation of a model's realism should also involve the comparison of behaviors, rather than just trajectories; for example a comparison of collision rate or social distances that pedestrians maintain with the AV.

• The quality of the trajectory prediction is highly dependent on the quality of the detection and tracking of pedestrians. Since trajectories are interdependent, detection and tracking issues will affect the prediction quality of all pedestrians in the scene.

For advances in AVs, it is important that the areas of modeling and prediction and those of detection and tracking progress together.

• Data about pedestrian behavior with AVs is limited because experiments with AVs in close human contact are not easy to organize and can be risky. This lack of data hinders the development of navigation systems. An expert approach as proposed in the paper is a first step to overcome this problem. An expert model can create a crowd of simulated pedestrians and an AV, even in the absence of a lot of real-world data. The simulated crowd can be used to develop and test AV navigation systems in order to propose a safe navigation and then to recover data from real crowds. Expert models could then be combined with data-driven approaches in hybrid models to improve predictions, as suggested by [START_REF] Cheng | Trajectory modelling in shared spaces: Expert-based vs. deep learning approach?[END_REF].

What Is Next?

The limitations of this work can lead to future work. Our model could be used for both conventional vehicles and AVs. In the absence of data with AVs, we used datasets with manually driven cars. We based our model on the observation from previous studies that pedestrians will act with an AV as they do with a conventional vehicle, once accustomed [START_REF] Rothenbucher | Ghost driver: A field study investigating the interaction between pedestrians and driverless vehicles[END_REF][START_REF] Palmeiro | Interaction between pedestrians and automated vehicles: A wizard of Oz experiment[END_REF][START_REF] Clamann | Evaluation of vehicle-to-pedestrian communication displays for autonomous vehicles[END_REF]. However, some studies expect some differences, like the emergence of overtrust with AVs [START_REF] Millard-Ball | Pedestrians, autonomous vehicles, and cities[END_REF] or the lack of pedestrian-driver communication [START_REF] Lundgren | Will there be new communication needs when introducing automated vehicles to the urban context?[END_REF]. Once pedestrians have become used to AVs, we need experimental studies to assess their interactions with AVs. Changes in pedestrian reactions are easy to implement in the proposed model simply by tuning the model parameter values, e.g. if pedestrians pay more attention to AVs, the perception zone can be adapted; if they keep more distance with AVs, the danger and risk radius can be tuned; if they are more or less reticent to cross, the hesitation threshold can be tuned.

In the model the pedestrian's decision is computed at each simulation time step, and depends on the position, speed and direction of the vehicle, thus the AV adaptations have a direct influence on the pedestrian behavior. For example, if the AV starts to brake or steer, this is perceived by the pedestrian agent and will influence its decision in the next step. However, in the cases considered for calibration and validation, we focused on pedestrian adaptations to the AV, and not vice versa for two reasons:

• If we take into account the adaptations of both road users at the same time, it is very difficult to assess how much of the pedestrian behavior is due to the adaptation made by the vehicle (which itself may depend on the behavior of the pedestrian!), and how much is related to the pedestrian only. For example, if the pedestrian runs to cross, is it because the vehicle just accelerated, or would the pedestrian have run even without the vehicle's adaptation?

• In the available data about pedestrian-vehicle interactions in shared spaces, the AV follows very straight trajectories. By calibrating and validating pedestrian reactions without considering the vehicle adaptation, we propose a model that does not depend on a particular driving style in the data.

With data containing pedestrian reactions to various driving styles, the model calibration and validation could be further refined. The AV's driving behavior strongly influences a pedestrian's reaction; for instance, erratic driving behavior will cause hesitation [START_REF] Jayaraman | Pedestrian trust in automated vehicles: Role of traffic signal and AV driving behavior[END_REF][START_REF] Pillai | Virtual reality based study to analyse pedestrian attitude towards autonomous vehicles[END_REF]. Therefore, it will be interesting to test the model with more various AV trajectories, especially having the AV adapt to avoid pedestrians. We focused on pedestrian interaction with a single vehicle and in shared spaces without conventional road structure or priority rules. However, the model could be extended to include pedestrian reaction to several vehicles or to consider a more structured environment.

The model of pedestrian group behavior has been evaluated qualitatively but not quantitatively. Future work will focus on an evaluation with more diverse scenarios and social groups. It is highly likely that the behavior of a pedestrian group with an AV depends on the relationship between the members of the group; couple, family, friends, coworkers. Pedestrian group behavior may also depend on the group's trip purpose. For example, pedestrians with a leisure or touristic purpose may be less attentive and more likely to dawdle and make stops at attraction points during their walk. Large groups of tourists, following a guide for example, may also have a different dynamic from the four types of groups considered. Datasets with annotated pedestrian groups interacting with a car could confirm these hypotheses. Moreover, we did not consider the detection of groups by the AV. Research on automatic detection and recognition of social relationships within pedestrian groups as proposed by [START_REF] Yucel | Identification of social relation within pedestrian dyads[END_REF], could complement our model in order to improve AV's predictions.

Finally, the datasets used to evaluate the model have some limitations. The CITR and Nantes datasets are derived from controlled experiments, which are more easy to reproduce in the simulations because pedestrian numbers, starting points and destinations are controlled. However, pedestrian behavior is controlled and the pedestrians are aware of the experiment. Thus, their behaviors may diverge from their natural behavior. Moreover, in all three datasets, the participants are students or academics on a campus, which can create a bias. This is a persistent issue in experiments on pedestrian-car interaction. The participants will not behave as they would in a leisure area, nor as parents with their children, or as elderly people on a walk. In addition, these are often participants who are particularly aware of technologies. More extensive studies are needed to collect more representative behaviors. Finally, the datasets used for the evaluation are from three different countries; China, USA and France. Previous studies have shown that pedestrian behavior can differ according to culture [START_REF] Hall | The hidden dimension[END_REF][START_REF] Pelé | Cultural influence of social information use in pedestrian road-crossing behaviours[END_REF]. Even in the same country, for two cities of different sizes, pedestrians can have significantly different interaction behaviors. A study in two Mexican cities by [START_REF] Currano | ¡Vamos!: observations of pedestrian interactions with driverless cars in Mexico[END_REF] reported that in the smallest city, pedestrians stop before crossing or cross only once the car has passed, while in Mexico City, they are more likely to maintain their speed or even accelerate to cross and pass in front of the car. It could be interesting to evaluate these cultural differences when pedestrians share their space with an AV.

The model can be used to predict pedestrian trajectories around an AV. Another application considered is to use the simulator with the proposed model to test AV navigation systems within simulated crowds. The simulator can be used to build shared space scenes with heterogeneous and realistic pedestrian behavior. The movements of the simulated AV can be controlled by a navigation system external to the simulator, in order to test this navigation system in various interaction cases and to anticipate pedestrian reactions before real-world tests. As our decision model uses the AV's position, speed and direction, the AV's adaptations will be perceived by the simulated pedestrians who will consequently adapt. For example, the proactive navigation system developed by [START_REF] Kabtoul | Towards proactive navigation: A pedestrianvehicle cooperation based behavioral model[END_REF] or the idea to use AV driving behavior to communicate with pedestrians developed by [START_REF] Zhang | Autonomous vehicle with communicative driving for pedestrian crossing: Trajectory optimization[END_REF] could be tested using our pedestrian model.

Figure 1 :

 1 Figure 1: Real world pedestrian-vehicle interactions observed from videos by Yang et al. (2019). (a) In rear interaction, pedestrians pass alongside the vehicle. In lateral interaction, pedestrians may (b) accelerate or run to cross, (c) slow down or stop to let the vehicle pass, or (d) hesitate and step back. (e) Pedestrian social groups avoid the car together.

Figure 2 :

 2 Figure 2: The proposed model of pedestrian behavior.

Figure 4 :

 4 Figure 4: The tree types of pedestrian-vehicle interaction, depending on the interaction angle θ: (a) back, (b) frontal or (c) lateral.

Figure 6 :

 6 Figure 6: Flowchart of the proposed decision model, with calculations in orange, initialization of variables in grey, tests leading to decisions in red and decided actions in blue. The two green areas are for groups.

Figure 7 :

 7 Figure 7: Illustration of the 3-block cross-validation method used.

Figure 8 :

 8 Figure 8: Snapshots from the datsasets' videos.

Figure 9 :

 9 Figure 9: Pedestrian trajectories during a lateral interaction with a car (large red line).

Figure 11 :

 11 Figure 11: Final speed error with the proposed model (red) and the SFM (blue), for a prediction time of 5s and for each interaction scenario.

Figure 12 :

 12 Figure 12: Final orientation error with the proposed model (red) and the SFM (blue), for a prediction time of 5s and for each interaction scenarios.

Figure 13 :

 13 Figure 13: Error in distance of closest approach with the proposed model (red) and the SFM (blue), for each interaction scenario.

6. 3

 3 Generalizability to New Scenarios and Applicability to Embedded Prediction (Research Question 3)In order to evaluate the generalizability and applicability of the proposed model, we computed the same measures on the Nantes dataset without prior recalibration. The prediction errors obtained with the proposed model on all 19 interactions are shown in Figure14; FDE, FSE and FOE after 5s of prediction; ADE, ASE and AOE on the first 5s of prediction; and DCAE between the pedestrians and the vehicle.

Figure 14 :

 14 Figure 14: Final and average prediction errors of a) displacement, b) speed and c) orientation, on the CITR dataset (validation set only) and the Nantes dataset, with the proposed model. Errors of distance of closest approach are presented in d). The box extends from quartiles Q1 to Q3 of the data, with an orange line at the median. The whiskers show the range of the data, and the mean is shown with a red cross.

  Figure 16: Front interaction.

Figure 17 :

 17 Figure 17: Unilateral interaction.

Figure 18 :

 18 Figure 18: Bilateral interaction.

Table 1 :

 1 Adapted SFM parameters with their values for pedestrian-pedestrian and pedestrian-AV interactions.

	Parameter	Value for ped.-ped.	Value for ped.-AV
		interaction	interaction
	γ	0.35	0.2
	social force factor	5.1	10.2
	perception zone	220 • 10 m +	220 • 10 m +
		360 • 1.5 m	360 • 3.3 m
	physical size	Ellipse	Ellipse
		body size	1.2 m × 2.2 m
	margins	personal space	2 m
		varying with density
	preferred speed	1.34 ± 0.26 m/s	[2.5;4.5] m/s

Table 2 :

 2 Parameters of the decision model and default values.

	Parameter	Default value
	radius AV	1.1 m
	radius p	0.35 m
	margin danger	0.5 m
	margin risk	1.0 m
	running speed	[2-3] × preferred speed m/s
	φ	25 •
	T T C danger considered	[-1s;+5s]
	T T C imminent	1.5s (Hydén, 1987)
	α hesitation threshold	[-0.1;0.1] rad s -1

Table 3 :

 3 Parameters of the decision model and values tested for calibration.

	Parameters	Plausible range	Tested values
	margin danger	[0.2, 0.7] m	{0.2 ; 0.45 ; 0.7} m
	margin risk	[0.8, 1.4] m	{0.8 ; 1.1 ; 1.4} m
	φ	[10, 25.0] •	{10.0 ; 17.5 ; 25.0} •
	T T C danger considered	[-2, -1]; [3, 7] s	[{-2 ; -1} ; {3 ; 5 ; 7}] s
	T T C imminent	[1, 3] s	{1 ; 2 ; 3} s

Table 4 :

 4 Best-fitting parameter sets selected on the training sets and associated test errors. The smallest errors appear in bold.

	Test Best-fitting parameter set	ADE ASE	ADE+	ADE+ AOE DCAE
	set	from the training set	(m)	(m/s) MDE (m) ASE	( • )	(m)
	1	{0.2m ; 0.8m ; 25°; [-2,5]s ; 3s}	1.52	0.44	2.16	0.98	13.4	0.73
	2	{0.45m ; 1.4m ; 25°; [-1,5]s ; 2s} 1.25	0.33	1.79	0.79	16.0	0.49
	3	{0.7m ; 0.8m ; 17.5°; [-1,5]s ; 1s} 1.58	0.42	2.29	1.00	15.2	0.66

Table 5 :

 5 Best-fitting parameter set and associated validation errors.

	Best-fitting parameter set	ADE ASE	ADE+	ADE+ AOE DCAE
		(m)	(m/s) MDE (m) ASE	( • )	(m)
	{0.45m ; 1.4m ; 25°; [-1,5]s ; 2s} 1.39	0.39	1.98	0.89	14.5	0.55

Table 6 :

 6 Experimental setup summary.

	Research question	Dataset used	# scenarios	Composition
	1. Does the model capture		2	28 ped.
	the variety of observed	DUT	(lateral flow with	and
	pedestrian behaviors?		and without groups)	1 car
	2. How accurately does		4	8 ped.
	the model predict	CITR	(validation set only)	and
	pedestrian trajectories?			1 car
	3. How well does the			5 to 11 ped.
	model generalize and	Nantes	19	and
	apply to real-world scenarios?			1 car

Table 7 :

 7 Observed pedestrian behaviors reproduced by the SFM and the proposed model.

	Observed behavior	SFM	SFM + decision model
	Accelerate to cross
	Run to cross
	Slow down to let pass
	Stop to let pass (without sliding)
	Hesitate and step back
	Stay in group, without collision

Table 8 :

 8 Collision rate among the simulated pedestrians and the AV with the SFM and the proposed model, for each interaction scenario.

		With the SFM	With the proposed model
	Front	0 %	0 %
	Back	0.63 %	0 %
	Unilateral	5.0 %	0 %
	Bilateral	3.13 %	0.63 %
	All	2.19 %	0.16 %

https://doi.org/10.5281/zenodo.4442416

Acknowledgments

This work has been conducted as part of the HIANIC project (Human Inspired Autonomous Navigation In Crowds), funded by the French Ministry of Education and Research and the French National Research Agency (ANR-17-CE22-0010). We acknowledge the LS2N ARMEN team and the Inria Chroma team, partners of the HIANIC project for sharing the Nantes dataset.

This paper extends a paper presented at AAMAS'21, where it was awarded the Pragnesh Jay Modi Best Student Paper Award. Prédhumeau, M., Mancheva, L., Dugdale, J., & Spalanzani, A. ( 2021). An Agent-Based Model to Predict Pedestrians Trajectories with an Autonomous Vehicle in Shared Spaces. In Proceedings of the 20th International Conference on Autonomous Agents and MultiAgent Systems (AAMAS21). We thank the anonymous reviewers of the current version of this paper, as well as the conference version, for their helpful comments.

The author contributions are as follows: M.P. conceived the model with support from L.M. M.P. implemented and tested the model, performed the experimental setup and simulations, and realized the model evaluation. L.M. performed the decision model calibration with support from M.P. M.P. wrote the paper with support from L.M. J.D. and A.S. verified the analytical methods and supervised the findings of this work. AV, Autonomous Vehicle; DCAE, Distance of Closest Approach Error; FDE, Final Displacement Error; FOE, Final Orientation Error; FSE, Final Speed Error; IQR, Inter-Quartile Range; MDE, Maximum Displacement Error; ORCA, Optimal Reciprocal n-Body Collision Avoidance; RVO, Reciprocal Velocity Obstacle; SFM, Social Force Model; TTC, Time-To-Conflict;

Appendix A. Abbreviations

We put the equation under the form at 2 + bt + c = 0:

We have:

We compute the discriminant ∆ danger = b 2 -4ac:

We compute the solution(s), i.e. T T C danger , if exist: v pref p : current preferred velocity of p, i.e. current direction at preferred speed; v AV : current velocity of AV ; radius risk : radius of the risk zone; Output: T T C risk : relative time when the pedestrian enters the risk zone;