#### Abstract

Creating complex and realistic crowd behaviors, such as pedestrian navigation behavior with dynamic obstacles, is a difficult and time consuming task. In this paper, we study one special type of crowd which is composed of urgent individuals, normal individuals, and normal groups. We use three steps to construct the crowd simulation in dynamic environment. The first one is that the urgent individuals move forward along a given path around dynamic obstacles and other crowd members. An optimal acceleration-velocity-bounded trajectory planning method is utilized to model their behaviors, which ensures that the durations of the generated trajectories are minimal and the urgent individuals are collision-free with dynamic obstacles (e.g., dynamic vehicles). In the second step, a pushing model is adopted to simulate the interactions between urgent members and normal ones, which ensures that the computational cost of the optimal trajectory planning is acceptable. The third step is obligated to imitate the interactions among normal members using collision avoidance behavior and flocking behavior. Various simulation results demonstrate that these three steps give realistic crowd phenomenon just like the real world.

#### 1. Introduction

Crowds, ubiquitous in the real world from groups of humans to flocks of insects, are vital features to model in a virtual environment. The simulation of pedestrians is a difficult challenge that is beginning to capture the attention of researchers and practitioners in evacuation simulation and urban planning. The field of computer graphics, in which virtual human animation has been an important research interest for decades, has contributed technologies fundamental to the computer-assisted visualization, including the automatic animation of pedestrian [1–3]. Until now, various simulation models and architectures have been developed. Whether the behaviors of the crowd are realistic or not has many relations with the methods used in constructing the crowd models. This paper focuses on one special crowd phenomenon which is significant in real world. The crowd which is composed of urgent members and normal ones has the following characteristics: the urgent members are the people who move forward along a fixed, given path for something urgent to do. The normal ones are the people who move in normal ways, just like most of the people in their daily lives. In real world, urgent people do not allow others to get in their way. Consequently, if the normal members are in a predefined range of the urgent ones, the latter will push them away. However, we must ensure that the urgent members are collision-free with the dynamic obstacles in the environment. Moreover, the interactions among the normal members are important issues to improve the authenticity of the crowd behaviors. For this special crowd, all of these propose demands for the studies of its behaviors.

Given the observations in real world, how is it possible that the urgent people can safely navigate through crowds and dynamic obstacles along a predefined path? The key insight is that the urgent people typically engage in moving forward just considering the dynamic obstacle: they push the normal members away from their trajectories to make room for their navigations.

In our work, we have been developing an autonomous, self-animating model of pedestrian crowd capable of performing a broad variety of natural activities in urban dynamic environments. Because the acceleration and velocity of real person are bounded, we have adopted an optimal acceleration-velocity-bounded trajectory planning method in planning area and a comprehensive artificial life approach (e.g., collision avoidance method and flocking method) to addressing the problem of pedestrian behaviors. Our approach is inspired most heavily by the work of Johnson and Hauser [4] on optimal trajectory planning and by Foudil and Noureddine [5] on collision avoidance modeling in crowd simulation with priority rules. Also, Olfati-Saber’s work on flocking model is used for reference [6].

In summary, our main contributions exist in three aspects.(1)Construct the behaviors of the urgent members with an optimal acceleration-velocity-bounded trajectory planning method. This novel method ensures that the urgent members reach their destinations as soon as possible and are collision-free with the dynamic obstacles.(2)Simulate the interactions between the urgent members and the normal ones. A novel pushing model is adopted to ensure that the normal members will not get in the way of the urgent ones. In this way, the normal members will not be treated as dynamic obstacles which promotes that the computational cost of the trajectory planning is acceptable for real time application.(3)Imitate the interactions among the normal members. These interactions play a major role in synthesizing the animations of the crowd. The key insight is that the normal members typically engage in joint collision avoidance: they adapt their moving to each other to make room for navigation. So the collision avoidance behavior and the flocking behavior are exploited.

The above three aspects are combined together to generate realistic behaviors for our special crowd. The components of the crowd are represented in Figure 1.

