This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: Institute of Logistics and Aviation, Technische Universität Dresden,
Hettner Str. 1-3, D-01062 Dresden, Germany
{schultz,fricke}@ifl.tu-dresden.de
22institutetext: PTV Planung Transport Verkehr AG,
Stumpfstr. 1, D-76131 Karlsruhe, Germany
tobias.kretz@ptv.de

Solving the Direction Field for Discrete Agent Motion

Michael Schultz 11    Tobias Kretz 22    and Hartmut Fricke 11
Abstract

Models for pedestrian dynamics are often based on microscopic approaches allowing for individual agent navigation. To reach a given destination, the agent has to consider environmental obstacles. We propose a direction field calculated on a regular grid with a Moore neighborhood, where obstacles are represented by occupied cells. Our developed algorithm exactly reproduces the shortest path with regard to the Euclidean metric.

Keywords:
direction field, regular grid, Moore neighborhood, Euclidean metric, error compensation, flood fill, algorithm

1 Distances and Directions

To give robots or simulated pedestrians (agents) their main direction of movement, for at least three decades there have been two main methods: one uses a set of navigation points to steer the agent around obstacles [1], the other one – which this contribution deals with – relies on a grid in which each grid cell holds the information on the walking distance to the destination and/or the direction to move on to be on the shortest or roughly quickest path considering the location of obstacles. This grid is often called a “potential” or a “distance look up table”. An early usage of the notion and method of a potential was made by Khatib [2] in robot motion planning. But this potential did not consider the location of obstacles but just held the bee-line distances from the location of the robot to the destination. This makes sense in the motion planning of autonomous robots, which only have a very limited knowledge of their environment and need an elaborate method to escape dead-ends anyway [3].

The most prominent and most widely used method that calculates Euclidean distances as a numerical solution of the Eikonal equation [4, 5] comparatively fast and with a comparatively small error is the Fast Marching Method (FMM) [6, 7, 8]. Concerning computation time the FMM shows optimal worst-case behavior and the relative error in general decreases with increasing distance from the destination, implying that with a finer grid the error can be reduced. With the change of computing power progress from improving single CPU processing to multi-core computation, slight changes in the algorithm of the up-winding scheme have become useful and recently new methods as for example the Fast Sweeping [9] and the Fast Iterative Method [10] (FSM and FIM) have been introduced. For a study of computation times of such methods see [11] for example.

Apart from optimizing the numerical Eikonal equation solver algorithmically, it’s also possible to trade exactness for computation speed and use simpler methods for the calculation. The two most prominent examples for this are a simple flood fill over common edges or common edges and common corners which lead to metrics in vector norms (1), p=1p=1 (Manhattan metric) or pp\rightarrow\infty (Chebychev metric) respectively.

dpn=xp:=(i=1n|xi|p)1pd^{n}_{p}=\left\|x\right\|_{p}:=\left(\sum^{n}_{i=1}\left|x_{i}\right|^{p}\right)^{\frac{1}{p}} (1)

With Euclidean metric (i.e. vector norm p=2p=2) as correct solution, these methods lead to relative errors which remain constant over distance or even increase, which means that a finer grid size does not improve the precision arbitrarily. However, it is possible to reduce the error by making some slight modifications upon the simple flood fill methods [12]. Just for completeness we want to add that to our knowledge no other than ray tracing methods exist, that are able to reach in general cases the minimal error possible, which is given by the grid resolution [12]. However, with such methods compared to FMM, FSM or FIM normally one pays with a tremendous increase of computation time for a small gain in exactness.

In many models of pedestrian (or robot) dynamics only the desired walking direction (i.e. the gradient of walking distances) but not the walking distances themselves are inputs for the calculation of the dynamics. Therefore in this contribution we put forward a new method to calculate the (in terms of the Euclidean metric) exact walking directions without having to calculate the exact Euclidean walking distances. The method does neither rely on a computation time expensive sorting of distances of currently active cells, nor does it even has the need for the calculation of rather computation-time expensive functions (e.g. square roots). This is achieved on the expense that the method can only be used to calculate directions based on shortest distance and not shortest time [13, 14, 15, 16, 17, 18, 19, 20] and that only the directions but not the distances are calculated exactly regarding to the Euclidean metric.

2 Algorithm

