Situated cellular agents approach to crowd modeling and simulation

21
Situated Cellular Agents Approach to Crowd Modeling and Simulation Stefania Bandini 1 , Mizar Luca Federici 1, 2 , Giuseppe Vizzari 1, 2 1 Complex Systems and Artificial Intelligence research centre Department of Informatics, Systems and Communication (DISCo) Universit`a degli Studi di Milano–Bicocca Via Bicocca degli Arcimboldi 8, 20126 Milano, Italy {bandini, vizzari}@disco.unimib.it 2 New and Old Mobility Analysis and Design for the Information Society (NOMADIS) Laboratory Universit`a degli Studi di Milano–Bicocca Via dell’Innovazione 10, 20125 Milano, Italy [email protected] * Contact author Abstract The paper describes a Multi-Agent approach to crowd modeling and simulation. After a brief introduction of the Situated Cellular Agents model, the guidelines to the crowd modeling approach is introduced as a way to support the communication among the different actors that are part of the simulation project team. The approach is then applied to describe a complex scenario providing a blend of competitive and cooperative behaviour for pedestrian agents: an underground station. A module supporting the effective 3D visualization of simulated crowd dynamics is finally introduced, as an instrument for the communication of simulation results to decision makers and non- experts in crowd phenomena. 1 Introduction The Multi-Agent Systems (MAS) approach to the modeling and simulation of complex systems in different contexts, ranging from social to biological, is still relatively young, compared to other approaches such as equation-based modeling. While several relevant applications of this approach have been successfully carried out in different application domains (see, e.g., Batty et al. 2003; Bandini et al. 2006a; Helbing et al. 1997; Klügl et al. 2003), a general framework describing roles, phases, goals and intermediate steps and sub-products of a simulation study or project (in the vein of Shannon 1998) based on a multi-agent approach to our knowledge is still not present in the literature and however it is not shared by different communities interested in MAS based simulation (MABS). In particular, there is a lack of methodologies supporting the development of multi-agent

Transcript of Situated cellular agents approach to crowd modeling and simulation

Situated Cellular Agents Approach to Crowd Modeling and Simulation Stefania Bandini1, Mizar Luca Federici1, 2, Giuseppe Vizzari1, 2

1 Complex Systems and Artificial Intelligence research centre Department of Informatics, Systems and Communication (DISCo)

Universit`a degli Studi di Milano–Bicocca Via Bicocca degli Arcimboldi 8, 20126 Milano, Italy

{bandini, vizzari}@disco.unimib.it

2 New and Old Mobility Analysis and Design for the Information Society (NOMADIS) Laboratory

Universit`a degli Studi di Milano–Bicocca Via dell’Innovazione 10, 20125 Milano, Italy

[email protected]

* Contact author

Abstract The paper describes a Multi-Agent approach to crowd modeling and simulation. After a

brief introduction of the Situated Cellular Agents model, the guidelines to the crowd modeling approach is introduced as a way to support the communication among the

different actors that are part of the simulation project team. The approach is then applied to describe a complex scenario providing a blend of competitive and cooperative

behaviour for pedestrian agents: an underground station. A module supporting the effective 3D visualization of simulated crowd dynamics is finally introduced, as an instrument for the communication of simulation results to decision makers and non-

experts in crowd phenomena.

1 Introduction The Multi-Agent Systems (MAS) approach to the modeling and simulation of complex systems in different contexts, ranging from social to biological, is still relatively young, compared to other approaches such as equation-based modeling. While several relevant applications of this approach have been successfully carried out in different application domains (see, e.g., Batty et al. 2003; Bandini et al. 2006a; Helbing et al. 1997; Klügl et al. 2003), a general framework describing roles, phases, goals and intermediate steps and sub-products of a simulation study or project (in the vein of Shannon 1998) based on a multi-agent approach to our knowledge is still not present in the literature and however it is not shared by different communities interested in MAS based simulation (MABS). In particular, there is a lack of methodologies supporting the development of multi-agent

based simulations, although some relevant yet very specific exception can be found (see, e.g., fish schools, trail formation in ants and other case studies in biological systems observation and modeling, as discussed in Camazine et al. 2001). On the one hand, this is not surprising, since there is no generally agreed upon notion of agent, but on the other this surely represents a problem. The lack of a (to a certain extent) formal definition of steps to be followed to analyze and model a situation and develop a simulator according to a MAS approach, even in a limited context such as crowd modeling, leads to the development of ad-hoc instruments that are not generally usable by people outside the team that actually designed and developed them. Moreover, the typical simulation project team often does not include a computer scientist or a specialist in the area of MASs. This setting requires to merge the roles of domain expert and agent based simulation specialist. In other words, (at least) one of the domain experts must also become proficient in multi-agent based simulation application development. However, the difficulties in forming teams supporting a simulation project are not the only issues that must be tackled in this kind of activity. In fact even the role of models, and thus of intermediate steps in the definition of a computational solution to the simulation problem are not clear (Edmonds 2001). The direct coding of a domain model or theory (e.g. a biological one) into a framework for MABS, such as Repast (North et al. 2006), often brings to the lack of an intermediate documentation of the modeling activity by means of a formal computational model. This gap leads on one hand to serious difficulties in reducing an abstract model (sometimes expressed in natural language, in a vague and qualitative way) directly to executable code, a process that can hide relevant assumptions, enrichments or simplifications that might actually modify the original domain theory. This fact can be thus considered one of the main elements that cause the typical criticisms to the adoption of simulation in scientific research processes (see, e.g., Marney and Tarbert 2000). On the other hand, the lack of a formal model mediating the abstract theory, or domain specific model, and its implementation as a computer simulator make the overall project a not very informative simulation activity. In fact the precise specification of the simulation mechanisms must then be "extracted" by the code itself. This kind of intermediate product of the simulation project, represented by a formal definition of the simulation model (e.g. a specific Cellular Automata or MAS) is useful to compare different approaches, to discuss and to clarify evaluation criteria, even outside the community of MABS experts. The main aim of this paper is to introduce a framework including a MAS based model, the guidelines for its adoption to model crowds and some relevant elements of a simulation infrastructure for crowd simulation. The long term goals of this work is to realize an integrated instrument supporting experts of crowd behaviour in their studies and analysis without requiring particular technical skills, such as proficiency in software engineering. At the same time this instrument should be part of a precise process supporting phases of analysis and modeling of specific situations. These phases should provide the configuration of the software tools for the specific experiments, as well as the evaluation of simulation results and the effective communication/visualization of the simulated dynamics. This approach, however, also leads to a clear, explicit formal specification by the domain expert of the computational model behind the simulation, with the related entities and mechanisms.