As illustrated in Figure 1, the crowd behaviors consist of four parts: optimal trajectory planning, pushing model, collision avoidance behavior, and flocking behavior, each of which is responsible for dealing with different interactions. By designing and combining the respective behaviors of these four parts, realistic and complex behavior phenomena are achieved.

The organization of the rest of this paper is as follows. At first, Section 2 describes background and related works in trajectory planning, collision avoidance model, and flocking behavior. In Section 3, we give the detailed process of the optimal acceleration-velocity-bounded trajectory planning method and the pushing model. In Section 4, the collision avoidance model and flocking behavior for crowd simulation are presented briefly. After performing experiments with 3D virtual environments, simulation results and conclusions are stated at the end of this paper.

#### 2. Related Work

In this paper, the behavior of the urgent members is a trajectory planning problem which has a vast difference with path planning. In respect of optimal trajectory planning problem with dynamic constraints in dynamic environments, Fraichard first addressed optimal trajectory planning in dynamic environments, that is, motion planning for robot subject to dynamic constraints and moving in a workspace with moving obstacles [7]. A novel concept of state-time space was introduced and a near-time-optimal trajectory was obtained by searching a set of canonical trajectories. The state-time space for planning in a dynamic environment is the Cartesian product of configuration space and time, that is, . Fraichard defined the canonical trajectories as the ones which had piecewise constant acceleration and changed its value at discrete times [7]. Fiorini and Shiller also presented a two-stage approach to plan a local time-optimal trajectory for a manipulator arm in the dynamic environments [8]. An optimization-based planning was used by Park et al. to handle the planning problem in arbitrary dynamic environments [9]. However, the dynamic constraints were ignored in their work [9]. Fiorini and Shiller presented a global optimal motion planning for Mars Rover which accounted for traversability and dynamic stability [10]. Recently, Maček et al. adopted rapidly exploring random trees and B-splines to develop a collision-free trajectory planning method in dynamic urban-like scenarios. This method can run automatically with the natural acceleration/deceleration phases according to the dynamic obstacles along the predefined path. The advantage of this method is that the vehicle velocities can be searched with a minimum time. Maček et al. have used kinodynamic planning techniques to explore the vehicle’s action space [11]. While these above algorithms are able to find paths as well as velocity profiles, they have the defect of ignoring the acceleration constraint or obtaining near-optimal trajectories.

More recently, Johnson and Hauser have presented an optimal, exact, polynomial-time planner for optimal bounded-acceleration trajectories along a fixed, given path with dynamic obstacles [4]. In their method, the planner uses a velocity interval propagation technique to compute reachable velocity sets at obstacle vertices in the path-time space. In this process, the acceleration and velocity constraints are considered in path-velocity plane. This approach gives us great promotions in fulfillment of this paper to generate the optimal trajectories of urgent members. However, in this method the goal velocity is an interval rather than a fixed value. This is not the case in real life; for example, the goal velocity of the virtual human at the goal position is equal to zero. So the optimal trajectory planning in this paper is more complex and intractable.

In respect of collision avoidance behaviors for individuals and groups, techniques for simulating a crowd as a single entity have been proposed, as well as those which consider each person in the crowd separately. Collision avoidance is one of the crucial problems in crowd simulation. Without collision avoidance, crowd simulation does not look realistic. In crowd simulation, static and dynamic objects are the two types of obstacle that must concern us. The motionless objects can be seen as static obstacles, while dynamic objects refer to human, animals, and vehicles in the urban environments [12]. However, devising collision avoidance behavior among a number of individuals is more complex than designing the one between just two individuals. Morini et al. presented a short-term avoidance algorithm [13]. Aiming at the applications of densely populated urban environment, Tecchia and Chrysanthou proposed a simple and fast collision detection method. In their method, two different approaches for detecting and avoiding collision of the moving objects were used. Feurtey proposed an algorithm for collision avoidance which was planned from their current position to the goal based on the predicting and modifying trajectories. So in their method, the agents could predict their way by using the position and speed information of the obstacles [13]. Musse and Thalmann developed a multiresolution collision avoidance behavior for group interrelationship in multiresolution [14]. Foudil and Noureddine proposed a novel collision avoidance behavior for crowd simulation with priority rules. This method also provides us with great inspirations for our paper to generate various collision avoidance strategies for normal members [5].

