+ All Categories
Home > Science > The Latest on Boids Research - October 2014

The Latest on Boids Research - October 2014

Date post: 06-Apr-2017
Category:
Upload: olaf-witkowski
View: 654 times
Download: 2 times
Share this document with a friend
37
The Latest on Boid Research: A Short Review in 5 Points Olaf @ Ikegami Lab October 2014 By tapping into social cues, individuals in a group may gain access to higher-order computational capacities that mirror the group’s responses to its environment.
Transcript
Page 1: The Latest on Boids Research - October 2014

The Latest on Boid Research: A Short Review in 5 Points

Olaf @ Ikegami Lab October 2014

By tapping into social cues, individuals in a group may gain access to higher-order computational capacities that mirror the group’s responses to its environment.

Page 2: The Latest on Boids Research - October 2014

Synchrony, Coordination, Collective Behavior

2

Page 3: The Latest on Boids Research - October 2014

Models, Algorithms [1/5]

3

Page 4: The Latest on Boids Research - October 2014

Algorithms Modeling Collective Behavior

4

Vicsek/SPP ModelBoids

Bat AlgorithmAnt Colony Crowd Management

Page 5: The Latest on Boids Research - October 2014

• Cancer systems are capable of developing multicellular collective patterns that resemble evolved adaptive behavior known from other biological systems including collective sensing of environmental conditions and collective decision-making (Deisboek & Couzin 2009)

A Word On Unexpected Applications

5

highly relevant to understanding the interactions of tumor

cell populations. In addition, we argue that similarities

among these systems go beyond mere analogy and

instead we can begin to make testable predictions about

the types, and consequences, of collective behavior within

tumors.

Chemical feedback processes and collective

migration in tumors

A crucial and ubiquitous form of collective communication in

animal groups arises from the interplay of processes that

result in amplification and decay of information. Consider, for

Figure 1. (A) Social caterpillars (image courtesy of Trond Larsen), cf. (B) Multicellular patterns that emerge in a confluent human glioma cellculture in vitro. Note the resemblance of the two complex patterns, although the characteristic length-scale of the two systems is distinctivelydifferent (i.e., a social caterpillar measures several millimeters in length, whereas the diameter of tumor cells ismeasured inmicrometers). (C) Anttrails that originate from the nest (bright spot on the left) to sugar drops (four) deposited on the right (from digital tracking of ants by I. D. C.).(D) Invasive cell branches that originate from a (top left) glioma spheroid in vitro (3D extracellular matrix assay using MatrigelTM(8), used also asbasis for computational cancer modeling works(70,71)). (E) Microscopic image of a confluent human glioma cell culture in vitro. Note the alignmentof multiple cancer cells (within the broken lines), as compared to the rest of the cell culture.

T. S. Deisboeck and I. D. Couzin Problems and paradigms

BioEssays 31:190–197, ! 2009 WILEY Periodicals, Inc. 191

highly relevant to understanding the interactions of tumor

cell populations. In addition, we argue that similarities

among these systems go beyond mere analogy and

instead we can begin to make testable predictions about

the types, and consequences, of collective behavior within

tumors.

Chemical feedback processes and collective

migration in tumors

A crucial and ubiquitous form of collective communication in

animal groups arises from the interplay of processes that

result in amplification and decay of information. Consider, for

Figure 1. (A) Social caterpillars (image courtesy of Trond Larsen), cf. (B) Multicellular patterns that emerge in a confluent human glioma cellculture in vitro. Note the resemblance of the two complex patterns, although the characteristic length-scale of the two systems is distinctivelydifferent (i.e., a social caterpillar measures several millimeters in length, whereas the diameter of tumor cells ismeasured inmicrometers). (C) Anttrails that originate from the nest (bright spot on the left) to sugar drops (four) deposited on the right (from digital tracking of ants by I. D. C.).(D) Invasive cell branches that originate from a (top left) glioma spheroid in vitro (3D extracellular matrix assay using MatrigelTM(8), used also asbasis for computational cancer modeling works(70,71)). (E) Microscopic image of a confluent human glioma cell culture in vitro. Note the alignmentof multiple cancer cells (within the broken lines), as compared to the rest of the cell culture.

T. S. Deisboeck and I. D. Couzin Problems and paradigms

BioEssays 31:190–197, ! 2009 WILEY Periodicals, Inc. 191

highly relevant to understanding the interactions of tumor

cell populations. In addition, we argue that similarities

among these systems go beyond mere analogy and

instead we can begin to make testable predictions about

the types, and consequences, of collective behavior within

tumors.

Chemical feedback processes and collective

migration in tumors

A crucial and ubiquitous form of collective communication in

animal groups arises from the interplay of processes that

result in amplification and decay of information. Consider, for

Figure 1. (A) Social caterpillars (image courtesy of Trond Larsen), cf. (B) Multicellular patterns that emerge in a confluent human glioma cellculture in vitro. Note the resemblance of the two complex patterns, although the characteristic length-scale of the two systems is distinctivelydifferent (i.e., a social caterpillar measures several millimeters in length, whereas the diameter of tumor cells ismeasured inmicrometers). (C) Anttrails that originate from the nest (bright spot on the left) to sugar drops (four) deposited on the right (from digital tracking of ants by I. D. C.).(D) Invasive cell branches that originate from a (top left) glioma spheroid in vitro (3D extracellular matrix assay using MatrigelTM(8), used also asbasis for computational cancer modeling works(70,71)). (E) Microscopic image of a confluent human glioma cell culture in vitro. Note the alignmentof multiple cancer cells (within the broken lines), as compared to the rest of the cell culture.

T. S. Deisboeck and I. D. Couzin Problems and paradigms

BioEssays 31:190–197, ! 2009 WILEY Periodicals, Inc. 191

highly relevant to understanding the interactions of tumor

cell populations. In addition, we argue that similarities

among these systems go beyond mere analogy and

instead we can begin to make testable predictions about

the types, and consequences, of collective behavior within

tumors.

Chemical feedback processes and collective

migration in tumors

A crucial and ubiquitous form of collective communication in

animal groups arises from the interplay of processes that

result in amplification and decay of information. Consider, for

Figure 1. (A) Social caterpillars (image courtesy of Trond Larsen), cf. (B) Multicellular patterns that emerge in a confluent human glioma cellculture in vitro. Note the resemblance of the two complex patterns, although the characteristic length-scale of the two systems is distinctivelydifferent (i.e., a social caterpillar measures several millimeters in length, whereas the diameter of tumor cells ismeasured inmicrometers). (C) Anttrails that originate from the nest (bright spot on the left) to sugar drops (four) deposited on the right (from digital tracking of ants by I. D. C.).(D) Invasive cell branches that originate from a (top left) glioma spheroid in vitro (3D extracellular matrix assay using MatrigelTM(8), used also asbasis for computational cancer modeling works(70,71)). (E) Microscopic image of a confluent human glioma cell culture in vitro. Note the alignmentof multiple cancer cells (within the broken lines), as compared to the rest of the cell culture.

T. S. Deisboeck and I. D. Couzin Problems and paradigms

BioEssays 31:190–197, ! 2009 WILEY Periodicals, Inc. 191

Page 6: The Latest on Boids Research - October 2014

Boids: Some Old, Some New [2/5]

6

Page 7: The Latest on Boids Research - October 2014

Original Boids (Reynolds 1986)

7

UNCORRECTED PROOFS

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061

6263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122

C. HARTMAN AND B. BENES...........................................................................................

Figure 3. Example of extreme flocking (left), high separation of boids (middle), and alignment (right).

There is a special case when no boid is aroundthe bi and m = 0. In this case the Equation (2) is notdefined; no cohesion is applied; and, its result is the zerovector ki = o.

Alignment

The last steering force, alignment, or velocity matching,is important for the boids to follow an impetus. Boidstend to align with the velocity of their flockmates. Thissteer is denoted by mi and is calculated as the averagevelocity of the visible flockmates

mi =!

∀bj∈Vi

vj

m. (4)

The velocity speed is the size of the vector. Therefore,the boids will automatically slow down or speed up de-pending on their flockmates. If a boid accelerates toomuch it can jump out of the visibility sphere of the flock-mates and eventually escape.

If there is no boid directly visible, the cardinality of Vi

is equal to zero and mi = o.

Combining the Steers

All the steers are combined into one resulting influence.Let us recall that the vectors are separation si, cohesionki, and alignment mi. The new position p′

i of the boid inthe time t + !t is calculated from its velocity vi and theprevious position as

p′i = pi + !tvi.

To reflect the steering forces the velocity is first updatedcorrespondingly

v′i = vi + S.si + K.ki + M.mi,

where S, K, and M are coefficients describing influenceof each force. These coefficients are set by the user andare global to the flock.

Figure 3 shows examples of flocking based on differentparameters.

Swarm behavior can be obtain by setting the velocitymatching (alignment) to zero.

The values of the parameters S, K, and M should bewithin the range ⟨0, 1⟩. The key factor for correct flockbehavior is its initializations. The initial velocity shouldbe ‘reasonable’ as well as the flock initial distribution.Ideally each boid should be visible by at least one boid.In this way each boid will indirectly influence each otherand the flock will not break into parts. Also, if the ini-tial speed is too high, the flock can eventually break intoparts. We have found that setting the initial velocity tozero and letting the simulation to run for a while helpsthe system to find a stable configuration.

Leadership

The new contribution to the flocking algorithm is thechange of leadership. As mentioned above, boids with-out an external force such as a leader, a global aim, ora direction of the flight, will find optimal configurationin the three-dimensional space and stay still, oscillate, orform obvious visual patterns.

This does not correspond to observations of real flocks.Birds ‘play a game’ in which a random leaders shoot-offfrom the flock and the others bird pursuit him. The flockfollows the runaway and then absorbs him back into theflock.

The change in leadership is evaluated across the visi-bility sphere of each boid. As a result, only a local flock-mates are considered. A boid inside a dense flock will nottake the leadership, because it cannot see a clear spaceto fly. Boids on the edge of the crowd will have higher

............................................................................................Copyright © 2006 John Wiley & Sons, Ltd. 4 Comp. Anim. Virtual Worlds 2006; 17: 1–8

UNCORRECTED PROOFS

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061

6263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122

C. HARTMAN AND B. BENES...........................................................................................

Figure 3. Example of extreme flocking (left), high separation of boids (middle), and alignment (right).

There is a special case when no boid is aroundthe bi and m = 0. In this case the Equation (2) is notdefined; no cohesion is applied; and, its result is the zerovector ki = o.

Alignment

The last steering force, alignment, or velocity matching,is important for the boids to follow an impetus. Boidstend to align with the velocity of their flockmates. Thissteer is denoted by mi and is calculated as the averagevelocity of the visible flockmates

mi =!

∀bj∈Vi

vj

m. (4)

The velocity speed is the size of the vector. Therefore,the boids will automatically slow down or speed up de-pending on their flockmates. If a boid accelerates toomuch it can jump out of the visibility sphere of the flock-mates and eventually escape.

If there is no boid directly visible, the cardinality of Vi

is equal to zero and mi = o.

Combining the Steers

All the steers are combined into one resulting influence.Let us recall that the vectors are separation si, cohesionki, and alignment mi. The new position p′

i of the boid inthe time t + !t is calculated from its velocity vi and theprevious position as

p′i = pi + !tvi.

To reflect the steering forces the velocity is first updatedcorrespondingly

v′i = vi + S.si + K.ki + M.mi,

where S, K, and M are coefficients describing influenceof each force. These coefficients are set by the user andare global to the flock.

Figure 3 shows examples of flocking based on differentparameters.

Swarm behavior can be obtain by setting the velocitymatching (alignment) to zero.