This paper presents the current advancement of this research project covering the different aspects of the above mentioned framework. In particular, after an analysis of the related works, Section 3 gives a brief description of the Situated Cellular Agents (SCA) model (Bandini et al. 2006b), which is the Multi-Agent model adopted for this project. Section 4 introduces the guidelines of the proposed modeling approach and Section 5 provides a case study related to the simulation of complex underground station crowd dynamics. Section 6 discusses one of the role of tools supporting the effective visualization of simulated dynamics in the overall simulation project. A discussion of the current status of the project, work in progress and future developments will end the paper.

2 Related Works It is not a simple task to provide a compact yet comprehensive overview of the different approaches and models for the representation and simulation of crowd dynamics. In fact, entire scientific interdisciplinary workshops and conferences are focused on this topic (Schreckemberg and Sharma 2001). However, most approaches can be classified according to the way entities are represented and managed. Several models for pedestrian dynamics are based on an analytical approach, representing pedestrian as particles subject to forces, modeling the interaction between pedestrian and the environment (and between pedestrians, in case of active walker models (Helbing et al. 1997)). A relevant example is represented by social force models (Helbing 1991), but other approaches take inspiration from fluid-dynamic (Helbing 1992) and magnetic forces (Okazaki 1979) for the representation of mechanisms governing flows of pedestrians. While this approach is based on a precise methodology and has provided relevant results, it represents pedestrian as mere particles and interactions as fixed equations, and it is not simple thus to incorporate heterogeneity and complex pedestrian behaviours in this kind of model. A different approach to crowd modeling provides the adoption of Cellular Automata (CA) (Wolfram 1986), with a discrete spatial representation and discrete time-steps. The cellular space includes both a representation of the environment and an indication of its state, in terms of occupancy of the sites it is divided into. Transition rules must be defined in order to specify the evolution of every cell's state; they are based on the concept of neighbourhood of a cell, a specific set of cells whose state will be considered in the computation of its transition rule. Local cell interactions may represent the motion of an individual in the space, and the sequential application of this rule to the whole cell space may bring to emergent effects and collective behaviours. Relevant examples of crowd collective behaviours that were modeled through CAs are the formation of lanes in bidirectional pedestrian flows (Blue and Adler 2000a), the resolution of conflicts in mutidirectional crossing pedestrian flows (Blue and Adler 2000b) and pedestrian dynamics in evacuation configurations (Schadschneider et al. 2002). Recent developments in this line of research (e.g. Henein and White 2005; Dijkstra et al. 2006), however, highlight the fact that these models include notions and mechanisms representing modifications to the basic CA approach (e.g. the introduction of at-a-distance effects) that are often so deep that the resulting models are effectively agent-based and Multi Agent Systems (MAS) (Ferber 1999) models exploiting a cellular space representing spatial aspects of agents' environment. A MAS is a system made up of a set

of autonomous components which interact, for instance according to collaboration or competition schemes, in order to contribute in realizing an overall behaviour that could not be generated by single entities by themselves. As previously introduced, MAS models have been successfully applied to the modeling and simulation of several situations characterized by the presence of autonomous entities whose action and interaction determines the evolution of the system, and they are growingly adopted also to model crowds of pedestrians (Batty 2001; Gloor et al. 2004; Toyama et al. 2006). It must be noted, however, that while several methodologies for the analysis and design of software systems based on a MAS approach have been defined (see, e.g., GAIA (Zambonelli et al. 2003), INGENIAS (Pavón and Gomez-Sanz 2003) and SODA (Omicini 2001)) they are more focused to the design of general purpose software and applications analyzed and structured using the notion of agent. In this framework, they do not consider simulation specific issues, and they are thus only useful in a relatively small phase of this kind of project. Some specific methodological approaches to multi-agent simulation can also be found (see, e.g., Campos et al.2004) but they are still very abstract and do not provide specific support to crowd modeling.

3 Situated Cellular Agent Model The Situated Cellular Agent model is a specific class of Multilayered Multi-Agent Situated System (MMASS) (Bandini et al. 2002) providing a single layered spatial structure for agents environment. In addition to this limitation on the structure of agents environment, SCA provides a limitation to the field emission mechanisms: in particular, an agent can only emit fields consisting in a subset of its own state. A thorough description of the model is out of the scope of this paper, and the goal of this Section is to briefly introduce it to give some basic notion of the elements that are necessary to describe the SCA crowd modeling approach. A Situated Cellular Agent is defined by the triple < Space, F, A > where Space models the environment where the set A of agents is situated, acts autonomously and interacts through the propagation of the set F of fields and through reaction operations. Figure 1 shows a diagram of the two interaction mechanisms provided by the model. More precisely the Space consists of a set P of sites arranged in a network (i.e. an undirected graph of sites). The structure of the space can be represented as a neighborhood function, N: P → 2P so that N(p) ⊆ P is the set of sites adjacent to p ∈ P; the previously introduced Space element is thus the pair < P, N > . Focusing instead on the single basic environmental elements, a site p ∈ P can contain at most one agent and is defined by the 3-tuple < ap, Fp, Pp > where:

• ap ∈ A ∪{⊥} is the agent situated in p (ap=⊥ when no agent is situated in p that is, p is empty);

• Fp ⊂ F is the set of fields active in p (Fp = ∅ when no field is active in p); • Pp ⊂ P is the set of sites adjacent to p (i.e. N(p)).

A SCA agent is defined by the 3-tuple < s, p, τ > where τ is the agent type, s ∈ Στ denotes the agent state and can assume one of the values specified by its type (see below for Στ

definition), and p ∈ P is the site of the Space where the agent is situated. As previously stated, agent type is a specification of agent state, perceptive capabilities and behaviour. In fact an agent type τ is defined by the 3-tuple < Στ,Perceptionτ, Actionτ > . Στ defines the set of states that agents of type τ can assume. Perceptionτ:Στ → [N ×Wf1] …[N ×Wf|F|] is a function associating to each agent state a vector of pairs representing the receptiveness coefficient and sensitivity thresholds for that kind of field. Actionτ represents instead the behavioural specification for agents of type τ. Agent behaviour can be specified using a language that defines the following primitives:

• emit(s, f, p): the emit primitive allows an agent to start the diffusion of field f on p, that is the site it is placed on;

• react(s, ap1, ap2, …, apn, s*): this kind of primitive allows the specification of a coordinated change of state among adjacent agents. In order to preserve agents' autonomy, a compatible primitive must be included in the behavioural specification of all the involved agents; moreover when this coordination process takes place, every involved agents may dynamically decide to effectively agree to perform this operation;

• transport(p, q): the transport primitive allows to define agent movement from site p to site q (that must be adjacent and vacant);

• trigger(s, s*): this primitive specifies that an agent must change its state when it senses a particular condition in its local context (i.e. its own site and the adjacent ones); this operation has the same effect of a reaction, but does not require a coordination with other agents.

Figure 1: A diagram showing the two interaction mechanisms provided by the SCA model: two

reacting agents on the left, and a field emission on the right.

For every primitive included in the behavioural specification of an agent type specific preconditions must be specified; moreover specific parameters must also be given (e.g. the specific field to be emitted in an emit primitive, or the conditions to identify the destination site in a transport) to precisely define the effect of the action, which was previously briefly described in general terms. Each SCA agent is thus provided with a set of sensors that allows its interaction with the environment and other agents. At the same time, agents can constitute the source of given fields acting within a SCA space (e.g. noise emitted by a talking agent). Formally, a field

type t is defined by < Wt,Diffusiont, Comparet, Composet > where Wt denotes the set of values that fields of type t can assume; Diffusiont: P ×Wf ×P →(Wt)+ is the diffusion function of the field computing the value of a field on a given space site taking into account in which site (P is the set of sites that constitutes the SCA space) and with which value it has been generated. It must be noted that fields diffuse along the spatial structure of the environment, and more precisely a field diffuses from a source site to the ones that can be reached through arcs as long as its intensity is not voided by the diffusion function. Composet:(Wt)+ → Wt expresses how fields of the same type have to be combined (for instance, in order to obtain the unique value of field type t at a site), and Comparet: Wt ×Wt→ {True, False} is the function that compares values of the same field type. This function is used in order to verify whether an agent can perceive a field value by comparing it with the sensitivity threshold after it has been modulated by the receptiveness coefficient.

4 Guidelines of the Modeling Approach The activity of modeling a simulation scenario using a MAS consists in a complex activity, that generally requires a deep knowledge of the domain that is going to be modelled, proficiency in computational modeling (with specific reference to MAS models), the skills of a programmer, a deep acquaintance with the simulation platform. Rarely those characteristics can be found in the same person, and in this case there is however the risk to move from a domain level theory or model to the code of some programming language, hiding the complexity of the overall process, the various intermediate choices and assumptions. The guidelines proposed in this section provide a set of phases directed to experts but also to non-expert users that wish to model a scenario using the SCA model and exploit a platform supporting the execution of MMASS models. It highlights the various steps that must be followed to realize a SCA crowd model and leads to the specification of the elements of the related formal computational model, and it can also be used as an instrument supporting the communication between a modeler and a domain expert. In order to adopt this approach in the crowding context, the modeller must essentially define three elements: the spatial abstraction in which the simulated entities are situated, the relevant elements of this structure which are able to shape crowd movement, and the behavioural specification of moving entities. Figure 2 summarizes the overall process.

Figure 2: A diagram showing the main phases of the modeling approach.

4.1 Spatial Infrastructure

In SCA agents' actions take place in a discrete and finite space. In order to obtain an appropriate abstraction of space suitable for the SCA model, a discrete abstraction of the actual space in which the simulation will take place must be defined. This abstraction is constituted of nodes connected with non-oriented arcs. In this approach, nodes represent the positions that can be occupied by single pedestrian once per time. SCA space represents thus an abstraction of a walking pavement, but it has to be sufficiently detailed to be considered a good approximation of the real environment surface, and it allows a realistic representation of the movements and paths that individuals would follow. The scale of discretization can vary, but according to (Schadschneider et al. 2002) a cell dimension of 40 × 40 cm2 is adequate to represent the typical space occupied by a pedestrian in a dense crowd.

4.2 Active Elements of the Environment

This modeling approach is based on the idea that specific active elements of the environment can be perceived as reference points influencing (or even determining) the movement of pedestrians. Typically the latter are objects of the environment which constraint agent movement (e.g. gateways, doors), but also objects that can transmit some kind of conceptual information (e.g. exit signs or indications). The SCA model provides the field diffusion-perception-action mechanism as a simple mean of generating at-a-distance effects that can be exploited to generate attraction or repulsion effects. After space discretization has been defined, active objects in the environment have to be selected as specific agents whose behavioural specification basically only provides the emission of a specific presence field. To do, a specific field type must be defined, in order to specify the diffusion and composition function for that type of signal. To complete the specification of this active element of the environment an emission intensity must also be provided. However, it must be noted that only a few parameters must be