A common practice for creating a distance potential is a flood fill approach. The following flood fill algorithm describes the essential steps for the creation of the potential field (breadth first search algorithm applied for von Neumann neighborhood [21]).

  • The target cell TT is initialized with the distance dT=0d_{T}=0, the other nn cells get the distance dn=d_{n}=\infty.

  • Put TT in a first-in, first-out queue QQ.

  • While cells available in QQ do:
    \rightarrow\ \hskip 28.45274pt poll (get and remove) the first cell (CC) from QQ
    \rightarrow\ \hskip 28.45274pt set CC as center cell
    \rightarrow\ \hskip 28.45274pt for all adjacent cells CnC_{n}:
    \rightarrow\ \hskip 56.9055pt calculate distance to the target cell regarding to the center
             cell dn=min(dn,dC+Δd)d_{n}=\min(d_{n},d_{C}+\Delta d)
    \rightarrow\ \hskip 56.9055pt if dnd_{n} changes, put CnC_{n} in QQ

The distance between adjacent cells depends on the relative position (diagonal or horizontal/vertical). Using a geometry GG, non-accessible cells (e.g. environmental obstacles) possess a distances of Δd=\Delta d=\infty. For Δd\Delta d three different cases exist:

  • \infty

    , if CnC_{n} is a infrastructure cell,

  • 2\sqrt{2}

    , if CnC_{n} is diagonal located regarding to CC, and

  • 11

    , if CnC_{n} is horizontal/vertical located regarding to CC.

In comparison to the Manhattan (quadrant I, see fig. 1), Euclidean (II) and Chebychev (III) metrics, the flood fill approach for Moore neighborhood points out a fourth distance metric (IV):

x:=|Δxi|+2min(|xi|).\left\|x\right\|:=\left|\Delta x_{i}\right|\,+\,\sqrt{2}\ \min(|x_{i}|)\;. (2)

As shown in fig. 1 the presented flood fill metric approximates the Euclidean metric in a roughly way and it tends to overestimate the distance (except at the grid symmetry axes). However, the flood fill approach is often used to create the potential field for agent navigation. The corresponding agent rule is: ”Choose the cell with the closest distance to the target”.

Refer to caption
Figure 1: Distance metric characteristics: transition from black to white corresponds with decreasing potential (left), equipotential lines (right).

3 Direction Field

Despite to the significant deficiency of the flood fill metric, we will demonstrate that this approach can be used for creating a precise direction field [22]. To create a simple direction field DD (represents an array of motion vectors) the distance field is created for a test scenario (see fig. 2). Close inspections of the color-coded distance field at fig. 2 (right) already reveals the distance metric for the Moore neighborhood.

Refer to caption
Figure 2: Test scenario with a centered target and three obstacles (left) together with the corresponding color-coded distance field (decreasing target distance from white to black, right).

The flood fill algorithm stores the shortest target distance for each cell, whereas the cell specific distance always will base on a diagonal or horizontal/vertical located adjacent center cell. The location of the upstream center cell depends on the processing sequence of the adjacent cells, which is defined by the algorithm. To determine the direction field, the derived cell based motion vector points to the particular center cell. Detailed verifications show, that the characteristics of the simple direction field depends on the particular implementation (see fig. 3). First implementations determine the sequence of the adjacent randomly, followed by sequences where the cells are clockwise and counter-clockwise calculated.

As fig. 3 shows, characteristic Moore neighborhood patterns evolve and constantly alternate in steps of π4\frac{\pi}{4}. The change of the sequence form clockwise to counter-clockwise results in a complementing structure (D+DD^{+}\rightarrow D^{-}, fig. 3). Areas those before contain diagonal vectors are now contain horizontal/vertical motion direction vectors. Considering the Moore metric (2) the designated paths are equivalent to their walking distance.

Refer to caption
Figure 3: Different characteristic of simple direction field based on the expansion of the flood fill algorithm. Expanding cells clockwise (D+D^{+}, left) and counter-clockwise (DD^{-}, right).

Each of the previously created direction fields (D+D^{+} and DD^{-}) represents one component of the final direction field. At the first step the cell based motion direction vectors have to be combined, so sequently aligned vectors are summed up to the point where the direction changes (fig. 4, left). Now each particular cell contains a diagonal and a horizontal/vertical direction component (fig. 4, right). The final direction field indicates no directional artifacts and the declared paths are consistent to the Euclidean metric.

Refer to caption
Figure 4: Combining the particular motion direction vectors from D+D^{+} and DD^{-} results in the precise direction field.

4 Summary and Outlook