In respect of flocking behavior for groups, many researchers used flocking algorithm to model flock, herd, and large crowds of people. Flocking is one of the pioneer techniques used to model a crowd of animals or humans. Flocking is basically composed of three rules: separation-steer away from neighbors and obstacle, cohesion-steer towards the centre of nearby entities, and alignment-steer in the average velocity and direction with the neighbors. In recent years, various distributed control algorithms have been proposed for the motion of multiple dynamic agents and the multiagent systems. For example, the flocking problem with one virtual leader was considered by Shi et al. [15]. Su et al. investigated the problem of controlling a group of autonomous agents to track multiple virtual leaders. They proved that the agents with the same virtual leader attained the same velocity, and the center and average velocity of the whole group converged to the weighted center and average velocity of all the leaders [16]. Olfati-Saber proposed a groundbreaking work on flocking for multiagent dynamic systems. He proposed three types of flocking algorithm. The first one is the basic flocking algorithm with only separation, cohesion, and alignment. Then one single leader agent was added to obtain the second algorithm. His third algorithm was obligated to deal with flocking problem in the presence of multiple obstacles. Also, a systematic method is provided for analyzing the split/rejoin maneuver of flocking [6].

All these above techniques can be seen as the lamp to light up our researches in generating realistic crowd behaviors of this paper.

#### 3. Optimal Acceleration-Velocity-Bounded Trajectory Planning

##### 3.1. Preliminaries

Suppose the virtual humans are simplified into cylinder with a unified radius. It is assumed that they move in the workspace . The configuration of a virtual human is uniquely defined by the triple , where denotes the configuration space. Suppose one urgent individual is given a fixed parameterized geometric path which is a continuous sequence of configurations, that is, a straight line or a curve in the configuration space. In this paper, we assume that must be piecewise of class (a curve is of class if it is differentiable times and if its th derivative is continuous). Because the urgent individual moves along , we can reduce its configuration to a single variable which satisfies . is a time scaling function which assigns value to each time . represents the distance traveled along in which represents the total length of . Moreover, the time scaling should be twice-differentiable and monotonic ( for all ). The twice-differentiability of ensures that the urgent individual’s acceleration is well defined and bounded [17].

The dynamic planning problem occurs in the path-velocity-time state space, that is, space which is denoted as PVT [4]. So, the state of one urgent individual consists of variable , velocity , and time . For a given , the following holds: The dynamic constraints of the urgent individuals must satisfy velocity and acceleration bounds: Substituting (2) into (1), we get the following dynamic constraints on variable : with and . A trajectory defined over in state space is dynamically feasible if and only if (3) and (4) are satisfied at the same time. Then, we say that a goal state is dynamically reachable from initial state if a dynamically feasible trajectory over interval such that and is existed. Note that there is a one-to-one correspondence between the trajectory and its time scaling function .

Let be the set of moving obstacles. Let denote the region of occupied by at time and the region of occupied by at position along . Then the obstacle region in state space is defined as

Obviously, the corresponds to points in space. The trajectory is collision-free if for .

Above all, we can formally state the problem which is to be solved. Let be the start state of and its goal state.

A trajectory is a solution to the problem if and only if(1), , and ,(2) is dynamically feasible and collision-free for and . is the maximal time given for the planner,(3) is a specific value (e.g., ) rather than a velocity interval.

We are interested in finding an exact time-optimal trajectory, that is, a trajectory such that should be minimal. Moreover, is an interval in Johnson’s method rather than a specific value. So the optimal trajectory planning in this paper is more complex and intractable.

##### 3.2. Optimal Acceleration-Velocity-Bounded Trajectory Planning

The method that we have developed in order to solve the above problem is initially motivated by the work described in [4]. We improve Johnson’s method in order to find out the exact time-optimal trajectory between an initial and a specific goal state. The flowchart of our method is illustrated in Figure 2.

Next we will describe every part of Figure 2 in detail.

###### 3.2.1. Compute Reachable Velocity Sets