defined: the position of the object in the environment, the specific field type (but this parameter can be selected from a library of predefined types of signal) and the emission intensity. By selecting a predefined field type the modeler is actually selecting the above introduced 4-tuple < Wt, Diffusiont, Comparet, Composet > , that specifies the way the related field is actually managed (i.e. how it diffuses, how different emissions of the same type combine and how to perform comparisons, e.g. to evaluate if a given field overcomes a threshold). Assuming thus that the position of the agent representing an active element of the environment has been selected, the behavioural specification of this agent only includes the following action: action :emit(p,ft) condition:a=〈s,p,τ〉 effect :added(f,p) where ft is a field of type t and a=〈s,p,τ〉 specifies that the agent a (for which the action is specified) is in state s, is occupying site p, and is of type τ. The effect of this emit action (i.e. added(f,p)) is a modification in the state of a set of sites in the space determined by Diffusiont. In particular, the set Pe of sites that will be affected by this action is Pe={ q ∈ P | Diffusiong(p,ft,q) ≠ 0} (i.e. the set of sites for which the diffusion function is not the null field). Given q ∈ Pe, the set F*q of fields active in it after the diffusion will be:

• Fq ∪{〈Diffusiong(p,ft,q),Composet, Comparet 〉} if the set Fq (representing fields that were active in the site q before the emission) did not include fields of type Ft;

• (Fq − {f*t})∪{〈Composet(Diffusiong(p,ft,q),w*t), Composet, Comparet 〉} where f*t=〈w*t,Composet, Comparet 〉 was the unique non null field of type Ft active in q before the emission.

It must be noted that, assuming that the position of the active entity and the related field type have been selected, the only parameter that must be specified to complete the behavioural specification is the emission intensity wt for the field ft. More complex active elements of the environment can also be defined, for instance to model the fact that an active element can stop emitting its presence field when certain conditions are met. Both these phases are partly supported by software, in particular by an editor that supports the manual definition of a discretization of an environment, as well as the positioning of sources of specific fields (having pre-defined features such as the diffusion function), to visualize the area affected by that kind of field when a specific emission intensity is associated to the field source.

4.3 Pedestrian Modeling

The third modeling phase is related to the specification of the behaviour of the pedestrians, in the specific environment defined in the previous phases. The model supports the definition of heterogenous agents thanks to the notion of agent type, which comprises the definition of related state, perceptive capabilities and behavioural specification. The behaviour of an agent type, when composite and complex, can suitably be subdivided in relevant attitudes towards the movement in the environment. Attitudes

represent the diverse priorities that a pedestrian might assume in the analyzed scenario: a pedestrian in a square might be headed towards a specific street or place of interest. The different goals and subgoals of a pedestrian in such a scenario could be suitably associated to a specific attitude, specifying how the various fields that can be perceived by the agent must be interpreted in order to select the action that must be carried out in a given situation. In particular, since the main focus of this kind of model is on pedestrian movement, an attitude must specify how the presence of a given field influences the choice of the destination site of a transport action. To do so, in this approach the modeler must specify a utility function defining how the presence of various fields must be combined to obtain the general desirability of a given site adjacent to the current agent position. The agent behavioural specification requires thus the specification of a transport action whose destination site is the one that maximizes this function, and more formally: action : transport(p, q) condition: a=〈s,p,τ〉, Aq=⊥, q ∈ Pp, best(s,q) effect : a=〈s,q,τ〉, Ap=⊥ where a=〈s,p,τ〉 specifies that the agent a (for which the action is specified) is in state s, is occupying site p, and is of type τ; q ∈ Pp means that q is in the set of sites adjacent to p. The conditional element best(s,q) is verified if ¬∃ r ∈ Pp | utility(s,r) > utility(s,q) ∧ar=⊥. In other words this action specifies that the agent a must move towards the adjacent vacant site which presents the highest utility value, given the current agent state and thus given its current attitude. The utility function can be defined as utility(s,r) = ∑t ∈ T wt (s)·fval(t,r) where wt(s) denotes the weight associated to fields of type t for agents having an attitude associated to s (i.e. the desirability of that kind of signal) and fval(t, r) denotes the value of field type t in site r. In case of more sites having the same utility value the agent can make a non deterministic choice among them. The effect of the action is to free site p, and correspondingly change the position of agent a to site q. For each attitude, moreover, the modeller must specify the fields emitted by the agent and the sensitivity to fields emitted by other agents. Finally, the conditions for a change in agent's attitude must be defined: since this implies a change in agent's state, this will be typically obtained through a trigger or a react primitive. The first option can be used when the change of attitude can be mapped to a specific condition associated to a field, such as the fact that the current intensity of a signal exceeds a given threshold (i.e. the agent is close enough to a given point of interest), and the second can be adopted when the agent is supposed to reach another relevant entity and interact with it. Such a trigger action can be specified as follows: action : trigger(s1,fg,s2) condition: a=〈s1,p,τ〉, perceive(fg), compare(fg,ft) effect : a=〈s2,p,τ〉 where ft represent the above introduced threshold; the above described reaction can instead be specified as follows: action : react(s1,b,s2) condition: a=〈s1,p,τ1〉, b=〈sb,q,τ2〉, q ∈ Pp, agreed(b) effect : a=〈s2,p,τ1〉 where the agreed(b) specifies that agent b has agreed to perform a coordinated change of state, a necessary condition for the reaction to take place. It must be noted that a