The proposed algorithm efficiently prevents the directional artifacts by combining two different simple direction fields, which are based on Moore metric distance calculation. Due to the fact, that the flood fill algorithm for creating a distance potential is widely used in agent simulation, our enhanced approach provides a fundamental contribution to existing simulation systems. The introduced direction field is an essential part of the route planning component inside the virtual terminal environment [22] of the Institute of Logistics and Aviation. Future investigations regarding to group dynamic behavior or route planning in the airport terminal environment at normal operations or emergency cases will benefit from our proposed algorithm.

References

  • [1] M. de Berg, M. van Kreveld, M. Overmars, and O. Schwarzkopf, Computational Geometry. Springer, Berlin Heidelberg New York, 1997. ISBN:3-54061-270-X.
  • [2] O. Khatib, “The Potential Field Approach and Operational Space Formulation in Robot Control”, in Adaptive and Learning Systems – Theory and Application, K. Narendra, ed., pp. 367–377. Plenum Press, New York and London, 1986. ISBN:978-0306422638.
  • [3] J.-C. Latombe, Robot Motion Planning. Kluwer Academic Publishers, 7th ed., 1991. ISBN:978-0792391296.
  • [4] H. Bruns, Das Eikonal. S. Hirzel, 1895.
  • [5] P. Frank, “Über die Eikonalgleichung in allgemein anisotropen Medien”, Annalen der Physik 389 (1927) no. 23, .
  • [6] S. Osher and J. Sethian, “Fronts propagating with curvature-dependent speed: algorithms based on Hamilton-Jacobi formulations”, Journal of computational physics 79 (1988) no. 1, 12–49.
  • [7] R. Kimmel and J. Sethian, “Computing geodesic paths on manifolds”, in Proc. Natl. Acad. Sci. USA, pp. 8431–8435. 1998.
  • [8] J. Sethian, Level Set Methods and Fast Marching Methods. Cambridge University Press Cambridge, 1999. ISBN: 978-0521645577.
  • [9] H. Zhao, “A fast sweeping method for eikonal equations”, Mathematics of computation 74 (2005) no. 250, 603–628.
  • [10] W.-K. Jeong and R. Whitaker, “A fast eikonal equation solver for parallel systems”, in SIAM conference on Computational Science and Engineering. 2007.
  • [11] P. Gremaud and C. Kuster, “Computational study of fast methods for the eikonal equation”, SIAM journal on scientific computing 27 (2006) no. 6, 1803–1816.
  • [12] T. Kretz, C. Bönisch, and P. Vortisch, “Comparison of Various Methods for the Calculation of the Distance Potential Field”, in PED 2008, pp. 335–346. Springer-Verlag, Berlin Heidelberg, 2010. ISBN: 978-3-642-04503-5.
  • [13] R. Hughes, “A continuum theory for the flow of pedestrians”, Transportation Research Part B 36 (2002) no. 6, 507–535.
  • [14] S. Hoogendoorn and P. Bovy, “Pedestrian route-choice and activity scheduling theory and models”, Transportation Research Part B 38 (2004) no. 2, 169–190.
  • [15] A. Treuille, S. Cooper, and Z. Popović, “Continuum crowds”, in ACM SIGGRAPH 2006 Papers, p. 1168. 2006.
  • [16] J. Shopf, C. Oat, and J. Barczak, “GPU Crowd Simulation”, ACM Transactions on Graphics, Siggraph Asia 2008 27 (2008) .
  • [17] T. Kretz, “Pedestrian Traffic: on the Quickest Path”, Journal of Statistical Mechanics: Theory and Experiment P03012 (2009) .
  • [18] A. Bleiweiss, “Multi agent navigation on gpu.” Eprint, 2009.
  • [19] B. Steffen and A. Seyfried, “Modeling of pedestrian movement around 90 and 180 degree bends”, in Workshop on Fire Protection and Life Safety in Buildings and Transportation Systems. 2009.
  • [20] T. Kretz, “Applications of the Dynamic Distance Potential Field Method”, in Traffic and Granular Flow ’09, S. Dai et al., ed. 2010. in press.
  • [21] C. Lee, “An algorithm for path connection and its application”, IRE Transactions on Electronic Computers EC-10 (1961) no. 3, 346–365.
  • [22] M. Schultz, Entwicklung eines individuenbasierten Modells zur Abbildung des Bewegungsverhaltens von Passagieren im Flughafenterminal. PhD thesis, Technische Universität Dresden, 2010.