The values of the parameters S, K, and M should bewithin the range ⟨0, 1⟩. The key factor for correct flockbehavior is its initializations. The initial velocity shouldbe ‘reasonable’ as well as the flock initial distribution.Ideally each boid should be visible by at least one boid.In this way each boid will indirectly influence each otherand the flock will not break into parts. Also, if the ini-tial speed is too high, the flock can eventually break intoparts. We have found that setting the initial velocity tozero and letting the simulation to run for a while helpsthe system to find a stable configuration.

Leadership

The new contribution to the flocking algorithm is thechange of leadership. As mentioned above, boids with-out an external force such as a leader, a global aim, ora direction of the flight, will find optimal configurationin the three-dimensional space and stay still, oscillate, orform obvious visual patterns.

This does not correspond to observations of real flocks.Birds ‘play a game’ in which a random leaders shoot-offfrom the flock and the others bird pursuit him. The flockfollows the runaway and then absorbs him back into theflock.

The change in leadership is evaluated across the visi-bility sphere of each boid. As a result, only a local flock-mates are considered. A boid inside a dense flock will nottake the leadership, because it cannot see a clear spaceto fly. Boids on the edge of the crowd will have higher

............................................................................................Copyright © 2006 John Wiley & Sons, Ltd. 4 Comp. Anim. Virtual Worlds 2006; 17: 1–8

UNCORRECTED PROOFS

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061

6263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122

C. HARTMAN AND B. BENES...........................................................................................

Figure 3. Example of extreme flocking (left), high separation of boids (middle), and alignment (right).

There is a special case when no boid is aroundthe bi and m = 0. In this case the Equation (2) is notdefined; no cohesion is applied; and, its result is the zerovector ki = o.

Alignment

The last steering force, alignment, or velocity matching,is important for the boids to follow an impetus. Boidstend to align with the velocity of their flockmates. Thissteer is denoted by mi and is calculated as the averagevelocity of the visible flockmates

mi =!

∀bj∈Vi

vj

m. (4)

The velocity speed is the size of the vector. Therefore,the boids will automatically slow down or speed up de-pending on their flockmates. If a boid accelerates toomuch it can jump out of the visibility sphere of the flock-mates and eventually escape.

If there is no boid directly visible, the cardinality of Vi

is equal to zero and mi = o.

Combining the Steers

All the steers are combined into one resulting influence.Let us recall that the vectors are separation si, cohesionki, and alignment mi. The new position p′

i of the boid inthe time t + !t is calculated from its velocity vi and theprevious position as

p′i = pi + !tvi.

To reflect the steering forces the velocity is first updatedcorrespondingly

v′i = vi + S.si + K.ki + M.mi,

where S, K, and M are coefficients describing influenceof each force. These coefficients are set by the user andare global to the flock.

Figure 3 shows examples of flocking based on differentparameters.

Swarm behavior can be obtain by setting the velocitymatching (alignment) to zero.

The values of the parameters S, K, and M should bewithin the range ⟨0, 1⟩. The key factor for correct flockbehavior is its initializations. The initial velocity shouldbe ‘reasonable’ as well as the flock initial distribution.Ideally each boid should be visible by at least one boid.In this way each boid will indirectly influence each otherand the flock will not break into parts. Also, if the ini-tial speed is too high, the flock can eventually break intoparts. We have found that setting the initial velocity tozero and letting the simulation to run for a while helpsthe system to find a stable configuration.

Leadership

The new contribution to the flocking algorithm is thechange of leadership. As mentioned above, boids with-out an external force such as a leader, a global aim, ora direction of the flight, will find optimal configurationin the three-dimensional space and stay still, oscillate, orform obvious visual patterns.

This does not correspond to observations of real flocks.Birds ‘play a game’ in which a random leaders shoot-offfrom the flock and the others bird pursuit him. The flockfollows the runaway and then absorbs him back into theflock.

The change in leadership is evaluated across the visi-bility sphere of each boid. As a result, only a local flock-mates are considered. A boid inside a dense flock will nottake the leadership, because it cannot see a clear spaceto fly. Boids on the edge of the crowd will have higher

............................................................................................Copyright © 2006 John Wiley & Sons, Ltd. 4 Comp. Anim. Virtual Worlds 2006; 17: 1–8

UNCORRECTED PROOFS

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061

6263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122

AUTONOMOUS BOIDSQ1

...........................................................................................

Boids

In this section we will describe the implementation ofboids that is based on Reynold’s original paper of Ref-erence [1]. The entire flock is made up of the set B of n

boids bi,

B = {bi, i = 0, 1, . . . , n − 1}.

Each boid has a set of the following attributes: positionpi, velocity vi, the up-vector ui, and the three steeringforces (separation, cohesion, and alignment). The forcesare described in detail in the following text.

An important aspect in the algorithm is the boid’s vi-sion. Boids have limited vision that is defined by a vari-able that corresponds approximately to the five times theboid’s size. Every boid has associated a visibility sphereand everything that is inside is visible by the boid. Thisvariable can be set by the user and it is a global parameterthat is equal for every boid in the flock and it is denotedby e. Let us denote the set of boids inside the sphere ofvisibility of the i−th boid by Vi. The entire visible set isthen described as:

Vi = {bj ∈ B; ∀bj : |bi − bj| < e, j = 0, 1, . . . , m − 1},

where m is the number of the boids visible by the ith boid.In next section the three steers are described.

Separation

Every member of a crowd tends to avoid collision with itsneighbors. This tendency is called separation or collisionavoidance. It steers a boid to avoid overcrowding thelocal flockmates. If only this steering force is applied theflock will dissipate.

There are many ways how this force can be imple-mented. A simple but efficient solution is depicted inFigure 1Q2. Vectors defined by the position of the boid bi

and each visible boid bj are summed and the separationsteer, denoted by si, is calculated as the negative sum ofthese vectors:

si = −!

∀bj∈Vi

"pi − pj

#. (1)

Cohesion

Cohesion, or flock centering, is the steering force whichmoves a boid toward the center of the visible flock. It actsas the complement to the separation (see in Figure 2). If

Figure 1. Separation si is expressed as the sum of all vectorcorresponding to the oriented lines pi, pj . The visible boids aredenoted by the cross. The boids not directly visible by the bi aredepicted by the empty circles. The boid bi is described by the

full circle and its position is denoted by pi.

only this steer is applied, the flockmates will merge into

Q1

one single position. Cohesion of the boid bi is denoted byki and is calculated in two steps.

First, the center of the directly visible set Vi is calcu-lated. This center is denoted by ci and corresponds to thecenter of density of all visible boids:

ci =!

∀bj∈Vi

pj

m. (2)

The tendency of the boid bi to navigate toward thecenter of density of the visible flock Vi is calculated asthe cohesion displacement vector ki:

Q2

ki = ci − pi (3)

Figure 2. Cohesion ki is calculated as the vector pointing tothe center ci (denoted by the black square) of the flock of visible

boids.

............................................................................................Copyright © 2006 John Wiley & Sons, Ltd. 3 Comp. Anim. Virtual Worlds 2006; 17: 1–8

UNCORRECTED PROOFS

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061

6263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122

AUTONOMOUS BOIDSQ1

...........................................................................................

Boids

In this section we will describe the implementation ofboids that is based on Reynold’s original paper of Ref-erence [1]. The entire flock is made up of the set B of n

boids bi,

B = {bi, i = 0, 1, . . . , n − 1}.

Each boid has a set of the following attributes: positionpi, velocity vi, the up-vector ui, and the three steeringforces (separation, cohesion, and alignment). The forcesare described in detail in the following text.

An important aspect in the algorithm is the boid’s vi-sion. Boids have limited vision that is defined by a vari-able that corresponds approximately to the five times theboid’s size. Every boid has associated a visibility sphereand everything that is inside is visible by the boid. Thisvariable can be set by the user and it is a global parameterthat is equal for every boid in the flock and it is denotedby e. Let us denote the set of boids inside the sphere ofvisibility of the i−th boid by Vi. The entire visible set isthen described as:

Vi = {bj ∈ B; ∀bj : |bi − bj| < e, j = 0, 1, . . . , m − 1},

where m is the number of the boids visible by the ith boid.In next section the three steers are described.

Separation

Every member of a crowd tends to avoid collision with itsneighbors. This tendency is called separation or collisionavoidance. It steers a boid to avoid overcrowding thelocal flockmates. If only this steering force is applied theflock will dissipate.

There are many ways how this force can be imple-mented. A simple but efficient solution is depicted inFigure 1Q2. Vectors defined by the position of the boid bi

and each visible boid bj are summed and the separationsteer, denoted by si, is calculated as the negative sum ofthese vectors:

si = −!

∀bj∈Vi

"pi − pj

#. (1)

Cohesion

Cohesion, or flock centering, is the steering force whichmoves a boid toward the center of the visible flock. It actsas the complement to the separation (see in Figure 2). If

Figure 1. Separation si is expressed as the sum of all vectorcorresponding to the oriented lines pi, pj . The visible boids aredenoted by the cross. The boids not directly visible by the bi aredepicted by the empty circles. The boid bi is described by the

full circle and its position is denoted by pi.

only this steer is applied, the flockmates will merge into

Q1

one single position. Cohesion of the boid bi is denoted byki and is calculated in two steps.

First, the center of the directly visible set Vi is calcu-lated. This center is denoted by ci and corresponds to thecenter of density of all visible boids:

ci =!

∀bj∈Vi

pj

m. (2)

The tendency of the boid bi to navigate toward thecenter of density of the visible flock Vi is calculated asthe cohesion displacement vector ki:

Q2

ki = ci − pi (3)

Figure 2. Cohesion ki is calculated as the vector pointing tothe center ci (denoted by the black square) of the flock of visible

boids.

............................................................................................Copyright © 2006 John Wiley & Sons, Ltd. 3 Comp. Anim. Virtual Worlds 2006; 17: 1–8

Page 8: The Latest on Boids Research - October 2014

Original Boids (Reynolds 1986)

8

Page 9: The Latest on Boids Research - October 2014

Adding New Forces

• Mataric (1992) proposes a generalization with a weighted combination of 6 interaction primitives:

9

• collision avoidance

• following

• dispersion

• aggregation

• homing

• flocking

Page 10: The Latest on Boids Research - October 2014

Adding New Forces

• Hartman & Benes (2006) introduce a complementary alignment, representing the chance to become a leader and try to escape

10

a) b)

c) d)

e) f)

Figure 7: a) Boids are simplified by spheres with the heading vector and their traces are

showed. The image shows the outside view and the image b) the boid’s view. The image c)

is the outside view and the image d) is the boid’s view from the simulation of the change of

the leadership. The image e) shows a small flock of boids with a change in leadership and

the image f) shows a trace of a flock of 250 birds

26

a) b)

c) d)

e) f)

Figure 7: a) Boids are simplified by spheres with the heading vector and their traces are

showed. The image shows the outside view and the image b) the boid’s view. The image c)

is the outside view and the image d) is the boid’s view from the simulation of the change of

the leadership. The image e) shows a small flock of boids with a change in leadership and

the image f) shows a trace of a flock of 250 birds

26

a) b)

c) d)

e) f)

Figure 7: a) Boids are simplified by spheres with the heading vector and their traces are

showed. The image shows the outside view and the image b) the boid’s view. The image c)

is the outside view and the image d) is the boid’s view from the simulation of the change of

the leadership. The image e) shows a small flock of boids with a change in leadership and

the image f) shows a trace of a flock of 250 birds

26

a) b)

c) d)

e) f)

Figure 7: a) Boids are simplified by spheres with the heading vector and their traces are

showed. The image shows the outside view and the image b) the boid’s view. The image c)

is the outside view and the image d) is the boid’s view from the simulation of the change of

the leadership. The image e) shows a small flock of boids with a change in leadership and