compatible react action must be specifed in another agent (that could be of the same type or not). The effect of both actions is to change the state of agent a from s1 to s2, but in different conditions and exploiting different primitives. It must be noted that these are just sample action specifications, and that additional conditional elements can be defined to better fit the specific situation.

4.4 Discussion

These three elements, spatial abstraction of the environment, active elements and mobile agents behavioural specifications, define an abstract computational model for a specific situation. The configuration for an experiment in a specific simulation scenario follows these phases, and it requires the definition of the number of agents present in the scenario, and for each of them an initial position and state must be specified. The whole process ends with a formal statement of what is the goal of the simulation, a precise specification of what has to be observed and how. The variety of possibly monitored parameters, and thus also the number and heterogeneity of distinct monitoring mechanisms, does not allow the definition of precise guidelines for this phase. For instance, in Balmer and Nagel 2006, in a car traffic simulation the modelers decided to consider a specific condition that could be considered a problem in the model as a relevant event to be monitored. In particular, the modelers decided not to avoid specific conflics among cars that arised in roundabouts, but simply to track them as indicators of potential jam situations and to let the cars move on, penetrating each other. Two considerations on this point can however already be done. First, single pedestrian agents are a gross simplification of human beings, so the results of the simulation should be analyzed at an aggregate level (e.g. average crowd density in a given area, average time needed to move from an area to another, considering a relevant set of simulations). Second, data generated by the simulation must not only be considered as elements supporting decision making activities, since they can be compared to actual data, monitored on the field, for sake of validation but also in order to perform a tuning of the adopted parameters. In this framework, this phase requires a thorough involvement of experts and decision makers that will actually use the simulator.

5 Underground Station Crowd Dynamics

5.1 The Scenario

Figure 3: Discretization of a portion of the environment and extension of fields associated to the doors of the wagon, in the tool supporting the definition of the simulated space.

An underground station is an environment where various crowd behaviours take place. Passengers' behaviours are difficult to predict, because crowd dynamics emerge from interactions between passengers, and between single passengers and parts of the environment, such as signals (e.g. current stop indicator), doors, seats and handles. The behaviour of passengers changes noticeably in relation to the different priorities that characterize each phase of their trips. That means, for instance, that passengers close to each other may display very different behaviours because of their distinct aims in that moment. Passengers on board may have to get off and thus try to reach for the door, while other ones are instead looking for a seat or standing beside a handle. Moreover when trains stop and doors open very complex crowd dynamics happen, as people that have to get on the train have to allow the exit of passengers that are getting off. Passengers have to match their own priority with the obstacles of the environment, with the intentions of other passengers, and with implicit behavioural rules that govern the social interaction in those kind of transit stations, in a mixture of competition and collaboration, to avoid stall situations. Given the complexity of the overall scenario, we decided to focus on a specific portion of this environment in which some of the most complex patterns of interaction take place: the part of platform in presence of a standing wagon from which some passengers are attempting to get off while other waiting travellers are trying to get on.

Figure 4: Immobile active elements of the environment.

5.2 The Modeling Assumptions

To build up our simulation we made some behavioural assumptions, now we will make some brief examples of the kind of behaviours we wanted to capture. Passengers that do not have to get off at a train stop tend to remain still, if they do not constitute obstacle to the passengers that are descending. Passengers will move only to give way to descending passenger, to reach some seat that has became available, or to reach a better position like places at the side of the doors or close to the handles. On the other hand in very crowded situations it often happens that people that do not have to get off can constitute an obstacle to the descent of other passengers, and they "are forced to" get off and wait for the moment to get on the wagon again. Passenger that have to get off have a tendency to go around still agents to find their route towards the exit, if it is possible. Once the train is almost stopped the waiting passengers on the platform identify the entrance that is closer to them, and try to move towards it. If they perceive some passengers bound to get off, they first let them get off and then get on the wagon.

5.3 The Environment

In reference to the modeling approach stated in the previous paragraph, to build an environment suitable for SCA platform, first of all we need to define a discrete structure representing the actual space in which the simulation is set. In our case study we started from an available diagram of an underground wagon. A discrete abstraction of this map was defined, devoting to each node the space generally occupied by one standing person, as shown in Figure 3. The elements of the environment that were considered relevant in determining the crowd dynamics of this scenario are the following: Station Exits, Doors, Seats and Handles (see Figure 4 for their disposition). Station exits emit fixed fields, constant in intensity and in emission, that will be exploited by agents headed towards the exit of the station, that

perceive them as attractive. Agent-doors emit another type of field which can guide passengers that have to get off the wagon, towards the platform, and passengers that are on the platform and are bound to get in the wagon. Seats may instead have two states: occupied and free. In the second state they emit a field that indicates their presence, and that is perceived as attractive by passengers, and they become occupied by reacting with agents that effectively occupy them. Handles also emit a field type very similar to the one emitted by seats, whose attractive effect is however less intense.

Figure 5: A diagram showing various attitudes for agent type passenger and the allowed transitions between attitudes.

5.4 The Passengers

The above introduced elements support the definition of agents able to move in this environment evaluating the related signals according to their attitudes. We have identified the following attitudes for agent of type passengers: waiting (w), passenger (p), get-off (g), seated (s), exiting (e). In relation to its attitude, an agent will be sensitive to some fields, and not to others, and attribute different relevance to the perceived signals. In this way, the changing of attitude will determine a change of priorities. Attitude w is associated to an agent that is waiting to enter in the wagon. In this condition, agents perceive the fields generated by the doors as attractive, but they also perceive as repulsive the fields generated by passengers that are getting off, in other words those in attitude g. In attitude w the agent "ignores" (is not sensitive to) the fields generated by other active elements of the environment, such as exits' attractive fields, chairs attractive field and so on. Once inside the wagon, w agents change their attitude to p (passenger), through a trigger action activated by the perception of the maximum intensity of field generated by agent-door type. Agent in attitude p is attracted by fields generated by seats and handles, and repulsed by fields related to passengers that are getting off. In attitude g the agent will instead emit a field warning other agents of its presence, while it is attracted by fields generated by the doors. Once passed through the wagon door a g agent changes its attitude to e (exiting) and its priority will become to find the exits of the station. Figure 5 summarizes the various agent attitudes and the allowed transitions among them (that are modeled by means of trigger or react actions). Table 1 describes instead the sensitiveness of the passenger to various fields in relation to their attitude. The table's cells provide also the indication about if the perceived field is considered attractive or repulsive, as well as the relevance associated to that field type.