*(I) Compute Reachable Velocity Sets from One Specified Initial State.* The goal of this section is to facilitate the computing reachable velocity intervals from one specified initial state. Without loss of generality, we suppose the specified initial state is which can be any state in . The dynamically reachable set of velocities from at any point in time is the set of velocities attainable at from via dynamically feasible trajectories. It can be computed in space. In order to simplify the computation, we assume that is a straight line. Then (3) and (4) can be simplified into
Johnson showed that is bounded by at most six curves [4] which are denoted in Figure 3 in our paper.

In Figure 3, parabolic segment (a) corresponds to the process in which firstly takes the minimal acceleration for time and then switches to maximal acceleration for time . It must be noted that the terminal velocity of the process of deceleration and the one of the process of acceleration must satisfy formulation (6). The states on (a) can be formulated as in the following equation: Similarly, parabolic segment (d) corresponds to the process, takes the maximal acceleration for time , and then switches to minimal acceleration for time . The states on (d) can be formulated as Parabolic segment (c) corresponds to the process, takes the maximal acceleration until reaching at the time , progresses with until time elapse, and then decelerates for time . The states on (c) can be formulated as Similarly, parabolic segment (f) corresponds to the process, takes the minimal acceleration until reaching , progresses with until time elapse, and then accelerates for time . The states on (f) can be formulated as Line segment (b) corresponds to the process, takes the minimal acceleration for time , and then switches to maximal acceleration until reaching , finally progressing with until time elapse. The states on (b) can be formulated as Similarly, line segment (e) corresponds to the process, takes the maximal acceleration for time , and then switches to minimal acceleration until reaching , finally progressing with until time elapse. The states on (e) can be formulated as

All these six curves enclose the reachable velocity set from one single initial state which is graphically showed as the shadow region in Figure 3.

*(II) Compute Reachable Velocity Interval at a Point in ** Space from **.* After obtaining the reachable velocity set in space, we can then compute the reachable velocity interval at a point in space from the initial state . We use to represent the reachable velocity interval at . We use to compute in the following formulation:
in which and represent the upper and lower bounds of velocity interval , respectively. is defined as the intersection of a boundary curve of with .

We only need to consider three boundary cures in computing (curves (a), (b), and (f)) and (curves (c), (d), and (e)), as illustrated in Figure 4.

In this process, we determine the switching time by substituting into (8), (11), and (12) for and (9), (10), and (13) for , respectively, and solving the resulting quadratic equation. At the same time, the constraints in (8)~(13) are validated to determine if some trajectories exist from to .

*(III) VIP Algorithm Computing Reachable Velocity Interval from an Initial Velocity Interval.* After computing the reachable velocity interval from an initial specified velocity, we can extend it to compute the reachable velocity interval from an initial velocity interval which forms the backbone of optimal trajectory planner. It takes and a target point in space as input. It outputs a range of target velocities reachable from . is computed in the following steps.

*Step 1. *Compute the reachable velocity interval for initial velocity from .

*Step 2. *Compute the reachable velocity interval for initial velocity from .

*Step 3. *The goal of this step is maximizing the terminal velocity at . It does so by constructing a parabolic trajectory with acceleration that interpolates and . If the initial velocity of this interpolating parabolic trajectory belongs to , then .

*Step 4. *The goal of this step is minimizing the terminal velocity at . It also does so by constructing a parabolic trajectory with acceleration that interpolates and . If the initial velocity of this interpolating parabolic trajectory belongs to , then .

*Step 5. *Finally, the output velocity interval . Note that either , , , or may be empty.

Because the goal of the method in this section is propagating the velocity intervals, from one velocity interval to the other as long as we know the initial and terminal point in space, we call this method velocity interval propagation (VIP algorithm). Steps 1~4 can be represented as in short.

###### 3.2.2. Computing the Optimal Trajectory

Suppose there are dynamic obstacles in the environment; then only vertices are important to our optimal planning which correspond to the upper left and lower right vertex of the obstacles [4]. Let be the sequence of upper left and lower right obstacle vertices such that for all . Then we sort these vertices by increasing coordinate and denote and . Our planner consists of four stages.