the image f) shows a trace of a flock of 250 birds

26

a) b)

c) d)

e) f)

Figure 7: a) Boids are simplified by spheres with the heading vector and their traces are

showed. The image shows the outside view and the image b) the boid’s view. The image c)

is the outside view and the image d) is the boid’s view from the simulation of the change of

the leadership. The image e) shows a small flock of boids with a change in leadership and

the image f) shows a trace of a flock of 250 birds

26

a) b)

c) d)

e) f)

Figure 7: a) Boids are simplified by spheres with the heading vector and their traces are

showed. The image shows the outside view and the image b) the boid’s view. The image c)

is the outside view and the image d) is the boid’s view from the simulation of the change of

the leadership. The image e) shows a small flock of boids with a change in leadership and

the image f) shows a trace of a flock of 250 birds

26

Page 11: The Latest on Boids Research - October 2014

Change of Leadership

• Since Hartman & Benes, many attempt to study leadership. Many are either engineering-oriented, or based on informed agents or assigned leadership

• Cucker & Huepe (2008) make a laplacian model with a consensus term that balances the trade-off between informed preference and desire for social interaction

• Su et al. (2009) use a position-only model to show that all agents can asymptotically attain a desired velocity even if only one agent in the team has access to the information of the virtual leader

• Yu et al. (2010) find that a second-order consensus can be achieved in a laplacian model if and only if the network topology contains a directed spanning tree

11

Page 12: The Latest on Boids Research - October 2014

Evolving Flocking

• Olson et al. (2011)

12

ished when any prey agents near the target prey agentare visible anywhere in the predator’s visual field.This perceptual constraint is similar to previous mod-els of predator confusion based on observations fromnatural predator-prey systems [21, 22, 38], where thepredator’s attack e�ciency (# successful attacks /total # attacks) is reduced when attacking swarmsof higher density. P

capture

is determined by the equa-tion:

Pcapture

=1

ANV

(3)

where ANV

is the number of prey agents that are vis-ible to the predator, i.e., anywhere in the predatoragent’s visual field, and within 30 virtual meters ofthe target prey. By only counting prey near the tar-get prey, this mechanism localizes the predator con-fusion e↵ect to the predator’s retina, and enables usto experimentally control the strength of the preda-tor confusion e↵ect. Although our predator confusionmodel is based on the predator’s retina, it is func-tionally equivalent to previous models that are basedon the total swarm size (Figure 2, dashed line), e.g.,in [21,22,38,43]. As shown in Figure 2 (solid line withtriangles), the predator has a 50% chance of captur-ing a prey with one visible prey near the target prey(A

NV

= 2), a 33% chance of capturing a prey withtwo visible prey near the target prey (A

NV

= 3), etc.As a consequence, prey are in principle able to ex-ploit the combined e↵ects of predator confusion andhandling time by swarming.

3 Results

3.1 E↵ects of Predator Confusion

Qualitatively, we observed significant di↵erences inprey behavior over the course of evolution betweenswarms experiencing predators with and withoutpredator confusion. Figure 3A illustrates that preyhunted by a predator without the predator confusionmechanism dispersed as much as possible to escapethe predator. No replicates containing a predatorwithout predator confusion resulted in prey behaviorthat resembled a cohesive swarm. Conversely, whenevolution occurred with predator confusion, prey ex-hibited cohesive swarm behavior in the majority ofthe replicates (70% of our replicates). Figure 3B de-picts one such swarm in which prey follow the con-specific directly in front of them, resulting in an elon-gated swarm. Similarly, Figure 3C shows anotherswarm where the prey circle around their nearest con-specific, resulting in multiple small, cohesive swarmswith the prey constantly trying to circle around each

C)

B)

A)

Figure 3: Screen captures of (A) dispersed prey in aswarm hunted by a predator without predator confu-sion, (B) prey forming a single elongated swarm un-der attack by a predator with predator confusion, and(C) prey forming multiple cohesive swarms to defendthemselves from a predator with predator confusionafter 1,200 generations of evolution. Black dots areprey, the triangle is the predator, the lines project-ing from the predator represent the predator’s frontal180� visual field, and the star denotes where a preywas just captured.

5

• Ward et al. (2001)

C. R. Ward et al. Evolving Collective Behavior in an Artificial Ecology

Figure 10. Behavior of prey E-BOIDS in different ecologies. Left graph shows the mean distance between prey whenpredators are present in the environment. Right graph shows the mean distance between prey in the absence ofpredators. The curve shows the best-fitting power function.

Plate 2. Evolution of predatory behavior in the system. Blue indicates prey, red predators, and green food. Ofparticular note is that prey organisms are “swimming” away from predators and predators are tracking prey.