This table can be used as a guide for the definition of the utility function associated to the transport action characterizing passenger agents.

State Exits Doors Seats Handles Presence Exit press. W (getting on) not perc. attr. (2) not perc. not perc. rep. (3) rep. (1) P (on board) not perc. not perc. attr. (1) attr. (2) rep. (3) rep. (2) G (getting off) not perc. attr. (1) not perc. not perc. rep. (2) not perc. S (seated) not perc. attr. (1)* not perc. not perc. not perc. not perc. E (exiting) attr. (1) not perc. not perc. not perc. rep. (2) not perc.

* = The door signal also conveys the current stop indication. Table 1: The table shows, for every agent state, the relevance of perceived signals.

It must be noted that all passengers, except those in state g, emit a field of type Presence that generally has a repulsive effect, but a much lesser one with respect to the one generated by fields of type Exit pressure emitted by agents in get-off state.

5.5 Preliminary results

A simulator implementing the previously introduced model was realized exploiting the SCA model: only a subset of the overall introduced model was implemented, and more precisely active objects of the environment and passenger agents in state w, g, e, p. State s was omitted, to focus on the conflicts between agents in state w and g, which represents a critical element of the overall system dynamic. Figure 6 shows a screen-shot of this simulation system, in which waiting agents move to generate room for passenger agents which are going to get off the train. The system is synchronous, meaning that every agent performs one single action per turn; the turn duration is about one-third of second of simulated time. The goal of a small experimentation as this one is to qualitatively evaluate the modeling of the scenario and the developed simulator. The execution and analysis of several simulations shows that the overall system dynamics and the behaviour of the agents in the environment is consistent with a realistic scenario, and fits with our expectations. To determine this evaluation, we executed over 100 simulations in the same starting configuration, which provides 6 passengers located on a metro train in state g (i.e. willing to get off), and 8 agents that are outside the train in state w (i.e. waiting to get on). In all simulations the agents achieved their goals (i.e. get on the train or get out of the station) in a number of turns between 40 and 80, with an average of about 55 turns. Nonetheless we noticed some undesired transient effects, and precisely oscillation, "forth and back" movements and in few simulations static forms providing "groups" facing themselves for a few turns, until the groups dispersed because of the movement of a peripheral element. These phenomena, which represent minor glitches under the described initial conditions, could lead to problems in case of high pedestrian density in the simulated environment.

Figure 6: Two screenshots of the metro simulation. On the first one 6 light gray agents are inside the

train and going to get off, while 8 dark agents are standing outside and are going to get on. On the second, the latter have made some rooms for the former to get off.

Instead of modifying the general model, in order to introduce a sort of agent "facing" (not provided by the SCA model), we allowed agents to keep track of their previous position, in order to understand if a certain movement is a step back. The utility of this kind of movement can thus be penalized. Instead, in order to avoid stall situations, the memory of

the past position can also be exploited to penalize immobility, lowering the utility of the site currently occupied by the agent whenever it was also its previous position. These correctives were introduced in the behavioural specification of mobile agents, and a new campaign of tests was performed to evaluate the effect of these modifications in the overall system dynamics. By introducing these correctives, the occurrence of oscillating agent movement was drastically reduced, and the penalization of immobility simplified the solution of stall situations among facing groups. In all simulations the agents were able to achieve their goals, but the number of turns required to complete agents movement is between 28 and 60, with an average of about 35 turns. The analysis and identification of other significant parameters to be monitored, in this specific simulation context and in general for crowding situations, is object of future developments.

Figure 7: A screenshot of the 3D modeling of the simulation dynamics.

6 The Role of 3D Envisioning The design of different kinds of environmental structures, at different detail levels, from the corridors or emergency exits of a building to the whole transportation system on urban or regional scale, may benefit from an envisioning of how it will perform, given specific assumptions on the usage conditions and the behaviours of the autonomous entities which will populate it. There is thus a growing interest in models and technologies supporting the simulation of this kind of domains. An innovative trend in

supporting architects in their activities is represented by virtual environments in which alternative architectural designs can be visualized and compared by involved actors, in a collaborative decision scheme (Dijkstra et al. 2003; Batty and Hudson-Smith 2005). This kind of approach could be improved by the possibility to include in the virtual environments also an envisioning of pedestrian dynamics in the related architectural structures, given the fact that human movement behaviour has deep implications on the design of effective pedestrian facilities (Willis et al. 2004). A relevant part of the project in which this work has been developed provides thus the generation of effective forms of visualization of simulation dynamics, to simplify its understanding by non experts in the simulated phenomenon. In particular, the developed simulator can be integrated with a 3D modeling and rendering engine (3D Studio MAX); more details on this integration can be found in (Bandini et al. 2004), and a sample screenshot of the animation of the simulation dynamics is shown in Figure 7. The simulator has been developed as experimentation and exploitation of a long term project for a platform for MMASS based simulations (Bandini et al. 2006c). In order to realize a realistic visualization of the simulated dynamics, the bidimensional simulator produces a log-file provided with a fixed-record structure, in which every record is related to a node of the spatial structure or the position of an agent with reference to this structure. Initially, the simulator prints the structure of the environment, then the starting position of each agent. For every iteration of the simulation the new position of every agent is also printed. This file is parsed by a 3D Studio Max script which can generate a plane and walls related to the spatial structure, or even position the simulated environment in an existing 3D model. In both case, the script creates nodes related to sites and bipeds related to agents, positioning them in their starting position. Splines are then generated starting from the discrete positions assumed by various agents, and represent bipeds' movement. This process introduces modifications to trajectories defined by the bidimensional simulator whose sense is to give a soother, more realistic (from a visualization point of view) movement to agents' avatars. This application was tested in the discussed case study, and a screenshot of the resulting animation is shown in Figure 7.