In the first stage, using the VIP algorithm, we can get the velocity interval from any vertex of one dynamic obstacle to any vertex of another one for ; that is, we carry out for all .

In the second stage, we get channels and terminal velocity intervals of these channels. These terminal velocity intervals can be merged into velocity intervals corresponding to the vertices with union operation.

In the third stage, we use VIP algorithm to connect with by taking these velocity intervals as input to determine the terminal velocity interval at given terminal time. We use discrete to represent the given terminal time:

Then we can get the terminal velocity interval at every given terminal time by calling .

In the fourth stage, we judge if is in these terminal velocity intervals or not. If true, we return the trajectory with minimal terminal time which is the optimal trajectory and its final velocity equals . If not, the planner returns failure. It means that no trajectory exists between the initial state and the goal state of which satisfies the dynamic constraints and is collision-free with dynamic obstacles.

*Complexity Analysis*. The computational cost of the planner mainly comes from the first and the third stage. In the first stage, we must call the VIP algorithm for times. In the third stage, VIP algorithm is called times. Then the complexity of our planner is which is equivalent to . This computational cost is vast for big values. However, there are only several dynamic obstacles in our environment and this is why we apply pushing behavior to deal with the interaction between the urgent members and the normal members.

##### 3.3. Pushing Model

Pushing model is used to model the interactions between the urgent members and the normal ones; that is, the normal members will be pushed away when they are in a predefined range of the urgent ones. We use the four following rules to model pushing behavior between any normal individual and urgent one : in which denotes the distance between and . represents the threshold of the interaction distance. represents the velocity of at the direction of vector . represents the velocity of at the perpendicular direction of vector . indicates the maximal velocity at which a normal individual moves. And represents the velocity of before the interaction between and happens.

This novel pushing model ensures that the urgent members will never collide with the normal ones. So we do not need to consider the normal members in the process of optimal trajectory planning whose cost time will greatly reduce owing to only the dynamic obstacles being considered.

#### 4. Collision Avoidance Behaviors and Flocking Behaviors

##### 4.1. Collision Avoidance Behaviors

In this section, we present the collision avoidance behaviors on the basis of Foudil and Noureddine’s work. As a general approach, this method can be combined with different crowd and multiagent simulation algorithms. In each time step of the simulation, we need to predict if every agent will collide with other agents in the crowd. Then we must determine the type of collision which may happen. In real life, there are three possible types of collision [5]. The first type is* toward collision behavior*. It happens when two agents are moving head-on toward each other. The second one is* away collision*. It happens when one agent who is behind the other one is moving with a bigger velocity and whose moving direction is consistent with the line from the back agent to the front one. The third collision behavior is* glancing collision* which happens when two agents are walking in roughly the same direction.

These three types of collision behaviors are shown in Figure 5.

**(a) Toward collision**

**(b) Away collision**

**(c) Glancing collision**

We use a series of rules to realize these three collision avoidance behaviors separately. In* toward collision behavior*, we use the following strategy to avoid the forthcoming collision: the agent who has a low priority can select waiting or changing its moving direction and the agent who has an upper priority selects keeping its moving on with unchanged direction and velocity. In respect to* away collision*, the back agent can select slowing its velocity or changing its moving direction to any side. We deal with* glancing collision* with the same manner as the* toward collision behavior.*

Particularly, when these three collision avoidance behaviors conflict with each other, we resolve this problem by predefining the priority order of them. In this paper, the priority order of these three types of collision avoidance behaviors is toward collision, away collision, and glancing collision from high to low.

##### 4.2. Flocking Behaviors

Flocking behaviors are used to model the collective gathering behaviors of the normal groups. Aiming at the agents group consisting of one leader agent and follower ones, we use a distributed control method to simulate the flocking behavior [15, 16]. The motion of each virtual agent is described by two integrators as where , , and are denoted as the position, velocity, and acceleration of agent , respectively. Similarly, the virtual leader has the following dynamics of motion: where , , and represent the position, velocity, and acceleration of leader agent, respectively. The control algorithm of the flocking method is given as where is the set of spatial neighbors of agent . represents the interaction range. is the Euclidean norm and for a vector . is the artificial nonnegative smooth pairwise potential function whose characteristics depend on the relative distances between agent and its neighbors: reaches its maximal value as , and acquires its unique minimal value at a predefined distance . When , agent attains repulsion force from by . When , the repulsion force and attraction force between and become balance. When , agent attains attraction force from . And when , becomes constant; then no force exists between and . and are positive constants which reflect the influence degree from leader’s position and velocity. is the adjacent weight coefficient.

