<<

SC741– W3: Collective Coordinated Movements in Natural and Artificial Simulated Societies Outline • Introduction – – Not quite flocking – Other coordinated movements • Flocking in Animal societies – Phenomena – Mechanisms – Benefits • Reynolds’ rules – Principles, assumptions – Further details for flocking – Application to computer animations Introduction Ex.Ex. ofof CollectiveCollective MovementsMovements Ex.Ex. ofof CollectiveCollective MovementsMovements Collective Movements

• Several types of collective, coordinated movements: flocking/shoaling, , formation traveling, etc. • In animal societies we will focus on coordinated movements (i.e., flocking as general term) rather than collective non-coordinated movement (e.g., swarming of fruit flies) • Natural movements usually in 2D and 3D • Artificial movements also 1D (e.g., traffic, rail, …) Flocking and Intelligence

• A single agent can sense: 1. The environment, including the changes it has made to the environment • An agent belonging to a multi-agent systems can sense: 1. The environment, including the changes it or other agents have made to the environment 2. The other agents • The course book deals only with mechanisms of type 1 [Martinoli, Alife Journal, 2001] • Can we get Swarm Intelligence with mainly type 2? Flocking and Swarm Intelligence

Answer: Yes! Global structures are based on spatio- temporal distributions of the agents. They are built and destroyed in real time.

– No (i.e., permanent sign) is needed for achieving swarm intelligence – The environment still serve as a medium for transferring information (e.g., air, water, photons flow modified) but information is available only in real time and generated by the nearby existence of a teammate – Links among agents can be optical, sound, … or mechanical (e.g., ant/bee chains of W1) Not Quite Flocking Many multi-agent movements can look like flocking, but they are not:

• Agents started from the same general location with the same fixed movement programs • Agents which begin to travel along some constrained path or towards some fixed point at the same time • Agents moving in strict positional relationship to a designated agent (leader) • Agents moving with or towards a moving target • Agents simply performing obstacle avoidance within a constrained fixed or moving region Collective, Coordinated Movements in Animal Societies

Flocking in Animal Societies

Seems to occur in - All media (air, water, land) - Many animal families (insects, fish, birds, mammals...) - From small groups (2 geese) to enormous groups (herring shoals 17 miles long) - Animals of different ages and sizes - In some animals, only in special Circumstances (e.g. migration) Flocking Phenomena

“...and the thousands of fishes moved as a huge beast, piercing the water. They appeared united, inexorably bound to a common fate. Whence cometh this unity? ”

Anonymous, 17th century

Article “Thought transference (or what?) by E. Selous, in Birds, Constable, London 1930 Flocking Phenomena Rapid directed movement of the whole Reactivity to predators (flash expansion, fountain effect) Reactivity to obstacles No collisions between flock members Coalescing and splitting of flocks Tolerant of movement within the flock, loss or gain of flock members No dedicated leader Different species can have different flocking characteristics – easy to recognise but not always easy to describe Flocking Mechanisms

• Balance between: attraction (aggregation) and repulsion (segregation) • Self-organized coordination based on neighbor mimetism overlapped with enviromental template guidance (e.g., magnetic field, odor field, …) • Ex. birds maneuvers: taking off, landing, turning, route keeping SwarmSwarm Structure:Structure: aa WholeWhole BlendBlend « Unorganized » swarms: ex. seagull, swarm of flies; weak alignment, simple equilibrium between attraction and repulsion => no polarization SwarmSwarm Structure:Structure: aa WholeWhole BlendBlend « Semi-organized » swarms: weak alignment but strong attraction (barracuda) => creation of toroidal structures SwarmSwarm Structure:Structure: aa WholeWhole BlendBlend « Organized swarm »: strong alignment, strong attraction : high polarization => high synchronisation in maneuvers

2 D : V-formation StructureStructure dudu groupegroupe (( IIIIII ))

« Organized swarm »: strong alignment, strong attraction : high polarization => high synchronisation in maneuvers

3 D : cluster (e.g., starlings, snipes) Experimental Studies: Birds