7 Conclusions and Future Works The paper presented the first steps towards the definition of the life cycle and the set of tools supporting a crowd simulation project based on a MABS approach, and more precisely on the SCA model. A modeling approach for the representation of crowds with SCAs has been described, and then a case study related to a complex modeling scenario has been introduced. Preliminary results of this case study have also been illustrated and discussed. Finally an experience in the 3D visualization of simulated dynamics, that can be used for a more effective communication of simulation results, has been described. Future developments are aimed at refining both the methodology and the set of support tools, in order to better support the modeller/user, in the construction of complex simulation scenarios. In particular the platform still provides basic user interfaces and modules aimed at supporting the definition of an active environment and the parameters for specific simulations, which can be deeply improved. Moreover specific libraries for

active objects and paradigmatic pedestrian behaviours could be defined after a thorough analysis of psycho/sociological studies of crowd behaviors.

Acknowledgements This work is preliminary result of the Social Mobile Entities in Silico (SMES) project, and was partly funded by the New and Old Mobility Analysis and Design for the Information Society (NOMADIS) laboratory, in the context of the Quality of Life in the Information Society (QUA_SI) multi-disciplinary research programme in Information Society.

References [ Balmer and Nagel2006]

Balmer, M. and K. Nagel (2006). Shape Morphing of Intersection Layouts Using Curb Side Oriented Driver Simulation. In J. P. van Leeuwen and H. J. Timmermans (Eds.), Innovations in Design & Decision Support Systems in Architecture and Urban Planning, pp. 167-183. Springer-Verlag.

[Bandini et al.2006a] Bandini, S., F. Celada, S. Manzoni, R. Puzone, and G. Vizzari (2006). Modeling the Immune System with Situated Agents. In B. Apolloni, M. Marinaro, G. Nicosia, and R. Tagliaferri (Eds.), Proceedings of WIRN/NAIS 2005, Volume 3931 of Lecture Notes in Computer Science, pp. 231-243. Springer-Verlag.

[Bandini et al.2002] Bandini, S., S. Manzoni, and C. Simone (2002). Dealing with Space in Multi-Agent Systems: a Model for Situated MAS. In Proceedings of the first international joint conference on Autonomous agents and multiagent systems, pp. 1183-1190. ACM Press.

[Bandini et al.2004] Bandini, S., S. Manzoni, and G. Vizzari (2004). Crowd Modeling and Simulation: Towards 3D Visualization. In Recent Advances in Design and Decision Support Systems in Architecture and Urban Planning, pp. 161-175. Kluwer Academic Publisher.

[Bandini et al.2006b] Bandini, S., S. Manzoni, and G. Vizzari (2006). Towards a Platform for Multilayered Multi Agent Situated System Based Simulations: Focusing on Field Diffusion. Applied Artificial Intelligence 20 (4-5), 327-351.

[Bandini et al.2006c] Bandini, S., G. Mauri, and G. Vizzari (2006). Supporting Action-at-a-distance in Situated Cellular Agents. Fundamenta Informaticae 69 (3), 251-271.

[Batty2001] Batty, M. (2001). Agent based pedestrian modeling (editorial). Environment and Planning B: Planning and Design 28, 321-326.

[Batty et al.2003]

Batty, M., J. Desyllas, and E. Duxbury (2003). The Discrete Dynamics of Small-Scale Spatial Events: Agent-Based Models of Mobility in Carnivals and Street Parades. International Journal of Geographical Information Science 17 (7), 673-697.

[Batty and Hudson-Smith2005] Batty, M. and A. Hudson-Smith (2005). Urban Simulacra: from Real to Virtual Cities, Back and Beyond. Architectural Design 75 (6), 42-47.

[Blue and Adler2000a] Blue, V. J. and J. L. Adler (2000a). Cellular Automata Microsimulation of Bi-Directional Pedestrian Flows. Transportation Research Record 1678, 135-141.

[Blue and Adler2000b] Blue, V. J. and J. L. Adler (2000b). Modeling Four-Directional Pedestrian Flows. Transportation Research Record 1710, 20-27.

[Camazine et al.2001] Camazine, S., J.-L. Deneubourg, N. R. Franks, J. Sneyd, G. Theraulaz, and E. Bonabeau (Eds.) (2001). Self-Organization in Biological Systems. Princeton University Press.

[Campos et al.2004] Campos, A. M. C., A. M. P. Canuto, and J. H. C. Fernandes (2004). Towards a Methodology for Developing Agent-Based Simulations: The MASim Methodology. In 3rd international Joint Conference on Autonomous Agents and Multiagent Systems (AAMAS 2004), Washington, DC, USA, pp. 1494-1495. ACM Press.

[Dijkstra et al.2006] Dijkstra, J., J. Jessurun, B. de Vries, and H. J. P. Timmermans (2006). Agent Architecture for Simulating Pedestrians in the Built Environment. In International Workshop on Agents in Traffic and Transportation, pp. 8-15.

[Dijkstra et al.2003] Dijkstra, J., J. Van Leeuwen, and H. J. P. Timmermans (2003). Evaluating Design Alternatives Using Conjoint Experiments in Virtual Reality. Environment and Planning B 30 (3), 357-367.