#### 5. Experimental Results and Discussion

In our simulation, we employ a human animation software package called DI-Guy, which is commercially available from Boston Dynamics Inc. We control the moving of the urgent members and normal members using SDK interface by C++ programs. The scenario can be depicted as follows: in a city populated with a majority of civilians and 2 moving cars. The civilians consist of three urgent individuals and 50 normal members comprising 30 normal individuals and 2 normal groups with 10 members, respectively. The cars’ moving characteristics are known previously. The priority values of the 50 normal agents are selected randomly from the interval . The interaction range and the predefined distance . The values of and are set the same as those in [6], and , , and . The dynamic environment of the experiments is depicted in Figure 6.

In Figure 6, we set and . Length of the specified paths of urgent individuals is and and . The first dynamic obstacle (moving cars) moves at a constant speed of (Car1) and the second moves at a constant speed of (Car2). The spaces of the three urgent individuals in the dynamic environment are depicted in Figure 7.

**(a) Urgent individual 1**

**(b) Urgent individual 2**

**(c) Urgent individual 3**

Figure 8 illustrates the reachable sets and the optimal trajectory for each urgent individual.

**(a) Urgent individual 1**

**(b) Urgent individual 2**

**(c) Urgent individual 3**

The visualization simulation results of the crowd behaviors in 3D space are illustrated in Figure 9.

(a) |

(b) |

(c) |

(d) |

From Figure 8, we can see that the gradient in space is which means that the terminal velocity of the urgent individual is zero, and this satisfies the requirement of the problem definition in Section 3.1; for example, in Figure 8(b), urgent individual 2 takes the maximal acceleration until reaching A point before Car1 arrives at his path and then switches to deacceleration for the path A-B in case of colliding with Car2. After that, he continues to take the maximal acceleration for path B-C and then deaccelerates to zero from C point to the terminal point of the whole path. Figure 9 depicts realistic and believable crowd behaviors in city environment: the urgent individual can reach the destination along a given path in minimal time and be collision-free with dynamic cars. Simultaneously, the agents of the two normal groups show real gathering behaviors according to the flocking method and the normal individuals try to keep away from the urgent ones and avoid collision with each other.

The computation cost of our approach is illustrated in Figure 10 when we change the numbers of the dynamic obstacles. Similarly, Figure 11 depicts the cost time of our approach according to the number of the normal members in the crowd.

From Figure 10, we can see that the cost time of our approach is influenced vastly by the number of dynamic obstacles in the environment. However the experiment results in Figure 11 show that the cost time of our approach changes slightly according to the number of the normal members. This means that the increase in the number of the normal members does not generate much computational cost. And all the above results are in accordance with previous analyses.

#### 6. Conclusions

Although there have been some research studies on optimal trajectory planning for various purposes, few efforts have been conducted to simulate the realistic crowd behaviors with it, such as pedestrian navigation behavior in dynamic environment. In this paper, we first present an optimal acceleration-velocity-bounded trajectory planning method along a fixed, given path with dynamic obstacles. We use it to generate the optimal trajectory of the urgent members under the dynamic constraints. This planner ensures that the moving time of the urgent members is minimal by using a velocity interval propagation algorithm to compute reachable velocity sets at obstacle vertices in space. Moreover, the cost time of this optimal trajectory planning method is acceptable by applying a novel pushing model. Finally, combining with the collision avoidance behavior and the flocking behavior, the crowd simulation with dynamic vehicles is implemented. So, the potential of our approach for planning the optimal trajectories and modeling the social behaviors of the crowd is promising.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

#### Acknowledgment

This paper is supported by the National Natural Science Foundation of China (Grant nos. 61170160 and 61374185).