In contrast to Experiment 2, Figure 6, the creature is highly oriented toward ev-erything with high weights on food in vision (0.55) and very little on predator. Thelateral sense dominates over vision, in terms of attention (0.85 vs. 0.15) and depth(79.4 vs. 138). This indicates that the prey are not looking out for predators as theywere before; now, they consume as much food as possible to increase their energy tocompete for the next generation. As with the experiment outlined in Section 5.2 weused a matched t -test to identify reliable differences in the weights of the networks ofprey with different ecologies. We found statistically reliable differences (p < 0.05) forall weights except for the attention weight prey (vision) and lateral weights (1 → 0,

206 Artificial Life Volume 7, Number 2

C. R. Ward et al. Evolving Collective Behavior in an Artificial Ecology

Figure 10. Behavior of prey E-BOIDS in different ecologies. Left graph shows the mean distance between prey whenpredators are present in the environment. Right graph shows the mean distance between prey in the absence ofpredators. The curve shows the best-fitting power function.

Plate 2. Evolution of predatory behavior in the system. Blue indicates prey, red predators, and green food. Ofparticular note is that prey organisms are “swimming” away from predators and predators are tracking prey.

In contrast to Experiment 2, Figure 6, the creature is highly oriented toward ev-erything with high weights on food in vision (0.55) and very little on predator. Thelateral sense dominates over vision, in terms of attention (0.85 vs. 0.15) and depth(79.4 vs. 138). This indicates that the prey are not looking out for predators as theywere before; now, they consume as much food as possible to increase their energy tocompete for the next generation. As with the experiment outlined in Section 5.2 weused a matched t -test to identify reliable differences in the weights of the networks ofprey with different ecologies. We found statistically reliable differences (p < 0.05) forall weights except for the attention weight prey (vision) and lateral weights (1 → 0,

206 Artificial Life Volume 7, Number 2

• Also… (2014)computation power limits the population size. The fitnessallowed to the agents is therefore adjusted in order to main-tain an acceptable number of agents (between 100 and 1000)alive throughout the simulation. In addition, agents above acertain age (5000 time steps) are removed from the simula-tion, to keep the evolution from standing still.

Results

Emergence of swarming

We observe agents coordinate together in clustered groups.As shown in Figure 3 (top) the simulation goes through threedistinct phases. In the first one, agents wander in an appar-ently random way across the space. Then, during the secondphase, agents progressively cluster into a rapidly changingshape, reminiscent of animal flocks3. In the third phase, to-wards the end of the simulation, the flocks get closer andcloser to the goal4, forming a compact ball around it.

Figure 3: Visualization of the development of a typical runwith a single resource spot. The agents start off in a ran-dom motion (left), then progressively come to coordinate ina dynamic cluster (middle), and finally flock more and moreclosely to the goal (right).

Figure 4 shows more in detail the swarming behavior tak-ing place in the second phase. The agents coordinate in a dy-namic, quickly changing shape, continuously extending andcompressing, while each individual is executing fast pacedrotations on itself. Note that this fast looping seems to benecessary to the emergence of swarming, as all trials withslower rotation settings never achieved this kind of dynam-ics. One regularly notices some agents reaching the borderof a swarm cluster, leaving the group, and most of the timeending up coming back in the heart of the swarm.

In spite of the agents needing to pay a cost for signaling(cf. description of the model), the signal keeps an averagevalue between 0.2 and 0.5 during the whole experiment (inthe case with signalling activated).

It is also noted that a minimal rotation speed is necessaryfor the evolution of swarming. Indeed, it allows the agent to

3As mentioned in the introduction, swarming can take multipleforms depending on the situation and/or the species. In this case,the clustering resemble in some aspects mosquito or starling flock-ing.

4Even though results with one goal are presented in the paper,same behaviors are obtained in the case of two or more resourcespots.

Figure 4: Visualization of the swarming behavior occurringin the second phase of the simulation.

react faster to the environment, as each turn making one sen-sor face a particular direction allows a reaction to the signalscoming from that direction. The faster the rotation, the morethe information gathered by the agent about its environmentis balanced for every direction.

Neighborhood analysis

We choose to measure swarming behavior in agents by look-ing at the average number of neighbors within a radius of100 distance around each agent. Figure 5 shows the evolu-tion of the average number of neighbors, over 10 differentruns, respectively with signaling turned on and off. A muchhigher value is reached around time step 105 in the signalingcase, while the value remains for the silent control.

0 2 4 6 8 10 12

x 105

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

Time steps

Ave

rag

e n

um

be

r o

f n

eig

hb

ors

Average number of neighbors (10 runs) with signalling ON vs OFF

signalling ON

signalling OFF

Figure 5: Comparison of the average number of neighbors(average over 10 runs, with 106 iterations) in the case sig-naling is turned on versus off

We also want to measure the influence of each agent on itsneighborhood. To do so, the inward average transfer entropy

2D, ANN, Vision, Food & Predator-Prey

3D, RNN, Signal, Food

+ “Confusion Effect”

Page 13: The Latest on Boids Research - October 2014

Boids Analysis: Basic Toolbox [3/5]

13

Page 14: The Latest on Boids Research - October 2014

Who to Look at?

• Czirok & Viczek (2001) for a nice introduction

• Couzin et al. (2002) for nice measures

• Kao et al. (2013) for nice additional insights

• Then, your favorite information theory handbook. (But I won’t go over that.)

14

Page 15: The Latest on Boids Research - October 2014

Radiuses of Repulsion, Orientation, Attraction

15within this zone:

drðtþ tÞ ¼ %X

nr

jai

rijðtÞrijðtÞ!

!

!

!

; ð1Þ

where rij¼ (cj –ci)/|(cj –ci)| is the unit vector inthe direction of neighbour j. Note that storravoids singularities in eqn (1). This behaviouralrule has the highest priority in the model, so thatif nr 4 0, the desired direction diðtþ tÞ ¼ drðtþtÞ: The zone of repulsion can be interpreted asindividuals maintaining personal space, oravoiding collisions.If no neighbours are within the zone of

repulsion (nr¼ 0), the individual responds toothers within the ‘‘zone of orientation’’ (zoo)and the ‘‘zone of attraction’’ (zoa). These zonesare spherical, except for a volume behind theindividual within which neighbours are unde-tectable. This ‘‘blind volume’’ is defined as acone with interior angle (360%a)1, where a isdefined as the field of perception (see Fig. 1). Anindividual with a ¼ 3601 can respond to othersin any direction within the behavioural zones.The zone of orientation contains no detectable

neighbours with rrpjðcj2ciÞjoro and the zoneof attraction no detectable neighbours withropjðcj2ciÞjpra: The widths of these zones aredefined as Dro ¼ ro % rr and Dra ¼ ra % ro:

An individual will attempt to align itself withneighbours within the zone of orientation, giving

doðtþ tÞ ¼X

no

j¼1

vjðtÞvjðtÞ!

!

!

!

ð2Þ

and towards the positions of individuals withinthe zone of attraction

daðtþ tÞ ¼X

na

jai

rijðtÞrijðtÞ!

!

!

!

: ð3Þ

The attraction represents the tendency of organ-isms to join groups and to avoid being on theperiphery, whereas the orientation allows collec-tive movement by minimizing the number ofcollisions between individuals. If neighbours areonly found in the zoo (n¼ no), then diðtþ tÞ ¼doðtþ tÞ; likewise if all neighbours are in the zoa(n¼ na), then diðtþ tÞ ¼ daðtþ tÞ: If neighboursare found in both zones, then diðtþ tÞ ¼12½doðtþ tÞ þ daðtþ tÞ': In the eventuality thatthe social forces result in a zero vector, or if noindividuals are detected, then diðtþ tÞ ¼ viðtÞ:Decision making in animals is subject to

stochastic effects (e.g. sensory error, movementerror). This is simulated by modifying diðtþ tÞby rotating it by an angle taken at random froma spherically wrapped Gaussian distributionwith standard deviation, s (Table 1).After the above process has been performed

for every individual they turn towards thedirection vector diðtþ tÞ by the turning rate y:Provided the angle between vi(t) and diðtþ tÞ isless than the maximum turning angle yt; thenviðtþ tÞ ¼ diðtþ tÞ; if not, the individual rotatesby yt towards the desired direction. To simplifythe analysis of parameter space initially weassume that individuals move at a constantspeed of s units per second (we investigate theimportance of differences in individual speedbelow). Following these rules individual trajec-tories can be integrated over time to explore howthe behavioural responses influence collectivebehaviour.

ANALYSIS OF THE MODEL

To analyse the collective behaviour of themodel, we explore the consequences of changing

zx

y

zoa

zor

zoo

α°

(360 - α)°

Fig. 1. Representation of an individual in the modelcentred at the origin: zor¼ zone of repulsion, zoo¼ zone oforientation, zoa¼ zone of attraction. The possible ‘‘blindvolume’’ behind an individual is also shown. a¼ field ofperception.

COLLECTIVE BEHAVIOUR OF ANIMAL GROUPS 3

the values given to parameters (Table 1). Twoglobal properties of the model are calculatedfrom the integrated trajectories of all theindividuals; group polarization, pgroup [0ppgroupp1; eqn (4)] and the group angular momentum,mgroup [0pmgroup p1; eqn (5)]. Group polariza-tion increases as the degree of alignment amongindividuals within the group increases, whereasthe group angular momentum is the sum of theangular momenta of the individuals aboutthe centre of the group, cgroup [also known asthe group centroid, eqn (6)]. Angular momentumtherefore measures the degree of rotation of thegroup about the group centre. Thus,

pgroupðtÞ ¼1

N

X

N

i¼1

viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð4Þ

mgroupðtÞ ¼1

N

X

N

i¼1

ricðtÞ $ viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð5Þ

where

ric ¼ ci % cgroup

and

cgroupðtÞ ¼1

N

X

N

i¼1

ciðtÞ: ð6Þ

For each combination of parameters, individualsstart with random orientations and at randompositions within a sphere in which each can

detect at least one individual. Group fragmenta-tion is measured using an extension of thecalculation of equivalence classes (Press et al.,1992), where the criterion of interest is thepresence of other individuals within the field ofperception.The collective behaviour of the model is

analysed after it reaches a dynamically stablestate, where the values of the different systemmeasures have stabilized (always within 5000time steps, equivalent to 8.3min of real time, forthe range of parameters analysed here).To understand the influence of individual

differences on spatial position within a group,we investigate the consequence of variation inspeed s, turning rate y; error s; rr, ro and raamong individuals within a group. To simulatevariation, the parameter under investigationis modified by a Gaussian distributed deviateindependently drawn for each individual, andis then fixed at that value for the duration ofthe experiment. The standard deviation of thisdistribution determines the degree to whichindividuals differ with respect to that parameterwithin the group, and is investigated up to a cut-off point beyond which the group tends tofragment. The correlation between these para-meters and the distance between individuals andthe group centre cgroup(t), and distance to thefront of the group, is measured using theSpearman rank correlation coefficient (rho).The front of the group is determined by first

Table 1Summary of model parameters. The use of ‘‘units’’ relates to the non-dimensionality of certain parameters in the model with the characteristic lengthscale being associated with the particular organism in question, e.g. rr may bevery small for an insect, and the rest of the model parameters can be scaled

appropriately

Parameter Unit Symbol Values explored

Number of individuals None N 10–100Zone of repulsion Units rr 1Zone of orientation Units Droðro % rrÞ 0–15Zone of attraction Units Draðra % roÞ 0–15Field of perception Degrees a 200–360Turning rate Degrees per second y 10–100Speed Units per second s 1–5Error (S.D.) Degrees (rad) s 0–11.5(0–0.2 rad)Time step increment Seconds t 0.1

I. D. COUZIN ET AL.4

Page 16: The Latest on Boids Research - October 2014

2 Useful Measures

• Group polarisation: degree of alignment among individuals within the group

16

the values given to parameters (Table 1). Twoglobal properties of the model are calculatedfrom the integrated trajectories of all theindividuals; group polarization, pgroup [0ppgroupp1; eqn (4)] and the group angular momentum,mgroup [0pmgroup p1; eqn (5)]. Group polariza-tion increases as the degree of alignment amongindividuals within the group increases, whereasthe group angular momentum is the sum of theangular momenta of the individuals aboutthe centre of the group, cgroup [also known asthe group centroid, eqn (6)]. Angular momentumtherefore measures the degree of rotation of thegroup about the group centre. Thus,

pgroupðtÞ ¼1

N

X

N

i¼1

viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð4Þ

mgroupðtÞ ¼1

N

X

N

i¼1

ricðtÞ $ viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð5Þ

where

ric ¼ ci % cgroup

and

cgroupðtÞ ¼1

N

X

N

i¼1

ciðtÞ: ð6Þ

For each combination of parameters, individualsstart with random orientations and at randompositions within a sphere in which each can

detect at least one individual. Group fragmenta-tion is measured using an extension of thecalculation of equivalence classes (Press et al.,1992), where the criterion of interest is thepresence of other individuals within the field ofperception.The collective behaviour of the model is

analysed after it reaches a dynamically stablestate, where the values of the different systemmeasures have stabilized (always within 5000time steps, equivalent to 8.3min of real time, forthe range of parameters analysed here).To understand the influence of individual

differences on spatial position within a group,we investigate the consequence of variation inspeed s, turning rate y; error s; rr, ro and raamong individuals within a group. To simulatevariation, the parameter under investigationis modified by a Gaussian distributed deviateindependently drawn for each individual, andis then fixed at that value for the duration ofthe experiment. The standard deviation of thisdistribution determines the degree to whichindividuals differ with respect to that parameterwithin the group, and is investigated up to a cut-off point beyond which the group tends tofragment. The correlation between these para-meters and the distance between individuals andthe group centre cgroup(t), and distance to thefront of the group, is measured using theSpearman rank correlation coefficient (rho).The front of the group is determined by first

Table 1Summary of model parameters. The use of ‘‘units’’ relates to the non-dimensionality of certain parameters in the model with the characteristic lengthscale being associated with the particular organism in question, e.g. rr may bevery small for an insect, and the rest of the model parameters can be scaled

appropriately

Parameter Unit Symbol Values explored

Number of individuals None N 10–100Zone of repulsion Units rr 1Zone of orientation Units Droðro % rrÞ 0–15Zone of attraction Units Draðra % roÞ 0–15Field of perception Degrees a 200–360Turning rate Degrees per second y 10–100Speed Units per second s 1–5Error (S.D.) Degrees (rad) s 0–11.5(0–0.2 rad)Time step increment Seconds t 0.1

I. D. COUZIN ET AL.4

Page 17: The Latest on Boids Research - October 2014

2 Useful Measures

• Group polarisation: degree of alignment among individuals within the group

!

• Group angular momentum: sum of the angular momenta (centroids) of the individuals about the centre of the group

17

the values given to parameters (Table 1). Twoglobal properties of the model are calculatedfrom the integrated trajectories of all theindividuals; group polarization, pgroup [0ppgroupp1; eqn (4)] and the group angular momentum,mgroup [0pmgroup p1; eqn (5)]. Group polariza-tion increases as the degree of alignment amongindividuals within the group increases, whereasthe group angular momentum is the sum of theangular momenta of the individuals aboutthe centre of the group, cgroup [also known asthe group centroid, eqn (6)]. Angular momentumtherefore measures the degree of rotation of thegroup about the group centre. Thus,

pgroupðtÞ ¼1

N

X

N

i¼1

viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð4Þ

mgroupðtÞ ¼1

N

X

N

i¼1

ricðtÞ $ viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð5Þ

where

ric ¼ ci % cgroup

and

cgroupðtÞ ¼1

N

X

N

i¼1

ciðtÞ: ð6Þ

For each combination of parameters, individualsstart with random orientations and at randompositions within a sphere in which each can

detect at least one individual. Group fragmenta-tion is measured using an extension of thecalculation of equivalence classes (Press et al.,1992), where the criterion of interest is thepresence of other individuals within the field ofperception.The collective behaviour of the model is

analysed after it reaches a dynamically stablestate, where the values of the different systemmeasures have stabilized (always within 5000time steps, equivalent to 8.3min of real time, forthe range of parameters analysed here).To understand the influence of individual

differences on spatial position within a group,we investigate the consequence of variation inspeed s, turning rate y; error s; rr, ro and raamong individuals within a group. To simulatevariation, the parameter under investigationis modified by a Gaussian distributed deviateindependently drawn for each individual, andis then fixed at that value for the duration ofthe experiment. The standard deviation of thisdistribution determines the degree to whichindividuals differ with respect to that parameterwithin the group, and is investigated up to a cut-off point beyond which the group tends tofragment. The correlation between these para-meters and the distance between individuals andthe group centre cgroup(t), and distance to thefront of the group, is measured using theSpearman rank correlation coefficient (rho).The front of the group is determined by first

Table 1Summary of model parameters. The use of ‘‘units’’ relates to the non-dimensionality of certain parameters in the model with the characteristic lengthscale being associated with the particular organism in question, e.g. rr may bevery small for an insect, and the rest of the model parameters can be scaled

appropriately

Parameter Unit Symbol Values explored

Number of individuals None N 10–100Zone of repulsion Units rr 1Zone of orientation Units Droðro % rrÞ 0–15Zone of attraction Units Draðra % roÞ 0–15Field of perception Degrees a 200–360Turning rate Degrees per second y 10–100Speed Units per second s 1–5Error (S.D.) Degrees (rad) s 0–11.5(0–0.2 rad)Time step increment Seconds t 0.1

I. D. COUZIN ET AL.4

the values given to parameters (Table 1). Twoglobal properties of the model are calculatedfrom the integrated trajectories of all theindividuals; group polarization, pgroup [0ppgroupp1; eqn (4)] and the group angular momentum,mgroup [0pmgroup p1; eqn (5)]. Group polariza-tion increases as the degree of alignment amongindividuals within the group increases, whereasthe group angular momentum is the sum of theangular momenta of the individuals aboutthe centre of the group, cgroup [also known asthe group centroid, eqn (6)]. Angular momentumtherefore measures the degree of rotation of thegroup about the group centre. Thus,

pgroupðtÞ ¼1

N

X

N

i¼1

viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð4Þ

mgroupðtÞ ¼1

N

X

N

i¼1

ricðtÞ $ viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð5Þ

where

ric ¼ ci % cgroup

and

cgroupðtÞ ¼1

N

X

N

i¼1

ciðtÞ: ð6Þ

For each combination of parameters, individualsstart with random orientations and at randompositions within a sphere in which each can

detect at least one individual. Group fragmenta-tion is measured using an extension of thecalculation of equivalence classes (Press et al.,1992), where the criterion of interest is thepresence of other individuals within the field ofperception.The collective behaviour of the model is

analysed after it reaches a dynamically stablestate, where the values of the different systemmeasures have stabilized (always within 5000time steps, equivalent to 8.3min of real time, forthe range of parameters analysed here).To understand the influence of individual

differences on spatial position within a group,we investigate the consequence of variation inspeed s, turning rate y; error s; rr, ro and raamong individuals within a group. To simulatevariation, the parameter under investigationis modified by a Gaussian distributed deviateindependently drawn for each individual, andis then fixed at that value for the duration ofthe experiment. The standard deviation of thisdistribution determines the degree to whichindividuals differ with respect to that parameterwithin the group, and is investigated up to a cut-off point beyond which the group tends tofragment. The correlation between these para-meters and the distance between individuals andthe group centre cgroup(t), and distance to thefront of the group, is measured using theSpearman rank correlation coefficient (rho).The front of the group is determined by first

Table 1Summary of model parameters. The use of ‘‘units’’ relates to the non-dimensionality of certain parameters in the model with the characteristic lengthscale being associated with the particular organism in question, e.g. rr may bevery small for an insect, and the rest of the model parameters can be scaled

appropriately

Parameter Unit Symbol Values explored

Number of individuals None N 10–100Zone of repulsion Units rr 1Zone of orientation Units Droðro % rrÞ 0–15Zone of attraction Units Draðra % roÞ 0–15Field of perception Degrees a 200–360Turning rate Degrees per second y 10–100Speed Units per second s 1–5Error (S.D.) Degrees (rad) s 0–11.5(0–0.2 rad)Time step increment Seconds t 0.1

I. D. COUZIN ET AL.4

the values given to parameters (Table 1). Twoglobal properties of the model are calculatedfrom the integrated trajectories of all theindividuals; group polarization, pgroup [0ppgroupp1; eqn (4)] and the group angular momentum,mgroup [0pmgroup p1; eqn (5)]. Group polariza-tion increases as the degree of alignment amongindividuals within the group increases, whereasthe group angular momentum is the sum of theangular momenta of the individuals aboutthe centre of the group, cgroup [also known asthe group centroid, eqn (6)]. Angular momentumtherefore measures the degree of rotation of thegroup about the group centre. Thus,

pgroupðtÞ ¼1

N

X

N

i¼1

viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð4Þ

mgroupðtÞ ¼1

N

X

N

i¼1

ricðtÞ $ viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð5Þ

where

ric ¼ ci % cgroup

and

cgroupðtÞ ¼1

N

X

N

i¼1

ciðtÞ: ð6Þ

For each combination of parameters, individualsstart with random orientations and at randompositions within a sphere in which each can

detect at least one individual. Group fragmenta-tion is measured using an extension of thecalculation of equivalence classes (Press et al.,1992), where the criterion of interest is thepresence of other individuals within the field ofperception.The collective behaviour of the model is

analysed after it reaches a dynamically stablestate, where the values of the different systemmeasures have stabilized (always within 5000time steps, equivalent to 8.3min of real time, forthe range of parameters analysed here).To understand the influence of individual

differences on spatial position within a group,we investigate the consequence of variation inspeed s, turning rate y; error s; rr, ro and raamong individuals within a group. To simulatevariation, the parameter under investigationis modified by a Gaussian distributed deviateindependently drawn for each individual, andis then fixed at that value for the duration ofthe experiment. The standard deviation of thisdistribution determines the degree to whichindividuals differ with respect to that parameterwithin the group, and is investigated up to a cut-off point beyond which the group tends tofragment. The correlation between these para-meters and the distance between individuals andthe group centre cgroup(t), and distance to thefront of the group, is measured using theSpearman rank correlation coefficient (rho).The front of the group is determined by first

Table 1Summary of model parameters. The use of ‘‘units’’ relates to the non-dimensionality of certain parameters in the model with the characteristic lengthscale being associated with the particular organism in question, e.g. rr may bevery small for an insect, and the rest of the model parameters can be scaled

appropriately

Parameter Unit Symbol Values explored

Number of individuals None N 10–100Zone of repulsion Units rr 1Zone of orientation Units Droðro % rrÞ 0–15Zone of attraction Units Draðra % roÞ 0–15Field of perception Degrees a 200–360Turning rate Degrees per second y 10–100Speed Units per second s 1–5Error (S.D.) Degrees (rad) s 0–11.5(0–0.2 rad)Time step increment Seconds t 0.1

I. D. COUZIN ET AL.4

the values given to parameters (Table 1). Twoglobal properties of the model are calculatedfrom the integrated trajectories of all theindividuals; group polarization, pgroup [0ppgroupp1; eqn (4)] and the group angular momentum,mgroup [0pmgroup p1; eqn (5)]. Group polariza-tion increases as the degree of alignment amongindividuals within the group increases, whereasthe group angular momentum is the sum of theangular momenta of the individuals aboutthe centre of the group, cgroup [also known asthe group centroid, eqn (6)]. Angular momentumtherefore measures the degree of rotation of thegroup about the group centre. Thus,

pgroupðtÞ ¼1

N

X

N

i¼1

viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð4Þ

mgroupðtÞ ¼1

N

X

N

i¼1

ricðtÞ $ viðtÞ

!

!

!

!

!

!

!

!

!

!

; ð5Þ

where

ric ¼ ci % cgroup

and

cgroupðtÞ ¼1

N

X

N

i¼1

ciðtÞ: ð6Þ

For each combination of parameters, individualsstart with random orientations and at randompositions within a sphere in which each can

detect at least one individual. Group fragmenta-tion is measured using an extension of thecalculation of equivalence classes (Press et al.,1992), where the criterion of interest is thepresence of other individuals within the field ofperception.The collective behaviour of the model is

analysed after it reaches a dynamically stablestate, where the values of the different systemmeasures have stabilized (always within 5000time steps, equivalent to 8.3min of real time, forthe range of parameters analysed here).To understand the influence of individual

differences on spatial position within a group,we investigate the consequence of variation inspeed s, turning rate y; error s; rr, ro and raamong individuals within a group. To simulatevariation, the parameter under investigationis modified by a Gaussian distributed deviateindependently drawn for each individual, andis then fixed at that value for the duration ofthe experiment. The standard deviation of thisdistribution determines the degree to whichindividuals differ with respect to that parameterwithin the group, and is investigated up to a cut-off point beyond which the group tends tofragment. The correlation between these para-meters and the distance between individuals andthe group centre cgroup(t), and distance to thefront of the group, is measured using theSpearman rank correlation coefficient (rho).The front of the group is determined by first

Table 1Summary of model parameters. The use of ‘‘units’’ relates to the non-dimensionality of certain parameters in the model with the characteristic lengthscale being associated with the particular organism in question, e.g. rr may bevery small for an insect, and the rest of the model parameters can be scaled

appropriately

Parameter Unit Symbol Values explored

Number of individuals None N 10–100Zone of repulsion Units rr 1Zone of orientation Units Droðro % rrÞ 0–15Zone of attraction Units Draðra % roÞ 0–15Field of perception Degrees a 200–360Turning rate Degrees per second y 10–100Speed Units per second s 1–5Error (S.D.) Degrees (rad) s 0–11.5(0–0.2 rad)Time step increment Seconds t 0.1

I. D. COUZIN ET AL.4

Page 18: The Latest on Boids Research - October 2014

4 Classes of Collective Dynamical Behavior

18

Fig. 3(E) and (F) show the group polarizationpgroup and angular momentum mgroup, respec-tively, as Dro and Dra vary. The area of zerovalues when Dro and Dra are relatively low[Fig. 3(E) and (F), region e] corresponds to thearea of parameter space, where groups have agreater than 50% chance of fragmenting. Sincethe collective behaviour is dependent on groupsize, analysis is only performed on non-fragmen-ted groups. The group types shown in Fig. 3

exist for all group sizes analysed, although therange over which the torus and dynamic parallelgroups form tends to decrease as the group sizedecreases. The field of perception also influencesthe collective behaviour. The range in whichgroups form a torus is diminished to a very smallrange of Dro and Dra when the field ofperception, a; is 3601, but increases as adecreases. Parallel groups become more elon-gated along their principal axis (the direction of

02

46

810

1214

∆ra

02

46

810

1214

∆ro

00.20.40.60.81

00.20.40.60.81

pgroup

02

46

810

1214

∆ra

02

46

810

1214

∆ro

00.20.40.60.81

00.20.40.60.81

mgroup

a ab

bc

c

d

d

e z

(A)

(C) (D)

(B)

(E) (F)

Fig. 3. The collective behaviours exhibited by the model: (A) swarm, (B) torus, (C) dynamic parallel group, (D) highlyparallel group. Also shown are the group polarization pgroup (E) and angular momentum mgroup (F) as a function of changesin the size of the zone of orientation Dro and zone of attraction Dra: The areas denoted as (a–d), correspond to the area ofparameter space in which the collective behaviours (A–D), respectively, are found. Area (e) corresponds to the region inparameter space, where groups have a greater than 50% chance of fragmenting. N¼ 100, rr¼ 1, a¼ 270, y¼ 40, s¼ 3,s¼ 0.05. Data shown in (E) and (F) are the mean of 30 replicates per parameter combination.

I. D. COUZIN ET AL.6

Swarm Torus

Dynamic Parallel Highly Parallel

Page 19: The Latest on Boids Research - October 2014

4 Classes of Collective Dynamical Behavior

19

(A)

(C) (D)

(B)

Swarm Torus

Dynamic Parallel Highly Parallel

Complexity, Pattern, and EvolutionaryTrade-Offs in Animal Aggregation

Julia K. Parrish1* and Leah Edelstein-Keshet2

One of the most striking patterns in biology is the formation of animalaggregations. Classically, aggregation has been viewed as an evolutionarilyadvantageous state, in which members derive the benefits of protection,mate choice, and centralized information, balanced by the costs of limitingresources. Consisting of individual members, aggregations neverthelessfunction as an integrated whole, displaying a complex set of behaviors notpossible at the level of the individual organism. Complexity theory indi-cates that large populations of units can self-organize into aggregationsthat generate pattern, store information, and engage in collective deci-sion-making. This begs the question, are all emergent properties of animalaggregations functional or are some simply pattern? Solutions to thisdilemma will necessitate a closer marriage of theoretical and modelingstudies linked to empirical work addressing the choices, and trajectories, ofindividuals constrained by membership in the group.

Aggregation occurs at all sizes from bacte-ria to whales, from groups of 10 to 10million, and across a range of temporalstability from the ephemeral assemblagesof midges to the obligatory schools of her-ring (1). What the eye sees is the collec-tive—the flock, the school, the swarm—regardless of whether its members work insynchrony (fish, birds) or not (insects). Ag-gregations often behave as a unit with prop-erties that are not merely a sum of theindividual behaviors. In some cases, thisresults in new functions: the ability to builda nest or thermoregulate the hive (bees,termites), form a spore-bearing structure(slime mold), or mob predators (birds) (2,3). In other cases, the properties are mean-ingful only in the context of a group, forexample, a well-defined edge (hopperbands of locusts), a well-regulated densityprofile (schooling fish), polarity without aleader, or a distinct shape whose topologyvaries to suit the tasks (branched army antraiding column) (4 ). Some aggregationsalso display fluidity and uniformity of re-sponse, such as mills, vacuoles, fountains,and flash expansion of fish schools (Fig. 1)(5). Emergent properties of groups are notsurprising in view of recent research oncomplexity demonstrating the ability oflarge populations of simple, identical units(for example, spin magnets) to self-orga-nize, form patterns, store information, andreach “collective decisions” (6 ). Even withrather simple individual rules, nonlinear

interactions can lead to complex and non-intuitive behavior in large groups (7 ).

Operationally, animal aggregations fitinto two classes: those that “self organize”and those that form in response to externalcues such as light or food. The former, forexample bird flocks, fish schools, and un-gulate herds, are of primary interest in com-plexity theory. In some congregations, anexternal attractant nucleates the group:schools of tuna initially form beneath float-ing objects but quickly grow in size, dwarf-ing the original stimulus (8). Once formed,many aggregations persist even thoughmembership turns over. Relatedness to, orknowledge of, neighbors may be minimal,and the group is maintained through collec-tive individual responses. Simple mecha-nisms, such as allelomimesis— or doing

what your neighbors do (7 )— can preventstructural breakdown provided individualsare physically close enough to interact.

Evolutionary FunctionsWhy do animals aggregate? Responses to thisquestion are based on the evolutionary as-sumption that joining a group must increasethe survivorship or reproductive success ofthe new member. Juvenile survival increasesin protective, physically structured herds,with the strongest adults at the periphery (9).Classically, protection from predators hasbeen viewed as an important selective advan-tage to group membership, with benefits in-cluding dilution of predation, group vigi-lance, and the confusion effect (an inability ofpredators to visually lock onto one targetamong many) (10). However, persistent ag-gregations also attract predators (11). Marinemammals use the tendency of their prey to beconcentrated to facilitate successful attack(12). The consummate concentration preda-tor—humans—can net up to 40 million met-ric tons of schooling marine finfish and in-vertebrates annually (half of the world catchof marine biomass) because these speciesaggregate so densely (13).

Other selection factors also favor aggre-gation. Mating and mate choice lead to small,ephemeral assemblages (swarms of mosqui-toes, leks of sage grouse) as well as large,predictable aggregations (herds, pods, andschools migrating to and from spawning

1Zoology Department, University of Washington, Se-attle, WA 98195, USA. 2Department of Mathematics,University of British Columbia, Vancouver, BC V6T1Z2, Canada.

*To whom correspondence should be addressed. E-mail: [email protected]

Fig. 1. Fish schools provide an example of emergent pattern such as milling in which individualmembers circle about an unoccupied core. [Photo: ©1999 Norbert Wu]

www.sciencemag.org SCIENCE VOL 284 2 APRIL 1999 99

C O M P L E X S Y S T E M SV I E W P O I N T

Swarms are often seen in insects, such as mosquitoes and midges (Okubo & Chiang, 1974; Ikawa & Okabe, 1997), and can also

be exhibited by fish schools (Pitcher & Parrish, 1993)

The dynamic parallel group exhibits many of the properties associated with

aggregations such as bird flocks and fish schools; the individuals are polarized and move as a coherent group, but individuals

can move throughout the group and density and group form can fluctuate (Major & Dill, 1978; Partridge, 1982).

The highly parallel group is much more static in terms

of exchange of spatial positions within the group than the dynamic parallel group, and the variation in

density and form is minimal.

The torus formation type is exhibited by natural schools of fish in open water including barracuda, jack and tuna. See

Parrish & Edelstein-Keshet (1999).

Page 20: The Latest on Boids Research - October 2014

4 Classes of Collective Dynamical Behavior

20

(A)

(C) (D)

(B)

Swarm Torus

Dynamic Parallel Highly Parallel

within this zone:

drðtþ tÞ ¼ %X

nr

jai

rijðtÞrijðtÞ!

!

!

!

; ð1Þ

where rij¼ (cj –ci)/|(cj –ci)| is the unit vector inthe direction of neighbour j. Note that storravoids singularities in eqn (1). This behaviouralrule has the highest priority in the model, so thatif nr 4 0, the desired direction diðtþ tÞ ¼ drðtþtÞ: The zone of repulsion can be interpreted asindividuals maintaining personal space, oravoiding collisions.If no neighbours are within the zone of

repulsion (nr¼ 0), the individual responds toothers within the ‘‘zone of orientation’’ (zoo)and the ‘‘zone of attraction’’ (zoa). These zonesare spherical, except for a volume behind theindividual within which neighbours are unde-tectable. This ‘‘blind volume’’ is defined as acone with interior angle (360%a)1, where a isdefined as the field of perception (see Fig. 1). Anindividual with a ¼ 3601 can respond to othersin any direction within the behavioural zones.The zone of orientation contains no detectable

neighbours with rrpjðcj2ciÞjoro and the zoneof attraction no detectable neighbours withropjðcj2ciÞjpra: The widths of these zones aredefined as Dro ¼ ro % rr and Dra ¼ ra % ro:

An individual will attempt to align itself withneighbours within the zone of orientation, giving

doðtþ tÞ ¼X

no

j¼1

vjðtÞvjðtÞ!

!

!

!

ð2Þ

and towards the positions of individuals withinthe zone of attraction

daðtþ tÞ ¼X

na

jai

rijðtÞrijðtÞ!

!

!

!

: ð3Þ

The attraction represents the tendency of organ-isms to join groups and to avoid being on theperiphery, whereas the orientation allows collec-tive movement by minimizing the number ofcollisions between individuals. If neighbours areonly found in the zoo (n¼ no), then diðtþ tÞ ¼doðtþ tÞ; likewise if all neighbours are in the zoa(n¼ na), then diðtþ tÞ ¼ daðtþ tÞ: If neighboursare found in both zones, then diðtþ tÞ ¼12½doðtþ tÞ þ daðtþ tÞ': In the eventuality thatthe social forces result in a zero vector, or if noindividuals are detected, then diðtþ tÞ ¼ viðtÞ:Decision making in animals is subject to

stochastic effects (e.g. sensory error, movementerror). This is simulated by modifying diðtþ tÞby rotating it by an angle taken at random froma spherically wrapped Gaussian distributionwith standard deviation, s (Table 1).After the above process has been performed

for every individual they turn towards thedirection vector diðtþ tÞ by the turning rate y:Provided the angle between vi(t) and diðtþ tÞ isless than the maximum turning angle yt; thenviðtþ tÞ ¼ diðtþ tÞ; if not, the individual rotatesby yt towards the desired direction. To simplifythe analysis of parameter space initially weassume that individuals move at a constantspeed of s units per second (we investigate theimportance of differences in individual speedbelow). Following these rules individual trajec-tories can be integrated over time to explore howthe behavioural responses influence collectivebehaviour.

ANALYSIS OF THE MODEL

To analyse the collective behaviour of themodel, we explore the consequences of changing

zx

y

zoa

zor

zoo

α°

(360 - α)°

Fig. 1. Representation of an individual in the modelcentred at the origin: zor¼ zone of repulsion, zoo¼ zone oforientation, zoa¼ zone of attraction. The possible ‘‘blindvolume’’ behind an individual is also shown. a¼ field ofperception.

COLLECTIVE BEHAVIOUR OF ANIMAL GROUPS 3

Page 21: The Latest on Boids Research - October 2014

4 Classes of Collective Dynamical Behavior

21

Fig. 3(E) and (F) show the group polarizationpgroup and angular momentum mgroup, respec-tively, as Dro and Dra vary. The area of zerovalues when Dro and Dra are relatively low[Fig. 3(E) and (F), region e] corresponds to thearea of parameter space, where groups have agreater than 50% chance of fragmenting. Sincethe collective behaviour is dependent on groupsize, analysis is only performed on non-fragmen-ted groups. The group types shown in Fig. 3

exist for all group sizes analysed, although therange over which the torus and dynamic parallelgroups form tends to decrease as the group sizedecreases. The field of perception also influencesthe collective behaviour. The range in whichgroups form a torus is diminished to a very smallrange of Dro and Dra when the field ofperception, a; is 3601, but increases as adecreases. Parallel groups become more elon-gated along their principal axis (the direction of

02

46

810

1214

∆ra

02

46

810

1214

∆ro

00.20.40.60.81

00.20.40.60.81

pgroup

02

46

810

1214

∆ra

02

46

810

1214

∆ro

00.20.40.60.81

00.20.40.60.81

mgroup

a ab

bc

c

d

d

e z

(A)

(C) (D)

(B)

(E) (F)

Fig. 3. The collective behaviours exhibited by the model: (A) swarm, (B) torus, (C) dynamic parallel group, (D) highlyparallel group. Also shown are the group polarization pgroup (E) and angular momentum mgroup (F) as a function of changesin the size of the zone of orientation Dro and zone of attraction Dra: The areas denoted as (a–d), correspond to the area ofparameter space in which the collective behaviours (A–D), respectively, are found. Area (e) corresponds to the region inparameter space, where groups have a greater than 50% chance of fragmenting. N¼ 100, rr¼ 1, a¼ 270, y¼ 40, s¼ 3,s¼ 0.05. Data shown in (E) and (F) are the mean of 30 replicates per parameter combination.

I. D. COUZIN ET AL.6

Swarm Torus

Dynamic Parallel Highly Parallel

low pgroup, low mgroup

high pgroup, low mgroup

low pgroup, high mgroup

very high pgroup, low mgroup

pgroup = group polarization ; mgroup = group angular momentum

Page 22: The Latest on Boids Research - October 2014

Polarization & Momentum

22

Fig. 3(E) and (F) show the group polarizationpgroup and angular momentum mgroup, respec-tively, as Dro and Dra vary. The area of zerovalues when Dro and Dra are relatively low[Fig. 3(E) and (F), region e] corresponds to thearea of parameter space, where groups have agreater than 50% chance of fragmenting. Sincethe collective behaviour is dependent on groupsize, analysis is only performed on non-fragmen-ted groups. The group types shown in Fig. 3

exist for all group sizes analysed, although therange over which the torus and dynamic parallelgroups form tends to decrease as the group sizedecreases. The field of perception also influencesthe collective behaviour. The range in whichgroups form a torus is diminished to a very smallrange of Dro and Dra when the field ofperception, a; is 3601, but increases as adecreases. Parallel groups become more elon-gated along their principal axis (the direction of

02

46

810

1214

∆ra

02

46

810

1214

∆ro

00.20.40.60.81

00.20.40.60.81

pgroup

02

46

810

1214

∆ra

02

46

810

1214

∆ro

00.20.40.60.81

00.20.40.60.81

mgroup

a ab

bc

c

d

d

e z

(A)

(C) (D)

(B)

(E) (F)

Fig. 3. The collective behaviours exhibited by the model: (A) swarm, (B) torus, (C) dynamic parallel group, (D) highlyparallel group. Also shown are the group polarization pgroup (E) and angular momentum mgroup (F) as a function of changesin the size of the zone of orientation Dro and zone of attraction Dra: The areas denoted as (a–d), correspond to the area ofparameter space in which the collective behaviours (A–D), respectively, are found. Area (e) corresponds to the region inparameter space, where groups have a greater than 50% chance of fragmenting. N¼ 100, rr¼ 1, a¼ 270, y¼ 40, s¼ 3,s¼ 0.05. Data shown in (E) and (F) are the mean of 30 replicates per parameter combination.

I. D. COUZIN ET AL.6

Fig. 3(E) and (F) show the group polarizationpgroup and angular momentum mgroup, respec-tively, as Dro and Dra vary. The area of zerovalues when Dro and Dra are relatively low[Fig. 3(E) and (F), region e] corresponds to thearea of parameter space, where groups have agreater than 50% chance of fragmenting. Sincethe collective behaviour is dependent on groupsize, analysis is only performed on non-fragmen-ted groups. The group types shown in Fig. 3

exist for all group sizes analysed, although therange over which the torus and dynamic parallelgroups form tends to decrease as the group sizedecreases. The field of perception also influencesthe collective behaviour. The range in whichgroups form a torus is diminished to a very smallrange of Dro and Dra when the field ofperception, a; is 3601, but increases as adecreases. Parallel groups become more elon-gated along their principal axis (the direction of

02

46

810

1214

∆ra

02

46

810

1214

∆ro

00.20.40.60.81

00.20.40.60.81

pgroup

02

46

810

1214

∆ra

02

46

810

1214

∆ro

00.20.40.60.81

00.20.40.60.81

mgroup

a ab

bc

c

d

d

e z

(A)

(C) (D)

(B)

(E) (F)

Fig. 3. The collective behaviours exhibited by the model: (A) swarm, (B) torus, (C) dynamic parallel group, (D) highlyparallel group. Also shown are the group polarization pgroup (E) and angular momentum mgroup (F) as a function of changesin the size of the zone of orientation Dro and zone of attraction Dra: The areas denoted as (a–d), correspond to the area ofparameter space in which the collective behaviours (A–D), respectively, are found. Area (e) corresponds to the region inparameter space, where groups have a greater than 50% chance of fragmenting. N¼ 100, rr¼ 1, a¼ 270, y¼ 40, s¼ 3,s¼ 0.05. Data shown in (E) and (F) are the mean of 30 replicates per parameter combination.

I. D. COUZIN ET AL.6

e:

a: swarm b: torus c: dynamic parallel d: highly parallel

Page 23: The Latest on Boids Research - October 2014

Hysteresis and Collective Memory

23

travel) as a diminishes, and the probability thatthey will fragment increases. When a reachesapproximately 2301 group fragmentation iscommon across the entire parameter space, andas it decreases further it becomes less likely thatgroups will remain cohesive.The turning rate of individuals essentially

rescales the parameter space; increasing the rateof turning ‘‘compresses’’ parameter space allow-ing the collective patterns to form with relativelysmaller values of Dro and Dra; whereas decreas-ing the rate of turning increases the area in whichgroups fragment and increases the Dro and Dra atwhich the groups enter the behavioural states(i.e. it ‘‘expands’’ the parameter space). Speedhas a similar influence to turning, since itmodifies the turning arc of individuals (higherspeed increases the size of the turning arc, asdoes decreasing turning rate). If the noiseparameter is close to zero, the swarm and torusarea of parameter space remain largely un-changed, but the area in which groups formdynamic parallel groups is reduced, with highlyparallel groups forming at relatively low Drovalues. As noise is increased, the dynamicparallel area first expands in the Dro dimensionand then individual error becomes too high forpolarized, or torus group types to form, andswarm-like behaviour persists over much of theparameter space. As noise increases, there is alsoa higher probability that groups will fragment,so the values of Dro and Dra at which stablegroups form tends to increase.

HYSTERESIS AND BEHAVIOURAL TRANSITIONS

In the above analysis, the starting orientationsof individuals are always random. However, innature, groups are likely to move betweencollective states as conditions change; conse-quently the previous history of individualorientation and group shape may influencefuture collective behaviour as behavioural para-meters change. By changing the way theyrespond to others, individuals can change thestructure of the group to which they belong.To investigate this process, we explored how

changes in individual behaviour result in achange of the collective behavioural state.Figure 4 shows how pgroup and mgroup change as

individuals within the group modify their re-sponse to others by keeping ra fixed and eitherincreasing, or decreasing their ro over a givenrange, resulting in the group changing betweenswarm, torus and dynamic parallel collectivebehaviours. If ro is close to 1 ðDroE0Þ,the group exhibits swarm behaviour (low pgroup,low mgroup). As ro increases towards 1.5, thegroup exhibits a rapid behavioural transitionand enters the torus phase (mgroup rapidlyincreases). Beyond 2.5, however, the groupenters a polarized configuration (mgroup decreasesand pgroup increases). However, if the groupmoves back through parameter space in the

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

p group

ro

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

mgroup

roincreasing decreasing

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

p group

r

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

mgroup

ro

(A)

(B)

Fig. 4. The change in group polarization pgroup (A) andangular momentum mgroup (B) as individuals within a groupincrease (bold line) or decrease (dotted line) the size of thezone of orientation ro. Two thousand time steps were rununder each value of ro before it was incremented ordecremented. Fifteen replicates were performed, and theaverage value plotted with error bars, indicating thestandard error. The group patterns that form depend onthe previous history of the group (hysteresis). Parameters asfor Fig. 3, ra¼ 14.

COLLECTIVE BEHAVIOUR OF ANIMAL GROUPS 7travel) as a diminishes, and the probability thatthey will fragment increases. When a reachesapproximately 2301 group fragmentation iscommon across the entire parameter space, andas it decreases further it becomes less likely thatgroups will remain cohesive.The turning rate of individuals essentially

rescales the parameter space; increasing the rateof turning ‘‘compresses’’ parameter space allow-ing the collective patterns to form with relativelysmaller values of Dro and Dra; whereas decreas-ing the rate of turning increases the area in whichgroups fragment and increases the Dro and Dra atwhich the groups enter the behavioural states(i.e. it ‘‘expands’’ the parameter space). Speedhas a similar influence to turning, since itmodifies the turning arc of individuals (higherspeed increases the size of the turning arc, asdoes decreasing turning rate). If the noiseparameter is close to zero, the swarm and torusarea of parameter space remain largely un-changed, but the area in which groups formdynamic parallel groups is reduced, with highlyparallel groups forming at relatively low Drovalues. As noise is increased, the dynamicparallel area first expands in the Dro dimensionand then individual error becomes too high forpolarized, or torus group types to form, andswarm-like behaviour persists over much of theparameter space. As noise increases, there is alsoa higher probability that groups will fragment,so the values of Dro and Dra at which stablegroups form tends to increase.

HYSTERESIS AND BEHAVIOURAL TRANSITIONS

In the above analysis, the starting orientationsof individuals are always random. However, innature, groups are likely to move betweencollective states as conditions change; conse-quently the previous history of individualorientation and group shape may influencefuture collective behaviour as behavioural para-meters change. By changing the way theyrespond to others, individuals can change thestructure of the group to which they belong.To investigate this process, we explored how

changes in individual behaviour result in achange of the collective behavioural state.Figure 4 shows how pgroup and mgroup change as

individuals within the group modify their re-sponse to others by keeping ra fixed and eitherincreasing, or decreasing their ro over a givenrange, resulting in the group changing betweenswarm, torus and dynamic parallel collectivebehaviours. If ro is close to 1 ðDroE0Þ,the group exhibits swarm behaviour (low pgroup,low mgroup). As ro increases towards 1.5, thegroup exhibits a rapid behavioural transitionand enters the torus phase (mgroup rapidlyincreases). Beyond 2.5, however, the groupenters a polarized configuration (mgroup decreasesand pgroup increases). However, if the groupmoves back through parameter space in the

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

p group

ro

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

mgroup

roincreasing decreasing

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

p group

r

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

mgroup

ro

(A)

(B)

Fig. 4. The change in group polarization pgroup (A) andangular momentum mgroup (B) as individuals within a groupincrease (bold line) or decrease (dotted line) the size of thezone of orientation ro. Two thousand time steps were rununder each value of ro before it was incremented ordecremented. Fifteen replicates were performed, and theaverage value plotted with error bars, indicating thestandard error. The group patterns that form depend onthe previous history of the group (hysteresis). Parameters asfor Fig. 3, ra¼ 14.

COLLECTIVE BEHAVIOUR OF ANIMAL GROUPS 7

travel) as a diminishes, and the probability thatthey will fragment increases. When a reachesapproximately 2301 group fragmentation iscommon across the entire parameter space, andas it decreases further it becomes less likely thatgroups will remain cohesive.The turning rate of individuals essentially

rescales the parameter space; increasing the rateof turning ‘‘compresses’’ parameter space allow-ing the collective patterns to form with relativelysmaller values of Dro and Dra; whereas decreas-ing the rate of turning increases the area in whichgroups fragment and increases the Dro and Dra atwhich the groups enter the behavioural states(i.e. it ‘‘expands’’ the parameter space). Speedhas a similar influence to turning, since itmodifies the turning arc of individuals (higherspeed increases the size of the turning arc, asdoes decreasing turning rate). If the noiseparameter is close to zero, the swarm and torusarea of parameter space remain largely un-changed, but the area in which groups formdynamic parallel groups is reduced, with highlyparallel groups forming at relatively low Drovalues. As noise is increased, the dynamicparallel area first expands in the Dro dimensionand then individual error becomes too high forpolarized, or torus group types to form, andswarm-like behaviour persists over much of theparameter space. As noise increases, there is alsoa higher probability that groups will fragment,so the values of Dro and Dra at which stablegroups form tends to increase.

HYSTERESIS AND BEHAVIOURAL TRANSITIONS

In the above analysis, the starting orientationsof individuals are always random. However, innature, groups are likely to move betweencollective states as conditions change; conse-quently the previous history of individualorientation and group shape may influencefuture collective behaviour as behavioural para-meters change. By changing the way theyrespond to others, individuals can change thestructure of the group to which they belong.To investigate this process, we explored how

changes in individual behaviour result in achange of the collective behavioural state.Figure 4 shows how pgroup and mgroup change as

individuals within the group modify their re-sponse to others by keeping ra fixed and eitherincreasing, or decreasing their ro over a givenrange, resulting in the group changing betweenswarm, torus and dynamic parallel collectivebehaviours. If ro is close to 1 ðDroE0Þ,the group exhibits swarm behaviour (low pgroup,low mgroup). As ro increases towards 1.5, thegroup exhibits a rapid behavioural transitionand enters the torus phase (mgroup rapidlyincreases). Beyond 2.5, however, the groupenters a polarized configuration (mgroup decreasesand pgroup increases). However, if the groupmoves back through parameter space in the

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

p group

ro

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

mgroup

roincreasing decreasing

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

p group

r

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

mgroup

ro

(A)

(B)

Fig. 4. The change in group polarization pgroup (A) andangular momentum mgroup (B) as individuals within a groupincrease (bold line) or decrease (dotted line) the size of thezone of orientation ro. Two thousand time steps were rununder each value of ro before it was incremented ordecremented. Fifteen replicates were performed, and theaverage value plotted with error bars, indicating thestandard error. The group patterns that form depend onthe previous history of the group (hysteresis). Parameters asfor Fig. 3, ra¼ 14.

COLLECTIVE BEHAVIOUR OF ANIMAL GROUPS 7

Page 24: The Latest on Boids Research - October 2014

Back To Nature [4/5]

24

Page 25: The Latest on Boids Research - October 2014

How to Capture Real Flocking

• Recent studies of starling flocks by Ballerini et al. (2008) have shown that each bird modifies its position, relative to the 6 or 7 individuals directly surrounding it, no matter how close or how far away those animals are.

• The 3D reconstruction shows that the interaction does not depend on the metric distance, as most current models and theories assume, but rather on the topological distance.

• A topological interaction is indispensable to maintain a flock's cohesion against the large density changes caused by external perturbations, typically predation. Topological interaction grants significantly higher cohesion of the aggregation compared with a standard metric one (shown by Ballerini’s simulations).

25

Page 26: The Latest on Boids Research - October 2014

Big Data, Big Processing [5/5]

26

Page 27: The Latest on Boids Research - October 2014

Shall We Use A GPU

27

Page 28: The Latest on Boids Research - October 2014

GPU: Optimizations

28

texture, and shared memory. The global memory is not cached, and is therefore slow. Texture memory implements cache logic in hardware and is persistent across thread blocks. Finally, shared memory is a very slow latency (1 cycle) memory divided into 16k chunks. However, it is not persistent across blocks and must be managed by the application. We implemented two versions of the algorithm: The naive implementation uses the global memory to store several contiguous arrays representing the boid's information. Each array is allocated twice, so that the current step can use information from the previous step. In the optimized implementation, there is only one set of arrays in global memory. Each array, however, has a corresponding copy in texture memory that is used for kernel reads. The data in the texture memory is kept updated by using a CUDA operation to copy it from global to texture memory. The data is read from the textures using the same mapping shown in Figure 3.

4.2 Data Structure The cost of neighbor search can be accelerated by using spatial indexing structures. We used a uniform grid because it has a constant cost to build and is easy to evaluate inside the GPU. Other recursive structures, although more efficient, require costly maintenance and are more complex to construct. The structure used is shown in the Figure 4: there is a regular division in the space in the three axes that indexes lists of boids.

Fig. 4. Mapping of the 3D world to grid space and linked list indexing.

In the GPGPU programming model, we encoded the grid structure as a 3D texture. Each position contains a virtual index to one boid. This index can be used to retrieve information about position, orientation, or force in another texture. To be able to store more than one boid per cell, we used a linked list. This was implemented using the fourth coordinate (w) as an index to the next boid in the same cell. A value of -1 means the list has reached the end. Figure 4 shows the mapping from the world space to the grid space, the mapping of the grid to a virtual index, and the list of elements inside the position array. In the virtual index implementation, all indexes are stored with a +1 increment. In this way, it is possible to use a memset function to clear the grid content to zero. Inside the shader, all access and index conversions must subtract 1 from the elements to be accessed. A value of -1 after this operation means an invalid or null index.

We stop the search when the number of processed neighbors reaches the minimum visibility density or when the maximum vision range is exceeded. In Figure 9, the minimum visibility density of four neighbors is reached before the maximum vision range, and there are many neighbors discarded from processing. Since the number of boids is only an estimative of the real occlusion, we may at times not consider boids that would otherwise be included in the behavior computation; this situation is depicted in Figure 10. This may change the behavior of the flock, especially if the number of boids being simulated is small. Another important issue regarding the simulation is grid density (elements per grid cell). When a fixed number is used, if the density is too low the algorithm will discard a lot of empty cells, and if the density is too high the algorithm will iterate over a lot of elements, even when most of them are not visible.

Fig. 9: Using visibility to cull boids.

Fig. 10. A problem when the neighbors do not occlude another visible neighbor.

We tried to create a grid with a more uniform distribution by changing the size of the grid in accordance with the number of boids being simulated. The size of the grid is given by the equation below, which considers the total number of boids and the desired density.

6 RESULTS AND DISCUSSION We performed a series of experiments in order to determine the effectiveness of the occlusion algorithm. The tests were executed on a PC with the following configuration:

z Processor: Athlon64x2 4200+ z Memory: 2Gb DDR1 - 400 Mhz z Operational System: Windows Vista 64 z Graphics Processor: GeForce8800GT - 512Mb DDR3 - PCI-e 16x z Graphics Driver Version: 181.22 z Cg API: 2.0

We tested three implementations: the shader, naive CUDA, and an optimized CUDA with cache optimization through textures. We measured the time spent in the three steps described before. All the measured times are in milliseconds. The first step (grid construction) in the shader and the optimized CUDA version includes the data transfer time (CUDA: from global memory to texture; shader: texture uploads and download). In the second step (simulation), the transfer time is only included for the optimized CUDA times. In the experiments, we varied the number of boids from 1024 to 65536. This interval was chosen so that the square root of the number is a multiple of 16. Hence we could use the CUDA blocks of 16x16. The grid size changed according to Equation 3. The vision angle was fixed at 45 degrees and the vision distance at 200 units. Our virtual environment extends from -500 to 500 units on the three axes. The model for each boid has 268 triangles; the density parameter was 5 boids per cell; data was collected over a range of 6 different population sizes; and the time for each one was an average of more than 30 frames. Figure 11 shows the time spent on grid construction for each implemented algorithm. Both CUDA algorithms performed better. Although the optimized CUDA had to transfer the result array from global to texture memory, the time was very close to the other CUDA algorithm. The shader grid construction was the slowest, mainly influenced by the CPU part. It was not possible to implement scattering as a programming strategy in the shader as it was in CUDA.

• Mapping

• Visual culling

• Self-occlusion

Page 29: The Latest on Boids Research - October 2014

80k boids in real time with CUDA using cuSwarm

29

Page 30: The Latest on Boids Research - October 2014

150k boids @30fps with CUDA using cuSwarm

30

Page 31: The Latest on Boids Research - October 2014

1M boids with CUDA - OpenGL - ISIS (Frola 2009)

31

Page 32: The Latest on Boids Research - October 2014

• Cui et al. 2009

GPU: Performances

32

Figure 6. Document Flocking runtime, CPUvs. GPU

Figure 7. GPU over CPU Runtime Ratio

ior typical of flocking birds. We assigned a weight of 0.33to the alignment rule, 0.66 to the separation rule, and 0.33to the cohesion rule. The document feature vector similaritythreshold T was 1.20. This value was selected based on ex-perimental observation. It was small enough to clearly dif-ferentiate groups in the flock while not being so small that itprevented flocking altogether. As mentioned before, a ran-dom element was introduced at every generation. Throughobservation, we felt that fifteen percent random movementwas high enough to keep the system from stagnating, whilelow enough to ensure flocking behavior persisted.

Through our experiments we observed that documentflocking on the GPU has a runtime that is significant smallerthan its CPU counterpart (see Fig. 5 and Fig. 6). FromGPU speedup chart in Fig. 7, we observed that with 200documents the GPU implementation is roughly 36 times

faster than the CPU version. Initially, as we increased thenumber of documents in our test set, the improvement in-creased. For 1000 documents, we saw an improvement ofnearly sixty times over the CPU. We hypothesize that thelower performance that occurs with less than 1000 docu-ments is caused by not all processing elements on the GPUbeing utilized. From 1200 to 3400 documents however, theimprovement degrades. As is clear in Fig. 7, after 1000documents, performance degrades nearly linearly. Whilewe have done no direct testing, we think this could be dueto an increase in global memory reading requirements as thepopulation size grows.

4 Future directions

In future work, larger data sets could be investigated.Clustering hundreds of thousands or even millions of doc-uments on a workstation quickly is currently an unsolvedresearch problem but the GPU may provide hope. Distribut-ing the document flocking algorithm across many GPUscould also substantially improve the number of documentsthat can be handled during a simulation, possibly allowingmillions of documents to be clustered quickly. The cur-rently released NVIDIA Tesla GPU architecture has manytimes the amount of device memory as the GTX we usedin here. These additional capabilities may greatly enhancethe already high performance we saw in our tests. We hopethat through this research we can provide some guidance,insight, and inspiration to other researchers who deal regu-larly with data parallel algorithms.

Acknowledgments.

This work was funded in part by the Lockheed Martin Cor-poration Shared Vision program. The views and conclu-sions contained in this document are those of the authors.This manuscript has been authored by UT-Battelle, LLC,under contract DE-AC05-00OR22725 with the U.S. Depart-ment of Energy. The United States Government retains andthe publisher, by accepting the article for publication, ac-knowledges that the United States Government retains anon-exclusive, paid-up, irrevocable, world-wide license topublish or reproduce the published form of this manuscript,or allow others to do so, for United States Government pur-poses.

References

[1] Anderberg M.R., Cluster Analysis for Applications.Academic Press, Inc., New York (1973)

[2] Charles J. S., Potok T. E., Patton R., Cui X., Flocking-based Document Clustering on the Graphics Process-

Page 33: The Latest on Boids Research - October 2014

GPU: Performances

33

6 8 10 12 14 16 18 20 22 24 260

5

10

15

20

25

Grid construction timeShader vs CUDA (texture) vs CUDA

ShaderCUDA (texture)CUDA

grid dimension³

time

(ms)

Fig. 11. Grid construction times: shader construction time is greater since it was executed on the CPU.

In Figures 12, 13, and 14 we can see the total simulation times for the three implementations with and without visibility culling. All of them show a significant gain when using visibility culling. The biggest improvement can be seen in the shader implementation.

0 10000 20000 30000 40000 50000 60000 700000

100

200

300

400

500

600

700

800

900

1000

Simulation Time - Shader

Without VisibilityWith Visibility

nº boids

time

(ms)

Fig. 12. Simulation time for the GPGPU implementation.

0 10000 20000 30000 40000 50000 60000 70000

0

200

400

600

800

1000

1200

1400

Simulation Time - CUDA

Without VisibilityWith Visibility

nº boids

time

(ms)

Fig.13. Simulation time for the CUDA with global memory implementation.

0 10000 20000 30000 40000 50000 60000 70000

0

200

400

600

800

1000

1200

Simulation Time - CUDA (texture)

Without VisibilityWith Visibility

nº boids

time

(ms)

Fig. 14. Simulation time for the CUDA with texture memory implementation.

Figure 15 shows the total time for the three implementations with visibility culling. Comparing only the CUDA implementations, we can say that the use of texture as a cached memory worked well because the time spent decreased slightly. But among the three implementations, the shader gave the best performance, running more than three times faster than CUDA for a large number of boids.

We tried to create a grid with a more uniform distribution by changing the size of the grid in accordance with the number of boids being simulated. The size of the grid is given by the equation below, which considers the total number of boids and the desired density.

6 RESULTS AND DISCUSSION We performed a series of experiments in order to determine the effectiveness of the occlusion algorithm. The tests were executed on a PC with the following configuration:

z Processor: Athlon64x2 4200+ z Memory: 2Gb DDR1 - 400 Mhz z Operational System: Windows Vista 64 z Graphics Processor: GeForce8800GT - 512Mb DDR3 - PCI-e 16x z Graphics Driver Version: 181.22 z Cg API: 2.0

We tested three implementations: the shader, naive CUDA, and an optimized CUDA with cache optimization through textures. We measured the time spent in the three steps described before. All the measured times are in milliseconds. The first step (grid construction) in the shader and the optimized CUDA version includes the data transfer time (CUDA: from global memory to texture; shader: texture uploads and download). In the second step (simulation), the transfer time is only included for the optimized CUDA times. In the experiments, we varied the number of boids from 1024 to 65536. This interval was chosen so that the square root of the number is a multiple of 16. Hence we could use the CUDA blocks of 16x16. The grid size changed according to Equation 3. The vision angle was fixed at 45 degrees and the vision distance at 200 units. Our virtual environment extends from -500 to 500 units on the three axes. The model for each boid has 268 triangles; the density parameter was 5 boids per cell; data was collected over a range of 6 different population sizes; and the time for each one was an average of more than 30 frames. Figure 11 shows the time spent on grid construction for each implemented algorithm. Both CUDA algorithms performed better. Although the optimized CUDA had to transfer the result array from global to texture memory, the time was very close to the other CUDA algorithm. The shader grid construction was the slowest, mainly influenced by the CPU part. It was not possible to implement scattering as a programming strategy in the shader as it was in CUDA.

• Da Silva et al. 2009

Page 34: The Latest on Boids Research - October 2014

What Do You Think? [6/5] (I lied.)

34

Page 35: The Latest on Boids Research - October 2014

Future Research Questions

• Which aspects of collective behavior are cooperative vs. selfish?

• How do individuals adapt quickly to environmental changes while remaining robust and organized even under noisy conditions? Are there two levels of learning/adaptation?

• How well do abstract mathematical models capture the dynamics of real biological systems?

35

Page 36: The Latest on Boids Research - October 2014

My Personal Favorite

• If collective behavior compensates for an individual cognitive limitations, does enhancing collective cognition relax selection pressure on individuals’ general cognitive ability?

• It has been suggested that similar types of patterns shown by insects, birds and fish result from commonality of function. To which extent may it not be the case, and how can those patterns be driven by totally different mechanisms?

• How common is multistability of collective state in animal groups? Does it encode information in an analogous way to coexistence of stable modes of collective behavior in neuronal networks?

36

Page 37: The Latest on Boids Research - October 2014

!

Thank you


Recommended