[Edmonds2001] Edmonds, B. (2001). The Use of Models - Making MABS More Informative. In Multi-Agent-Based Simulation, Second International Workshop, MABS 2000, Boston, MA, USA, July, 2000, Revised and Additional Papers, Volume 1979 of Lecture Notes in Computer Science, pp. 15-32. Springer-Verlag.

[Ferber1999] Ferber, J. (1999). Multi-Agent Systems. Addison-Wesley.

[Gloor et al.2004] Gloor, C., P. Stucki, and K. Nagel (2004). Hybrid Techniques for Pedestrian Simulations. In P. M. A. Sloot, B. Chopard, and A. G. Hoekstra (Eds.), Cellular Automata, 6th International Conference on Cellular Automata for Research and Industry, ACRI 2004, Volume 3305 of Lecture Notes in Computer Science, pp. 581-590. Springer-Verlag.

[ HelbingHelbing1991]

Helbing, D. (1991). A Mathematical Model for the Behavior of Pedestrians. Behavioral Science (36), 298-310.

[Helbing1992] Helbing, D. (1992). A Fluid-Dynamic Model for the Movement of Pedestrians. Complex Systems 6 (5), 391-415.

[Helbing et al.1997] Helbing, D., F. Schweitzer, J. Keltsch, and P. Molnár (1997). Active Walker Model for the Formation of Human and Animal Trail Systems. Physical Review E 56 (3), 2527-2539.

[Henein and White2005] Henein, C. M. and T. White (2005). Agent-Based Modeling of Forces in Crowds. In P. Davidsson, B. Logan, and K. Takadama (Eds.), Multi-Agent and Multi-Agent-Based Simulation, Joint Workshop MABS 2004, New York, NY, USA, July 19, 2004, Revised Selected Papers, Volume 3415 of Lecture Notes in Computer Science, pp. 173-184. Springer-Verlag.

[Klügl et al.2003] Klügl, F., A. L. C. Bazzan, and J. Wahle (2003). Selection of Information Types Based on Personal Utility: a Testbed for Traffic Information Markets. In The Second International Joint Conference on Autonomous Agents & Multiagent Systems, AAMAS 2003, July 14-18, 2003, Melbourne, Victoria, Australia, Proceedings, pp. 377-384. ACM Press.

[Marney and Tarbert2000] Marney, J. P. and H. F. E. Tarbert (2000). Why do Simulation? Towards a Working Epistemology for Practitioners of the Dark Arts. Journal of Artificial Societies and Social Simulation 3 (4).

[North et al.2006] North, M. J., N. T. Collier, and J. R. Vos (2006). Experiences Creating Three Implementations of the Repast Agent Modeling Toolkit. ACM Transactions on Modeling and Computer Simulation 16 (1), 1-25.

[Okazaki1979] Okazaki, S. (1979). A Study of Pedestrian Movement in Architectural Space, part 1: Pedestrian Movement by the Application of Magnetic Models. Transactions of A.I.J. (283), 111-119.

[Omicini2001] Omicini, A. (2001). SODA: Societies and Infrastructures in the Analysis and Design of Agent-Based Systems. In P. Ciancarini and M. Wooldridge (Eds.), Agent-Oriented Software Engineering: First International Workshop, AOSE 2000, Volume 1957 of Lecture Notes in Computer Science, pp. 185-193. Springer-Verlag.

[Pavón and Gómez-Sanz2003] Pavón, J. and J. J. Gómez-Sanz (2003). Agent Oriented Software Engineering with INGENIAS. In V. Marík, J. Müller, and M. Pechoucek (Eds.), Multi-Agent Systems and Applications III, 3rd International Central and Eastern European Conference on Multi-Agent Systems, CEEMAS 2003, Prague, Czech Republic, June 16-18, 2003, Proceedings, Volume 2691 of Lecture Notes in Computer Science, pp. 394-403. Springer-Verlag.

[Schadschneider et al.2002] Schadschneider, A., A. Kirchner, and K. Nishinari (2002). CA Approach to Collective Phenomena in Pedestrian Dynamics. In S. Bandini, B. Chopard, and M. Tomassini (Eds.), Cellular Automata, 5th International Conference on Cellular Automata for Research and Industry, ACRI 2002, Volume 2493 of Lecture Notes in Computer Science, pp. 239-248. Springer.

[Schreckenberg and Sharma2001] Schreckenberg, M. and S. D. Sharma (Eds.) (2001). Pedestrian and Evacuation Dynamics. Springer-Verlag.

[Shannon1998] Shannon, R. E. (1998). Introduction to the Art and Science of Simulation. In Proceedings of the 1998 Winter Simulation Conference, pp. 7-14. IEEE Computer Society.

[Toyama et al.2006] Toyama, M. C., A. L. C. Bazzan, and R. da Silva (2006). An agent-based simulation of pedestrian dynamics: from lane formation to auditorium evacuation. In H. Nakashima, M. P. Wellman, G. Weiss, and P. Stone (Eds.), 5th International Joint Conference on Autonomous Agents and Multiagent Systems (AAMAS 2006), pp. 108-110. ACM press.

[Willis et al.2004] Willis, A., N. Gjersoe, C. Havard, J. Kerridge, and R. Kukla (2004). Human Movement Behaviour in Urban Spaces: Implications for the Design and Modeling of Effective Pedestrian Environments. Environment and Planning B 31 (6), 805-828.

[Wolfram1986] Wolfram, S. (1986). Theory and Applications of Cellular Automata. World Press.

[Zambonelli et al.2003] Zambonelli, F., M. J. Wooldridge, and N. R. Jennings (2003). Developing Multiagent Systems: the GAIA Methodology. ACM Transactions on Software Engineering and Methodology 12 (3), 317-370.