Wayne Potts (1984)

• Fired arrows at flocks of birds • Filmed them with a high speed camera

Findings: • Turning is not simultaneous • A wave of turning propagates through the flock from the site of the disturbance (front, back, side) • Each bird appears to time its turn to fit in with the approaching wave; speed of the wavefront 3 times faster than bird startle reaction time: long range visual perception – the”chorus line” hypothesis • No collisions ever observed Experimental Studies: Fish

Ex. anchovies in Monterrey Aquarium

All rights reserved Experimental Studies: Fish

• Partridge (1982) reported that fish use both vision and the lateral line (array of pressure sensors) to control schooling, but blinded fish can but blinded fish can still school • Teammate distance estimation with vision: 1 d sensed ∝ 2 (dactual ) • Teammate distance estimation with lateral line: 1 d sensed ∝ 3 (dactual ) Benefits of Flocking: Energy Saving

All rights reserved Benefits of Flocking: Energy Saving

V-formations in birds: - geese flying in Vs can extend their range by over 70% - each bird rides on the vortex cast off by the wing-tip of the one in front - individual geese fly 24% faster than flocks UCLA, Rockwell, NASA project Benefits of Flocking: Energy Saving Turbulence reduction in Fish - fish slime in water reduces turbulence - the greater the turbulence, the greater the energy used in swimming - fish cast off minute quantities of slime as they swim - so swimming behind lots of other fish (producing a long front-to-back dimension) may be good - well, maybe.... Benefits of Flocking: Dealing with Predators

− Flash expansion, fountain effect in fish − Pronging in antelopes causes visual confusion in predators − Schooling in fish may confuse predators Benefits of Flocking: Dealing with Preys Ex.: Tuna Parabola - tuna form a parabolic or crescent shaped flock, moving with the concave side forward - this is claimed to gather and ‘focus’ the small fish they feed on - well, maybe… Benefits of Flocking: Navigation Accuracy Ex. Migrations IF • Each individual has only a vague and noisy idea of which direction to fly in, or is a really incompetent flyer... • and if a flock averaged out all the individual directions... • Individual error in measuring the global field is uncorrelated

THEN • From a simple statistical computation, flock direction should have an error proportional to 1 n n = # of individuals in the flock

• Example: 1 million individuals -> 0.1% of the individual error thanks to flocking! Benefits of Flocking: Navigation Accuracy Natural examples:

- Monarch butterflies reach the same trees every year - Wrynecks (migratory woodpecker) do the same from Africa to Valais - Fish reach the same tiny spawning grounds

Application: Fishery statistics: models based on averaged navigational errors (eg., Canadian Bureau of Fish Studies) Reynolds’ Rules Craig Reynolds’ (1987)

A computer animator who wanted to find a way of animating flocks that would be

• Realistic looking • Computationally efficient, with complexity preferably no worse than linear in number of flock -> actually obtained in 1987 O(n2) •3D Craig Reynolds’ Boids (1987)

“ Perhaps most puzzling is the strong impression of intentional, centralized control. Yet all the evidence indicates that flock motion must be merely the aggregate result of the actions of individual animals, each acting solely on the basis of its own local perception of the world.”

Craig Reynolds, 1987 Boids’ Flight Model

A simple 3D model:

• orientation • momentum conservation • maximal acceleration • maximal speed via viscous friction • some gravity + aerodynamic lift (slow ramp up, fast ramp down and stall possible) • wings flapping independently, just for making it more realistic Boids’ Sensory System

An idealized system (but distributed and local!): • Local, omni-directional sensory system • Relative range and bearing system: can detect position and bearing of ALL teammates within a certain radius (no occlusion) • Can perfectly identify all the teammates within the Neighborhood range of detection (2D version) • Immediate response: one perception-to-action loop (no sensory, computational capacity considered) • Homogeneous system (all boids have exactly the same sensory system) • No noise in the range and bearing measurement • Second order variables (velocity) estimated with 2 first order measures (position) Reynolds’Rules for Flocking

1. Separation: avoid collisions with nearby flockmates

