History
There has always been a deep-seated interest in the understanding and gaining control of motional and behavior of crowds of people. Many major advancements have taken place since the beginnings of research within the realm of crowd simulation. Evidently many new findings are continually made and published following these which enhance the scalability, flexibility, applicability, and realism of simulations: In 1987, behavioral animation was introduced and developed by Craig Reynolds. He had simulated flocks of birds alongside schools of fish for the purpose of studying group intuition and movement. All agents within these simulations were given direct access to the respective positions and velocities of their surrounding agents. The theorization and study set forth by Reynolds was improved and built upon in 1994 byCrowd dynamics
One of the major goals in crowd simulation is to steer crowds realistically and recreate human dynamic behaviors. There exists several overarching approaches to crowd simulation and AI, each one providing advantages and disadvantages based on crowd size and time scale. Time scale refers to how the objective of the simulation also affects the length of the simulation. For example, researching social questions such as how ideologies are spread amongst a population will result in a much longer running simulation since such an event can span up to months or years. Using those two characteristics, researchers have attempted to apply classifications to better evaluate and organize existing crowd simulators. ;Flow-based Approach: Flow based crowd simulations focus on the crowd as a whole rather than its components. As such individuals do not have any distinctive behaviors that occur due to input from their surroundings and behavioral factors are largely reduced. This model is mainly used to estimate the flow of movement of a large and dense crowd in a given environment. Best used in studying large crowd, short time objectives. ;Entity-based Approach: Models that implement a set of physical, predefined, and global laws meant to simulate social/psychological factors that occur in individuals that are a part of a crowd fall under this category. Entities in this case do not have the capacity to, in a sense, think for themselves. All movements are determined by the global laws being enforced on them. Simulations that use this model often do so to research crowd dynamics such as jamming and flocking. Small to medium-sized crowds with short term objectives fit this approach best. ;Agent-based Approach: Characterized by autonomous, interacting individuals. Each agent of a crowd in this approach, is given a degree of intelligence; they can react to each situation on their own based on a set of decision rules. Information used to decide on an action is obtained locally from the agent's' surroundings. Most often, this approach is used for simulating realistic crowd behavior as the researcher is given complete freedom to implement any behaviors.Particle systems
One way to simulate virtual crowds is to use aAlgorithm by Patil and Van Den Berg
This algorithm was designed for relatively simplistic crowds, where each agent in the crowd only desires to get to its own goal destination while also avoiding obstacles. This algorithm could be used for simulating a crowd in Times Square. Patils algorithm's most important and distinctive feature is that it utilizes the concept of ''navigation fields'' for directing agents. This is different from a guidance field; a guidance field is an area around the agent in which the agent is capable of "seeing"/detecting information. Guidance fields are typically used for avoiding obstacles, dynamic obstacles (obstacles that move) in particular. Every agent possesses its own guidance field. A navigation field, on the other hand, is a vector field which calculates the minimum cost path for every agent so that every agent arrives at its own goal position. The navigation field can only be used properly when a path exists from every free (non-obstacle) position in the environment to one of the goal positions. The navigation field is computed using coordinates of the static objects in the environment, goal positions for each agent, and the guidance field for each agent. In order to guarantee that every agent reaches its own goal the navigation field must be free of local minima, except for the presence of sinks at the specified goals. The running time of computing the navigation field is , where m × n is the grid dimension (similar toIndividual behavior modelling
One set of techniques for AI-based crowd simulation is to model crowd behavior by advanced simulation of individual agent motivations and decision-making. Generally, this means each agent is assigned some set of variables that measure various traits or statuses such as stress, personality, or different goals. This results in more realistic crowd behavior though may be more computationally intensive than simpler techniques.Personality-based models
One method of creating individualistic behavior for crowd agents is through the use of personality traits. Each agent may have certain aspects of their personality tuned based on a formula that associates aspects such as aggressiveness or impulsiveness with variables that govern the agents' behavior. One way this association can be found is through a subjective study in which agents are randomly assigned values for these variables and participants are asked to describe each agent in terms of these personality traits. A regression may then be done to determine a correlation between these traits and the agent variables. The personality traits can then be tuned and have an appropriate effect on agent behavior. The OCEAN personality model has been used to define a mapping between personality traits and crowd simulation parameters. Automating crowd parameter tuning with personality traits provides easy authoring of scenarios with heterogeneous crowds.Stress-based model
The behavior of crowds in high-stress situations can be modeled usingSociology
''Crowd simulation'' can also refer to simulations based onModeling individual behaviors
Hacohen, Shoval and Shvalb formulated the drivers-pedestrians dynamics at congested conflict spots. In such scenarios, the drivers and/or pedestrians do not closely follow the traffic laws. The model is based on the Probabilistic Navigation_function (PNF), which was originally developed for robotics motion planning. The algorithm constructs a trajectory according to the probability for collision at each point in the entire crossing area. The pedestrian then follow a trajectory that locally minimizes their perceived probability for collision. Helbing proposed a model based on physics using a particle system and socio-psychological forces in order to describe human crowd behavior in panic situation, this is now called the Helbing Model. His work is based on how the average person would react in a certain situation. Although this is a good model, there are always different types of people present in the crowd and they each have their own individual characteristics as well as how they act in a group structure. For instance, one person may not react to a panic situation, while another may stop walking and interfere in the crowd dynamics as a whole. Furthermore, depending on the group structure, the individual action can change because the agent is part of a group, for example, returning to a dangerous place in order to rescue a member of that group. Helbing's model can be generalized incorporating individualism, as proposed by Braun, Musse, Oliveira and Bodmann. In order to tackle this problem, individuality should be assigned to each agent, allowing to deal with different types of behaviors. Another aspect to tackle this problem is the possibility to group people, forming these group causes people to change their behavior as a function of part of the group structure. Each agent (individual) can be defined according to the following parameters: # Id – Agent identifier # IdFamily – Identifier of the family. A family is a predefined group formed by agents who know each other # DE – Dependence level of the agent which mimics the need for help. Values ,1# AL – Altruism level representing the tendency to help other agents. Values ,1# vi – Speed of the agent To model the effect of the dependence parameter with ''individual agents'', the equation is defined as: : When evaluating the speed of the agent, it is clear that if the value of the dependence factor, DE, is equal to one, then the person would be fully disabled making him unable to move. If the dependence factor is equal to zero, then the person is able to run at his max speed. Group formation is related to the Altruism force which is implemented as an interaction force between two or more agents who are part of the same family. Mathematically, it is described as the following: : where: : represents the distance between two agents with the origin at the position of the agent; : is the distance vector point from the agents to the door's position of the simulation environment; : is a constant; : is the unitary vector with the origin at position i. Consequently, the greater the parameter of agent , the bigger will be which points to the agent and has the high level of . When both agents are close enough to each other, the one with high (agent in this example) adopts the value of agent (). This means that the evacuation ability of agent is shared with agent and both start moving together. By using these applying these equations in model testing using a normally distributed population, the results are fairly similar to the Helbing Model. The places where this would be helpful would be in an evacuation scenario. Take for example, an evacuation of a building in the case of a fire. Taking into account the characteristics of individual agents and their group performances, determining the outcome of how the crowd would exit the building is critically important in creating the layout of the building.Leader behavior during evacuation simulations
As described earlier, the Helbing Model is used as the basics for crowd behavior. This same type of behavior model is used for evacuation simulations. In general, the first thing that has to be assumed is that not everyone has knowledge about the environment or where there are and aren't hazards. From this assumption we can create three types of agents. The first type is a trained leader, this agent knows about the environment and is able to spread knowledge to other agents so they know how to exit from an environment. The next type of agent is an untrained leader, this agent does not know about the environment, however, as the agent explores the environment and gets information from other types of leaders, the agent is able to spread the knowledge about the environment. The last type of agent is a follower, this type of agent can only take information from other leaders and not be able to share the information with other agents. The implementation of these types of agents is fairly straightforward. The leaders in the environment have a map of the environment saved as one of their attributes. An untrained leader and followers will start out with an empty map as their attribute. Untrained leaders and followers will start exploring an environment by themselves and create a map of walkable and unwalkable locations. Leaders and untrained leaders (once they have the knowledge), will share information with other agents depending on their proximity. They will share information about which points on the grid are blocked, the local sub-graphs and the dangers in the area. There were two types of searching algorithms tried out for this implementation. There was the random search and the depth first search. A random search is where each of the agents go in any direction through the environment and try to find a pathway out. The depth first search is where agents follow one path as far as it can go then return and try another path if the path they traversed does not contain an exit. If was found that depth first search gave a speed up of 15 times versus a random search.Scalable simulations
There are many different case situations that come into play in crowd simulations. Recently, crowd simulation has been essential for the many virtual environment applications such as education, training, and entertainment. Many situations are based on the environment of the simulation or the behavior of the group of local agents. In virtual reality applications, every agent interacts with many other agents in the environment, calling for complex real-time interactions. Agents must have continuous changes in the environment since agent behaviors allow complex interactions. Scalable architecture can manage large crowds through the behavior and interactive rates. These situations will indicate how the crowds will act in multiple complex scenarios while several different situations are being applied. A situation can be any circumstance that has typical local behaviors. We can categorize all situations into two different kinds. ''Spatial situation'' is a situation that has a region where the environment affects the local agents. For instance, a crowd waiting in line for a ticket booth would be displaying a spatial situation. Other examples may be a bus stop or an ATM where characters act upon their environment. Therefore, we would consider 'bus stop' as the situation if the behavior of the agents are to be getting on or off a bus. ''Non-Spatial situation'' has no region in the environment because this only involves the behavior of the crowd. The relationship of the local agents is an important factor to consider when determining behavior. An example would be a group of friends walking together. Typical behavior of characters that are friends would all move along with each other. This means that 'friendship' would be the situation among the typical behavior of walking together. The structure of any situation is built upon four components, Behavior functions, Sensors, States, and Event Rules. Behavior functions represent what the characters behaviors are specific to the situation. Sensors are the sensing capability for agents to see and respond to events. States are the different motions and state transitions used only for the local behaviors. Event rule is the way to connect different events to their specific behaviors. While a character is being put into a situation, these four components are considered at the same time. For spatial situations, the components are added when the individual initially enters the environment that influences the character. For non-spatial situations, the character is affected only once the user assigns the situation to the character. The four components are removed when the agent is taken away from its situations region or the situation itself is removed. The dynamic adding and removing of the situations lets us achieve scalable agents.Human-like behaviors and crowd AI
To simulate more aspects of human activities in a crowd, more is needed than path and motion planning. Complex social interactions, smart object manipulation, and hybrid models are challenges in this area. Simulated crowd behavior is inspired by the flow of real-world crowds. Behavioral patterns, movement speeds and densities, and anomalies are analyzed across many environments and building types. Individuals are tracked and their movements are documented such that algorithms can be derived and implemented into crowd simulations. Individual entities in a crowd are also called agents. In order for a crowd to behave realistically each agent should act autonomously (be capable of acting independently of the other agents). This idea is referred to as an ''agent-based model.'' Moreover, it is usually desired that the agents act with some degree of intelligence (i.e. the agents should not perform actions that would cause them to harm themselves). For agents to make intelligent and realistic decisions, they should act in accordance with their surrounding environment, react to its changes, and react to the other agents.Rule-based AI
In rule-based AI, virtual agents follow scripts: "if this happens, do that". This is a good approach to take if agents with different roles are required, such as a main character and several background characters. This type of AI is usually implemented with a hierarchy, such as inLearning AI
In learning AI, virtual characters behave in ways that have been tested to help them achieve their goals. Agents experiment with their environment or a sample environment which is similar to their real one. Agents perform a variety of actions and learn from their mistakes. Each agent alters its behavior in response to rewards and punishments it receives from the environment. Over time, each agent would develop behaviors that are consistently more likely to earn high rewards. If this approach is used, along with a large number of possible behaviors and a complex environment agents will act in a realistic and unpredictable fashion.Algorithms
There are a wide variety of machine learning algorithms that can be applied to crowd simulations. Q-Learning is an algorithm residing under machine learning's sub field known as reinforcement learning. A basic overview of the algorithm is that each action is assigned a Q value and each agent is given the directive to always perform the action with the highest Q value. In this case learning applies to the way in which Q values are assigned, which is entirely reward based. When an agent comes in contact with a state, s, and action, a, the algorithm then estimates the total reward value that an agent would receive for performing that state action pair. After calculating this data, it is then stored in the agent's knowledge and the agent proceeds to act from there. The agent will constantly alter its behavior depending on the best Q value available to it. And as it explores more and more of the environment, it will eventually learn the most optimal state action pairs to perform in almost every situation. The following function outlines the bulk of the algorithm: :''Q(s, a) ←− r + maxaQ(s', a')'' Given a state s and action a, r and s are the reward and state after performing (s,a), and a' is the range over all the actions.Crowd rendering and animation
Rendering and animating a large number of agents realistically, especially in real time, is challenging. To reduce the complexity of 3D rendering of large-scale crowds, techniques like culling (discarding unimportant objects), impostors (image-based rendering) and decreasing levels of detail have been used. Variations in appearance, body shape and size, accessories and behavior (social or cultural) exist in real crowds, and lack of variety affects the realism of visual simulations. Existing systems can create virtual crowds with varying texture, color, size, shape and animation.Real world applications
Virtual cinematography
Crowd simulations have been used widely across films as a cost-effective and realistic alternative from hiring actors and capturing shots that would otherwise be unrealistic. A significant example of its use lies inUrban planning
The development of crowd simulation software has become a modern and useful tool in designing urban environments. Whereas the traditional method of urban planning relies on maps and abstract sketches, a digital simulation is more capable of conveying both form and intent of design from architect to pedestrian. For example, street signs and traffic lights are localized visual cues that influence pedestrians to move and behave accordingly. Following this logic, a person is able to move from point A to point B in a way that is efficient and that a collective group of people can operate more effectively as a result. In a broader sense, bus systems and roadside restaurants serve a spatial purpose in their locations through an understanding of human movement patterns. TheEvacuation and riot handling
Simulated realistic crowds can be used in training for riots handling, architecture, safety science (evacuation planning).Military
Being that crowd simulations are so prevalent in use for public planning and general order with regards to chaotic situations, many applications can be drawn for governmental and military simulations. Crowd modeling is essential in police and military simulation in order to train officers and soldiers to deal with mass gatherings of people. Not only do offensive combatants prove to be difficult for these individuals to handle, but noncombatant crowds play significant roles in making these aggressive situations more out of control. Game technology is used in order to simulate these situations for soldiers and technicians to practice their skills.Sociology
The behavior of a modeled crowd plays a prominent role in analytical matters. These dynamics rely on the physical behaviors of individual agents within a crowd rather than the visual reality of the model itself. The social behaviors of people within these constructs have been of interest for many years, and the sociological concepts which underpin these interactions are constantly studied. The simulation of crowds in different situations allows for sociological study of real life gatherings in a variety of arrangements and locations. The variations in human behavior in situations varying in stress-levels allows for the further development and creation of crowd control strategies which can be more specifically applied to situations rather than generalized.See also
*Crowd simulation software
* STEPS byReferences
External links