2. Alignment: attempt to match velocity (speed and direction) with nearby flockmates 3. Cohesion: attempt to stay close to nearby flockmates

Position controlVelocity control Position control

separation alignment cohesion Arbitrating Rules

• Boid controller is rule-based (or behavior-based) • Time-constant linear weighted sum did not work in front of obstacles • Time-varying, nonlinear weighted sum worked much better: allocate the maximal acceleration available to the highest behavioral priority, the remaining to the other behaviors • Separation > alignment > cohesion -> splitting possible in front of an obstacle

Reynolds’ control architecture: hybrid of Arkin’s and Brooks’s architectures -> more next week! Sensory System Characteristics What is meant by ‘nearby flockmates’? - a spherical zone of sensitivity centered on each boid - the magnitude of sensitivity is a negative exponential of distance (Birds that flock have 300 degree vision, with 10 to 15 degrees overlap straight ahead.) He tried linear sensitivity: ‘bouncy, cartoony’ He tried inverse square: ‘more natural’ Flocking without Obstacles

Does it work? Does it produce realistic flocking? Judge for yourselves. Craig Reynolds’ Boids (1987)

Characteristics of Reynolds’ flocks - they spontaneously polarize - they synchronize their changes in direction - flocks join when they meet - if started too close together, flash expansion occurs - if started too far apart, they may slowly aggregate, or may form ‘flockettes’ which later merge, given a long enough time and a small enough space Moving from A to B The migratory urge Reynolds wanted to be able to direct the flocks along particular courses and to program scripted movements He added a low priority acceleration request (the migratory urge) towards a point or in a direction By moving the target point, he could steer the flock around the environment Discrete jumps in the position of the point resulted in smooth changes of direction Dealing with Obstacles

“Environmental obstacles and the boids’ attempts to navigate round them increase the apparent complexity of the behavior of the flock. (In fact the complexity of real flocks might be due largely to the complexity of the natural environment).” C. Reynolds, 1987

Note: simulated sensory apparatus for detecting obstacles different from that used to localize teammates! Dealing with Obstacles • Approach 1: repulsive force fields –Often used in robotics for manipulator control (Khatib 1985) and mobile (Arkin 1987) – Poor results in Boids • Approach 2: steer-to-avoid – Consider obstacles ONLY directly in the front

– Find the silhouette edge closest to the point of impact (Pi)

– Aim the Boid one body length outside that edge (Pa) P – Worked much better; also more natural a

Pc

Boid Flocking with Obstacles

Does it work? Does it produce realistic flocking? Judge for yourselves. What Happens if You Mess Around

Ex. omit velocity matching:

- flocking happens - but the flocks aren’t intrinsically polarised - but you can polarize them with a strong migratory urge - flocks look like swarms of flies Example: all real experiments up to date have fundamentally focused on implementing exclusively rule 1 (separation) and 3 (cohesion)! Not really polarized flocks …. More on Boids … Craig Reynolds’ web page on boids

http://www.red3d.com/cwr/boids/

- lots of links - lots of downloadable code (including source code) - lots of references More Computer Animations … Ex. Demetri Terzopolous (University of Toronto) – computer graphics, , fish modeling – Goal: test control and coordination mechanisms but also Create cool scenarios … computer animators …. Additional Literature – Week 3 Books • Parrish J. K. and Hamner W. M., “Animal Groups in Three Dimensions”. Cambridge University Press, 1997.

Papers • Vicsek T., Czirok A., Ben-Jacob E., Cohen I, and Schochet O, “Novel Type of Phase Transition in a System of Self-Driven Particles”. Physical Review Letters, 75(6): 1226-1229, 1995. • Toner J. and Tu Y., “Flocks, , and Schools: A Quantitative Theory of Flocking”, Physical Review E, 58(4): 4828-4858, 1998. • Jadbabaie Ali, Lin Jie, and Morse A. Sthepen, “Coordination of Groups of Mobile Autonomous Agents using Nearest Neighbor Rules”, IEEE Trans. on Automatic Control, 48(6):988-1001, 2003