SlideShare a Scribd company logo
1 of 57
Download to read offline
Bristol Centre for Complexity Science
Robofish
Control of networked ethorobotic systems
Adam Zienkiewicz
Supervisors:
Prof. Mario di Bernardo (University of Bristol)
Dr. David Barton (University of Bristol)
A dissertation submitted to the University of Bristol in accordance with the requirements of the degree
of Master of Research by advanced study in Complexity Science in the Faculty of Engineering
Submitted: 21 September 2012
15,502 words
Abstract
Collective groups of animals are able to efficiently self-organise producing coordinated motion and
emergent behaviours. Evolution has moulded the behaviour of individuals, resulting in the complex,
controlled dynamics observed at the macro-level due to the survival benefits offered by coordinated
group behaviour. At the individual level we find that complicated patterns and structures form in
the absence of leaders, emerging instead from local interactions with individuals tracking the motion
of a limited number of neighbours. A new field of ethorobotics, studies the intersection of animal
and robot groups, addressing the question of how we might modulate the behaviour of collective
animal networks in order to control their system-level behaviour. Following recent developments in
engineering robotic fish, and the study of their interaction with real shoals, we investigate strategies
able to steer shoaling behaviour and produce stable, controlled dynamics in a simulated model of
fish. In this work, we develop an agent-based network model to simulate the collective motion of fish
shoals and analyse ensemble dynamics via a set of global observables. We also investigate methods for
approximating global information by communicating local information. A distributed, local control
strategy is developed, based on a predator-prey interaction on a two-species (fish-controller) network
which is able to steer a simulated shoal to a designated target and maintain high density clusters.
Controlled dynamics are investigated using both animated model visualisations and through analysis
of fine-scale ensemble simulations to observe global steady-states. Further to this, we implement an
Equation-Free multiscale approach to investigate the macroscale dynamics in terms of a few low-
dimensional coarse variables. After establishing a simplified coarse-grained system, we use numerical
methods to perform a preliminary study of the stability and robustness of the controlled system.
Dedication and Acknowledgements
I would like thank my supervisors, Mario and David, for their continuous enthusiasm and assistance
throughout this research. I am also indebted to my colleagues, for their moral and academic support:
my desk neighbours Holly, for keeping the kettle warm; and Richard for his pleasantly distracting nuggets
of plant-related facts and ‘did-you-knows’; and the rest of my cohort with whom I share a calm and stim-
ulating working environment. However, I dedicate this work to my girlfriend Riek, as without her love,
kindness, support and recipe ideas, I would not have made it far enough to write this sentence. Thank
you Riek, for helping me through the difficult times, for hearing my struggles, and for giving me the
energy and harmony I so needed.
This work was supported by the Engineering and Physical Science Research Council (EPSRC) [Grant
number: EP/I013717/1].
Author declaration
I declare that the work in this dissertation was carried out in accordance with the requirements of the
University’s Regulations and Code of Practice for Taught Postgraduate Programmes and that it has not
been submitted for any other academic award. Except where indicated by specific reference in the text,
this work is my own work. Work done in collaboration with, or with the assistance of others, is indicated
as such. I have identified all material in this dissertation which is not my own work through appropri-
ate referencing and acknowledgement. Where I have quoted from the work of others, I have included
the source in the references/bibliography. Any views expressed in the dissertation are those of the author.
SIGNED: (Signature of student)
DATE:
Contents
1 Introduction 1
2 Background 3
2.1 Modelling collective motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Control of complex networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 The Equation-free method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 An agent based model of schooling fish 6
3.1 Proximity Network Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Time evolution - network dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 Steering rules - simplified model of schooling fish behaviour . . . . . . . . . . . . . . . . . 8
3.3.1 Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.2 Cohesion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.3 Separation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.4 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5 Model implementation in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5.1 ABM class object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.5.2 Analytical toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.6 Tuning model parameters - achieving collective motion . . . . . . . . . . . . . . . . . . . . 12
3.6.1 Parameter values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.6.2 Evolution of the ABM - visualisation and validation . . . . . . . . . . . . . . . . . 13
4 Global observables of the agent based model 15
4.1 Spatial observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.1 Global centre of mass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.2 Global standard deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 Dynamic observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2.1 Normalised group momentum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2.2 Normalised group angular momentum . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.3 Local approximation of global observables . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.3.1 Defining a two species agent model . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3.2 ‘Scout’ agents as estimators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5 Controlling a network model of mobile agents 20
5.1 Problem definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.2 A method for distributed, local control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.2.1 Agent-control interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.2.2 Controlled agent dynamics and gain parameter tuning . . . . . . . . . . . . . . . . 23
5.3 Control validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.3.1 Effect of control on a single network . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.3.2 Ensemble simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.3.3 Animated examples of agent control . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6 Coarse-grained multiscale analysis 31
6.1 The Equation-free method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.2 Selection of coarse-grained observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.3 Restriction operator - obtaining coarse variables . . . . . . . . . . . . . . . . . . . . . . . 33
6.4 Lifting operator - generating micro-scale ensembles . . . . . . . . . . . . . . . . . . . . . . 33
6.5 Configuring the coarse timestepper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.6 Coarse time integration - validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.7 Coarse-grained stability analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.7.1 Linearised stability analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.7.2 Quasi-Newton solvers and bifurcation analysis . . . . . . . . . . . . . . . . . . . . 39
7 Conclusions 42
7.1 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Introduction
1 Introduction
Flocking is a general description of the collective behaviour of a wide variety of different animals which
live and cooperate in large social groups. Otherwise known as schooling in fish, or swarming in insects or
bacterial colonies; the emergent behaviour and complex patterns displayed by gregarious animals have
intrigued naturalists, theoreticians and the layman alike. The accepted view that collective motion of
this type results in the absence of a leader has been justified through the simulation of artificial flocks
which display similar behaviour. The rich, dynamic structures of a flock emerge as a result of simple
interactions between the group members based solely on local information. A major development in this
area by Aoki [1] and subsequently Reynolds in 1986 [2] has lead to myriad theoretical models expressing
animal group behaviour in terms of heuristic rules which govern their individual motion. In a wide
variety of disciplines, from social science to physics, there has been a strong desire to understand and
develop theories on how some complex structures self-organise. Indeed, many such theories now support
the idea that the complex spatio-temporal patterns, noted in both eusocial insects colonies, and higher
vertebrates such as schooling fish [3] and birds [4]; emerge through interactions between individuals ex-
hibiting simple sets of behavioural rules [5–8].
The course of evolution has moulded the collective behaviour of species, given the survival benefits pro-
vided only when cooperating as a group [9, 10]. Specific advantages include optimised group foraging,
predator evasion, or efficient locomotion for example in schooling fish [11,12]. The specific behaviours,
or rules, governing the collective dynamics of different animals is therefore wholly determined by their
evolutionary path. A novel way of studying these different behaviours has been developed in the fields of
robotics and biomemetics, specifically in studying the interactions and behaviour of schooling fish. By
engineering artificial robots, or robofish, to imitate certain aspects of fish behaviour, recent studies have
provided a more complete understanding of the interactions amongst fish and their surroundings [12–14].
Interestingly this field of research, known as ethorobotics, has also demonstrated how group behaviour
can be manipulated by targeting specific sensory cues, with widespread applications for control theory
in robotics and dynamical systems in general.
The purpose of this work, motivated by recent developments in biomimetic robofish and their interaction
with live schools of fish, is to model a two-component population comprised of fish and artificial con-
troller agents, where intra-species interactions are manipulated for the purposes of control. In developing
a control mechanism for a school of fish, we compare two recent experimental examples of fish-robofish
interaction, a repulsive predation-response [14], and the novel discovery of group acceptance, or attrac-
tion, of fish to a biomimetic robot [12, 15]. In this report we present a network embedded agent-based
model of the collective motion, with an open-ended structure incorporating an extendible set of inter-
action behaviours. Subsequently, we propose a distributed control mechanism, inspired by an existing
method of global flock control designed to fetch and gather mobile agents to predetermined goal [16].
While the latter technique has proved successful in automating the task of a well trained sheepdog and
his farmer, the motivation for actively controlling fish is inspired by more compassionate considerations.
In the face of the ever-increasing threat from environmental disasters, it is hoped that by controlling
large fish schools, we could to steer whole populations away from areas known to be hazardous [15].
Unfortunately, many of these hazards arise from human caused accidents such as oil spills, affecting
huge areas of the ocean for extended periods of time. The unprecedented ability to control marine life
may therefore provide an effective way to mitigate the widespread damage caused by these potentially
catastrophic disasters.
1
Introduction
In conjunction with existing analytical methods characterising the collective behaviour of fish schools
engaging a robot fish [17], we extend our analysis of controlled agent dynamics using a multiscale compu-
tational approach. As with many complex systems we observe the characteristic patterns and emergent
behaviours of collective motion largely in terms of its macroscopic evolution. Having developed a agent-
based model simulating the microscopic evolution of fish under the influence of control, we implement the
Equation Free method to derive a macroscopic system where coarse-grained evolutionary dynamics can
be subjected to traditional numerical methods of analysis [18,19]. In the available scope of this work, we
perform a preliminary system-level analysis investigating control stability at macroscopic steady states
with respect to realistic parameters of the agent model. The results from this analysis largely provide a
foundation for future work and highlight important considerations for construction of the coarse-grained
model.
In the following chapter, we provide a brief background summary into the important aspects of the
research, including techniques for modelling collective behaviour; control of complex networks, and an
introduction to multiscale computational methods. A description of the agent-based model is provided
in chapter 3, with our definitions of global system observables and preliminaries of control outlined in
chapter 4. The development of the control mechanism in discussed in chapter 5 including a validation
and summary of our results. Having provided a micro-scale model of fish and potential robofish, we
then discuss a multiscale computational approach using the Equation-Free method and the results of
this analysis in chapter 6. A final summary of our conclusions and challenges for the future is discussed
in chapter 7.
2
Background
2 Background
2.1 Modelling collective motion
The modelling of flocks, herds and schools has been considered by a diverse community of specialists
from backgrounds such as computer graphics, biology and more recently theoretical physics. The most
well known model to simulate flocking, attracting the attention of these groups, was an algorithm by
Reynolds in 1987 [2], developed purely in the interests of visualising coherently flying objects. Imple-
menting what is known as a ‘self-propelled particles’ model (SPP), objects in this model move along
trajectories determined by equations describing three interactions rules acting between neighbouring ob-
jects. Reynold’s model followed soon after the pioneering work of Aoki [1] which studied the collective
motion of fish. In this paper Aoki first introduced the rules which are now ubiquitous in generic models
of coordinated animal motion: avoiding collisions, aligning in the direction of neighbours and staying
close to the local centre of mass (see figure 1 in the following chapter. Importantly, models such as these
successfully confirmed the statement that collective motion occurs in the absence of leaders, arising from
local interactions.
The models described above belong to a class known as agent-based models (ABM). Seen as the nat-
ural extension to cellular-automata (CA) models which describe grids of interacting cells with variable
internal states, agent-based models are not restricted to performing actions simultaneously at constant
time-steps, instead updating their internal states according to discrete-event environmental cues. Im-
portantly to the study of biological systems, agent-based models allow for the ‘cohabitation’ of agents
with different environmental (external) experiences and are not required to explicitly tile the simulated
arena. For these reasons, agent-based models have been used extensively in the study of complex sys-
tems allowing us to study macroscopic behaviour when only a precise microscopic description is available.
A decade after the first SPP models were first introduced, an important quantitative analysis was pub-
lished by Vicsek [20] in 1995. Using a statistical-physics type approach, this work introduced stochastic
perturbations into a simplified deterministic SPP model in order to study phase transitions between
ordered and disordered motion. The Standard Vicsek Model as it is known, laid the foundations for
myriad variants investigating specifics such as finite size scaling behaviour [21]; single rules models [22];
potential-field models [23]; and adaptations for studying bacterial swarms by nematic-collision [24]. The
accumulation of results in this field highlight the huge variety of macroscopic behaviours which emerge
from simple, local interaction rules, dependent on limited set of parameters.
As we have discussed, agent-based models provide a valuable tool for modelling the micro-scale dynamics
of collective motion. In addition to this micro-scale approach, a variety of important continuum methods
have been developed, in the context of providing a macroscopic description of SPP models. Methods such
as those by Toner and Tu [25] and later Bertin et al. [26] provide fully nonlinear descriptions of collective
motion in terms of the higher-dimensional dynamics. Much in the same way as the Navier-Stokes equa-
tions provide a continuum description of fluid mechanics, these models incorporate equations derived
from symmetry and conservation laws with parameters describing large-scale system behaviour. Other
macro-scale analytical models include those which treat interacting individuals as coupled oscillators and
study their synchronisation, or coordination, in a spatial framework [27]. This latter technique extends
existing theories of synchronisation within static networks, such as those of heart cells and neurons, to
networks with spatial dynamics such as fish schools. A key advantage of an appropriate continuum ap-
proach is the ability to provide quantitative predictions of long-time, or long-distance flocking behaviour,
3
2.2 Control of complex networks
a feature which is inaccessible to micro-scale agent-based dynamical models. As we shall discuss later, a
system-level analysis using standard numerical methods typically requires a full macroscopic dynamical
description.
2.2 Control of complex networks
Network theory has become increasingly popular resource in the study of complex systems, providing an
extensive toolbox of methods to analyse and interpret systems composed of many interacting subsystems.
The basic description of a network, or graph, is a set of vertices, or nodes, interconnected with a set of
links or edges. More complex descriptions of networks include directed edges which can be assigned a
specific weight, or cost function. Typically the distribution of edges is such that it reflects the variable
density of the structure described by the network. The ubiquity of networks in the modern world, both
physical and abstract, has motivated diverse research efforts to develop a framework to control com-
plex networks and self-organising systems. Recent developments include analysing the controllability
of networks given their specific degree (edge) distribution [28] and ‘pinning’ techniques which induce
synchronisation throughout a network by external control of a small fraction of nodes [29]. Unfortu-
nately however, the interpretation of these results in the context of collective motion is non-trivial where
descriptor network topologies are inherently dynamic [30]. When describing a group of flocking animals,
or robots, we generally consider a dynamically evolving network of nodes (agents), connected with a
set of edges which varies in time. In this description, connected components are said to be interacting,
or can share information. Provided with this network interpretation it possible to obtain theoretical
explanations for the observations in the dynamics of specific SPP models: for example, how agents reach
consensus in their alignment despite the continuous rewiring of the decentralised network [31].
Theories of consensus and ‘rumour-spreading’ on networks are central to understanding how the dynam-
ics on, and the dynamics of networks, can be controlled. The parallels between flocking behaviour and
consensus on networks have are discussed by Blondel et al. [32] in terms of an ‘agreement’ algorithm
which enables asynchronously communicating agents to reach consensus on a scalar value. These re-
sults have a direct relationship to general control problems such as multiple agent rendezvous [33, 34]
(consensus on location) and obstacle avoidance. The main focus of research into multi-agent control has
been to develop distributed flocking algorithms to solve these control problems by devising local control
strategies applied to individual agents, for example those representing a swarm of robots. The engi-
neering applications of flocking are wide ranging, from mobile sensor networks, self-organisation of data
networks and the many, less tasteful military applications. A general theoretical framework of consensus
algorithms, designed to control flocking is discussed by Olfati-Saber et al. [35].
With respect to our investigation, there has been comparatively less research into combined networks
of robots and animals, also known as ethorobotics. In these joint networks we can study methods of
influencing animal motion by modulating their behaviour through interaction with robots. In their pa-
per [36], Halloy et al. used mini-robot cockroaches to successfully influence a majority decision among
the population. The work which has motivated the current study is due to Porfir and Marras et al. [12]
who have produced a biomimetic robot fish, who’s presence in a live school is ‘accepted‘ as attractive
stimulus. In their paper Aureli et al. [17] present a set of analytical methods which are used to study
the interactions between the shoal and robofish. The work presented in the current study integrates
some of these methods, developing a two-species agent-based model and control mechanism based on
the modulation of intra and inter-species behavioural interactions. Specifically we will describe a control
4
2.3 The Equation-free method
mechanism based on a predator-prey type interaction between fish and robots, investigated experimen-
tally by Swain et al. [14]. A control mechanism exploiting an attractive fish-robofish interaction could
well be based on recent experiments by Celikkanat and Sahin (2010), in which robots swarms are guided
by a minority of intelligent individuals [37].
2.3 The Equation-free method
When creating models of complex systems, especially those discussed in relation to collective motion, we
are often restricted to providing a precise description only at the microscopic level. A common hallmark
of such systems is the observation of behaviours or patterns at the macroscopic level, emerging as a result
of the interactions and dynamics at the micro-level. For example in a school of fish, we find flowing bands
of coherently aligned individuals; complex milling structures and clustering; dynamical features which
are all observed only at the macroscopic level. As we now understand, this macroscopic behaviour is
produced without leaders, resulting purely from interactions between individuals, or fine-scale processes.
Given an accurate microscopic description, it is often impossible to analyse, and therefore predict, the
macroscopic dynamics of such systems over large spatio-temporal scales. Direct simulations are often
restricted to small subspaces or very short time-scales due to their computational expense and important
methods such as numerical bifurcation analysis are impossible without a coarse-grained description.
In certain cases, macroscopic models can be formally derived by considering relevant conservation laws or
symmetries, as we discussed earlier on. For some systems there is an appropriate mathematical method
which can be used to derive macroscopic equations from the fine-scale description. For many complex
systems however, the coarse-scale dynamics are only accurately captured when a complete, fine-scale
description is retained. The Equation-Free method developed by Kevrekidis et al. [18, 19] is a multi-
scale approach, providing a bridge between a fine-level description and coarse-grained dynamics. A key
component of this method is the coarse timestepper, discussed in more detail in chapter 6, which circum-
vents the need to derive explicit equations to provide closure of the micro-scale system, hence the name
‘equation-free’. Coarse-graining is achieved by computing a set of low-order, macroscopic observables,
which are used to initialise, or ‘lift’ an ensemble of micro-scale systems which are simulated in short
bursts. By choosing the coarse-grained observables such that higher-order moments quickly become
functionals of the low-order variables, the coarse timestepper can provide a closed form solution of the
underlying, higher-dimensional dynamics.
Once we have obtained the coarse-grained dynamics we can employ the traditional array of continuum
numerical techniques as coarse-level solvers, for example to study bifurcations or optimisation. There
have been a number of relevant applications of this method which have provided motivation for our
implementation in chapter 6. One example, a paper by Moon et al. [38], uses an Equation-Free method
to provide a coarse-grained solution to an alignment consensus problem in groups of animals similar to
those discussed earlier. Also valuable to our study, has been the work of Tsoumanis et al. [39] who have
implemented Equation-Free methods to provide a multiscale analysis of an agent-based model describing
a toy social network.
5
An agent based model of schooling fish
3 An agent based model of schooling fish
In order to simulate the interactions and dynamics of a collection of autonomous individuals, an agent-
based model (ABM) is used which describes both the internal states of individuals and the rules by
which they interact. ABMs of this kind, known as self-propelled particle models (SPP), are commonly
used to describe and explore the dynamics of flocks, swarms or schools of fish, and have been widely
studied [20,35,40] due to the variety and complexity of group motion which emerges from a very simple
set of rules. Given a set of agents with initial internal states, their evolution is entirely determined by the
operation of the agent rules, subject to any stochastic variables defined in the model. Most commonly, a
single population of identical agents is simulated in order to explore the behaviour of the group dynamics
as a function of the rules common to all agents.
As a prelude to a more behaviourally accurate model of fish interactions, the ABM developed in this
project is a generalised ‘skeleton’ model, incorporating multiple interaction rules which are combined
linearly with a proportional gain assigned to each. Using this approach the model can be later modified
to more closely approximate the behaviour of a species of fish, or any other gregarious animal, with
specific parameters obtained from the appropriate experimental research. Regardless of differing animal
behaviours, the internal states of all agent can ultimately be described in terms of their position and
velocity. In all models however the interaction rules will only describe a limited subset of the animals
behaviours. By adjusting the rules and fine tuning the relevant parameters, one can hope to replicate
the motion of sparrows or zebrafish from the same basis model without the need to worry about feathers
or fins.
The implementation of the ABM in this investigation follows a modified version of a self-driven particle
model, colloquially known as ‘boids’, originally conceived by C.W. Reynolds [2] in the 1980s. The al-
gorithm used in the model gained much recognition in the field of computer graphics with its ability to
reproduce the natural complexities of collective motion in an entirely deterministic manner. The model
includes three primary steering behaviours which describe how an individual agent, or fish, reacts in
accordance with its local neighbours in the group. The local group is characterised by a fixed distance
representing the maximum range R, of influence each agent has on others. The importance of localising
agent interactions is twofold: firstly it emulates the natural limitation of communication at a distance,
for example fish swimming in murky water; and secondly in terms of greatly reducing the computational
requirements for large agent populations.
Individual fish are represented as members of an ‘Agent’ class encapsulating the core variables for each
agent; specified simulation parameters and the variety of functions required to perform the time evolution
of the multi-agent system. Similar to previous experiments studying the motion of fish [17, 41, 42], we
consider a two-dimensional approximation, justified since the major component of collective motion
within small schools of fish is generally observed to lie in the horizontal plane. The approximation is
particularly appropriate to certain fish in shallow water habitats in the wild, or controlled experiments
in shallow tanks. Each agent is therefore described in terms of their current position in a square arena,
of side length Lxy centred on the origin; and their current velocity in orthogonal coordinates. Both
properties are held internally as 2-vectors:
x(i) = x(i)x, x(i)y
v(i) = v(i)x, v(i)y (1)
6
3.1 Proximity Network Model
i.e. the speed of each fish equal to the magnitude of the vector v:
ui = vi (2)
3.1 Proximity Network Model
In this model, all agents within the specified radius of influence affect each other equivalently, where
interactions can be decomposed into a linear combination of pairwise contributions. Interacting agents
can therefore be considered as connected nodes in an undirected, time-varying network of order N (N
agent population), where an edge exists between agents separated by a distance less or equal to an
imposed cut-off radius R:
G = (V, E)
V = {Vi|i = 1, ..., N} ∼ N individual agents
E = {Vi, Vj} , Vi, Vj ∈ V ∼ edges between interacting agents (3)
where the graph G is undirected, i.e.:
Evi,vj = Evj ,vi (4)
At any individual timestep throughout the simulation, the connectivity of a proximity network is therefore
fully described by the adjacency matrix A = [aij], changing over time with elements ai,j according to:
aij =
1 if |xi − xj| ≤ R
0 otherwise
(5)
The network structure reflects the connectivity of the agents in terms of those which are currently
influencing each other. In this simple implementation, the network model treats the radius of influence
as a hard cut-off between interaction and non-interaction. Communication between all agents within the
radius R are therefore identical in their relative strength.
3.2 Time evolution - network dynamics
The SPP model implemented utilises a discrete-time, sequential agent update method with unit length
simulation timesteps, in arbitrary units of time (i.e. dt = 1). At each timestep of the simulation, the net-
work structure is updated using (5) before calculating a set of steering correction vectors va(i), vcm(i), vs(i)
for the i’th agent in sequence. The velocity of agent i at the next timestep (t + 1) is updated by the
linear combination of the ‘steering’ vectors, as follows:
v(i) (t + 1) = v(i) (t) + kava(i) (t) + kcmvcm(i) (t) + ksvs(i) (t) (6)
where ka, kcm, ks : R ≥ 0 - are gain parameters adjusting the relative strength of each steering behaviour.
The position of each agent at the next timestep therefore becomes:
x(i) (t + 1) = x(i) (t) + v(i) (t) dt, dt = 1 (7)
At each time step the speed of each agent, vi is restricted within a range from a minimum value vmin
and maximum vmax. A realistic model of animal motion should prevent agents from moving arbitrarily
7
3.3 Steering rules - simplified model of schooling fish behaviour
fast whilst a minimum speed restriction prevents the group velocity from diminishing to zero. The
direction of motion is maintained by renormalising the unit vector of agent velocities outside the limits
as follows:
vi =
vi
vi
· vmax if vi > vmax
vi
vi
· vmin if vi < vmin
(8)
A similar operation to the one in (8) is also available if we wish to prescribe constant speed to all agents
in the simulation.
3.3 Steering rules - simplified model of schooling fish behaviour
Agents are subject to three primary steering rules which are combined and used to update each par-
ticle’s velocity at the next timestep of the simulation. These simple rules are designed to represent
some of the known behaviours generally observed in gregarious animals. Central to each steering rule
is the calculation of a vector describing the average position or velocity of the local group, or neigh-
bourhood ni of agent i as perceived by the agent. The neighbourhood of an agent is defined as the
set of nearby agents within a range of influence of radius R from a given agent, excluding itself where:
ni = {j ∈ V : xj − xi < R} , j = i. The simplified model coordinating motion within a school of fish
therefore relies on each agent’s perceived local averages and knowledge of its own position or velocity
relative to this average.
Given that entire agent class is embedded within a dynamically evolving network, vector calculations
can be conveniently expressed as a sum of appropriate elements aij of the the network adjacency matrix
A. Averages are calculated simply by accumulating the position and velocity information over the local
group and dividing by the node degree of the agent.
• Average position (centre of mass) of group local to agent i:
x i =
N
j=1
(aijxj)
N
j=1
aij
(9)
• Average velocity vector of group local to agent i:
v i =
N
j=1
(aijvj)
N
j=1
aij
(10)
It is emphasised that these ‘perceived’ vector averages do not include the position or velocity of the
primary agent i, and are denoted with angle brackets.
In this model, behavioural rules are each expressed in terms of individual steering correction vectors
which are added to the current velocity, altering the trajectory of an agent according to its various
interactions at the previous timestep. The basic rules used in this model are described, along with their
motivation, in the following sections.
8
3.3 Steering rules - simplified model of schooling fish behaviour
3.3.1 Alignment
A traditional component in SPP models describing collective motion has been to provide a rule that
allows agents to match their velocity with neighbouring agents. Many important insights into collective
motion, for example the aforementioned work by Vicsek et al. [20] are models based solely on this type
of interaction. In the Standard Vicsek model, agents have a fixed speed v , with velocity described by
a heading angle, updated to match the neighbourhood average. The alignment rule implemented in this
model differs in that v is not fixed, computing instead a velocity correction as a function of the current
velocity and the local group average velocity:
alignment va(i) = v i − vi (11)
The vector va computed by the alignment rule in (11) is simply the two component difference between
the current velocity of agent i and the local group average. Adding a proportion of this vector to the
current agent velocity has the effect of aligning the velocity of agent i with the neighbourhood average,
moderated by gain parameter ka.
3.3.2 Cohesion
In addition to aligning with their close neighbours, it is frequently observed that members of a school
or flock or animals display a tendency to minimise their distance from their closest neighbours. Group
cohesion is a distinctive feature of the many gregarious animals where it is usually asserted that members
of the flock gather together in order to benefit from a perceived ‘safety-in-numbers’. A strong tendency
for group cohesion is observed in fish schools [12, 17, 42, 43]. The exact behavioural processes inducing
group cohesion are of course unique to different species. Across all species however, the evolution of
flocking behaviour is thought to be primarily driven by predation; however there are different inter-
pretations of how safety-in-numbers benefits a population or the individual. A ‘many-eyes’ theory [9]
suggests that information regarding a threat is disseminated more efficiently in large, cohesive popula-
tion. A ‘selfish herd’ theory on the other hand, suggests that there are spacial benefits of a large group,
enabling individuals to change their relative position between another member of the group and a po-
tential predator [44]. Recent experiments testing these hypotheses with real sheep-sheepdog interactions
have provided increased support for the latter [45]. The generality of these results however, and the
implications for interpreting interactions in fish schools, is not fully clear.
vcm(i) = x i − xi (12)
The cohesion rule in (12) above calculates a velocity correction from the position vectors xi of the agent
and local group average x i (perceived local centre of mass position). The resulting correction depends
implicitly on the distance between the two points, producing a proportionally stronger correction at
greater distances. The cohesion rule therefore heuristically reflects experimental evidence which finds
that fish separated by greater distances compensate more strongly in order to regain their cohesion [42].
In this model, application of the cohesion rule moves agents fractionally closer to the local group position,
moderated by the gain parameter kcm.
3.3.3 Separation
A separation rule is used to enforce a ‘soft’ repulsion between agents, reflecting experimental observations
of fish behaviour and prevents agents becoming so close that they would physically overlap. A steering
correction vector vs is calculated by accumulating vectors opposing all neighbouring agents closer than
9
3.4 Boundary Conditions
a radius rsep away from agent i:
vs(i) = −
N
j=1
aijd (xi, xj) (xj − xi) (13)
where: d (x, y) =
1 if x − y ≤ rsep
0 otherwise
(14)
The separation rule in (13) returns a total separation correction vector which produces steering in the
opposite direction to the nearby neighbours, with a strength moderated by gain parameter ks.
Schematic examples of the steering rules are show in figure 1, courtesy of C.W. Reynolds website [46],
where each is described in isolation, acting on a single agent with respect to its neighbours.
Alignment Cohesion Separation
Figure 1: Schematic representation of steering rules [46]
3.4 Boundary Conditions
Two methods of applying finite size simulation boundaries are considered: reflective and periodic bound-
aries. Both methods provide the means to constrain agent positions within the square simulation arena,
defined by the side length Lxy - a necessary restriction in any simulated particle model. The reflective
algorithm constrains particles encountering the boundary by negating the velocity component orthogonal
to the respective boundary vector. Alternatively, a periodic boundary maps agent position vectors onto
the opposite side of the simulation arena by addition or subtraction of Lxy.
Periodic conditions are commonly used when simulating an arena of infinite size, for example to study
bulk properties of materials. Applying this method normally has the advantage of minimising artificial
boundary effects which can cause undesirable (unphysical) artefacts, or fluctuations in global observables
(see 4.2.2). For the purposes of this investigation however, reflective boundaries were chosen as being
most appropriate for the study of a dynamical system modelling physically confined agents, i.e. fish in a
tank. A ‘hard’ reflective boundary condition inevitably produces artefacts in global observables, which
should be considered in the full analysis of the dynamical system.
3.5 Model implementation in Python
Both the agent based model, and the suite of analytical functions constructed to investigate controlled
collective motion have been developed using the open source Python programming language [47]. The
ability to modify model parameters interactively and write flexible, customisable scripts for analysing the
resulting dynamics, is a major benefit of interpreted languages like Python. By utilising pre-compiled
libraries (SciPy/NumPy) for precise numerical calculations, a good comprise is reached between faster
performing languages such as C or Fortran development time. The simulation program is divided into
10
3.5 Model implementation in Python
Model variables agent position (i = 1..N) : xi
agent velocity (i = 1..N) : vi
network structure : A
simulation time step : t
Model parameters simulation arena size : Lxy
interaction radius : R
steering rule gains : ka, kcm, ks, kn
velocity restrictions : umin, umax
minimum agent separation : rsep
Functions / Methods randomise positions : assign position to agents from a uniform dist.
randomise velocities : assign velocity to agents from a uniform dist.
network update : update network adjacency via (5)
get local info : compute local group values via (9 & 10)
velocity update : compute new agent velocities via (6)
position update : update agent positions via (7)
restrict speed : apply speed restrictions via (8)
output observables : compute global observables (see 4)
Table 1: Overview of the agent-based model object class (extended in section 5.2.2)
two parts, described in the following sections.
3.5.1 ABM class object
The primary code structure is an object class encapsulating the entire agent-based model, which can
be instantiated independently with unique parameters, as many times as memory restrictions permit.
Each ABM object instantiated in memory represents an isolated realisation of the model; storing agent
position / velocity vectors; model parameters and the functions (methods) used to evolve the micro-
scale system through each time iteration. A synopsis of an the ABM class, including the basic model
parameters in table 1.
The ABM class acts as a self-contained micro-scale simulation model which can be initiated with a
set of initial conditions and parameters, evolved in time using the model functions, and probed for
numerical outputs. The model object inherits functionality from the NetworkX Python library; providing
a comprehensive suite of functions to describe, analyse and visualise network structures [48].
3.5.2 Analytical toolbox
The second unit of code is a wrapper module containing a set of ‘external’ procedures which initiate,
instruct and analyse the agent based model realisations. Most of the analytical methods described in
this investigation, and essentially the multiscale coarse-grained analysis, rely exclusively on computing
ensemble averages of model dynamics. A major benefit of using an object oriented approach is the
ability to parallelise the simulation of multiple micro-scale realisations to exploit the full processing
power of multi-core processors. A set of ABM realisations can then queued and run independently
cores, in parallel, until each ‘thread’ is completed. The outputs of each model are then accumulated
prior to analysis. Since information is not shared between model realisations until each is completed,
an approximately linear performance gain can be achieved relative to the number of processing cores.
The experiments in this work have been performed on up to four, dual-processor (4 cores per CPU)
Linux machines, each with 8 Gb of system memory. Further processing efficiency can be achieved
via more complex algorithms and multiple machine clusters, a technique addressed in a number of
papers specifically modelling the dynamics of fish schools [49,50]. Using the current implementation and
11
3.6 Tuning model parameters - achieving collective motion
hardware, it is possible to initialise and simulate a 30 agent model through 100 timesteps on an 8-core
machine in ∼ 3 seconds and a corresponding ensemble of 500 simultaneous simulations, using parallel
code, in approximately 188 seconds. For ensemble processing therefore, the multi-core approach indeed
provides a linear (∼ 8 times) increase in speed.
3.6 Tuning model parameters - achieving collective motion
The parametrisation of the fish ABM model described in this research remains entirely without specific
units, for the purposes of both simplicity and generality. Similarly, the dimensions of all parameters
are trivial, expressing either a position, length, velocity or are dimensionless gain factors. It is already
understood that the general model description is capable of representing a wide variety of complex
global behaviours [2]. It is important however, that the parameters of the model are defined such that
the steering rules act in such a way that results in a minimum level of collective motion, whilst being
approximately commensurate to those of real fish. A valid set parameters for this implementation was
obtained heuristically, based on certain restrictions. The task of accurately matching specific parameters
with experimental values is left to future work (see 7.1).
3.6.1 Parameter values
Given the limited time and computing resources available for this investigation, the number of agents
N per model realisation is restricted to around ∼ 30 agents for our numerical analysis. The procedure
implemented to update the agent network is of complexity O(N2
) - a naive algorithm evaluating all
pairwise euclidean separations. Although faster classes of algorithms do indeed exist for this task [51],
small agent (fish) populations are found to be acceptable for the current research. Although agents
are not explicitly assigned a size in the model, a scaling approximation can be derived in terms of the
minimum separation parameter rsep, interpreted as a unit of the order of one fish body length (BL).
The set of default parameters used in the model are listed in table 2, and can be compared with some of
those in other experiments with real fish [17].
simulation arena size : Lxy = 15 ∼ 75 BL
minimum agent separation : rsep = 0.2 ∼ 1 BL
interaction radius : R = 3 ∼ 15 BL
maximum agent speed : vmax = 0.3 ∼ 1.5 BL/∂t
minimum agent speed : vmin = 0.05 ∼ 0.25 BL/∂t
alignment gain factor : ka = 0.15
cohesion gain factor : kcm = 0.01
separation gain factor : ks = 0.5
Table 2: default parameter set for fish ABM - with length/velocity units expressed in nominal units of
fish body length (BL)
The parameters values defined in table 2 are found to produce evolving dynamics consistent with the
behaviours described by the steering rules in 3.3. The density of agents in the simulation arena has
been chosen such that it is of a similar order of magnitude to a typical system which could be studied
experimentally. Velocity restrictions are also within a correct order of magnitude relative to a fish body
length.
12
3.6 Tuning model parameters - achieving collective motion
3.6.2 Evolution of the ABM - visualisation and validation
The evolution of a single agent-network realisation, is produced via the following sequence:
1. initialise agent positions e.g. with a uniform distribution across the simulation area
2. initialise agent velocities with uniform random samples within the speed restrictions
3. compute/update the network adjacency (update network structure)
4. compute individual steering correction vectors and apply total velocity corrections to each agent
in sequence
5. apply speed restrictions to all velocity vectors
6. update agents positions and apply boundary conditions
7. repeat from (3)
At any given timestep, the evolution of the particle system can be visualised by plotting the positions
of the agents in the x, y plane, with pairwise links identifying interacting agents. A histogram of the
position data is then used to highlight the distribution in the plane. The functionality of the model is
tested by initialising agents uniformly in the plane with randomised velocity vectors. A representative
evolution of a system of 30 agents is shown as two time snapshots in figure 2 and 3.
After observing many prolonged time evolutions of the agent system, the following observations have
been made, successfully including all of the expected hallmarks of collective motion:
• Initialised uniformly in the plane, agents undergo a rapid phase of clustering, due to their initial
proximity.
• Agents on the outskirts of a cluster are observed both to align with the local group average velocity,
and converge towards the group centroid position.
• The distribution of particles in a particular cluster do not converge to a single point, instead
maintaining a relatively stable distance from one another as intended by the separation rule.
Figure 2: Agent model initialised with uniformly distributed random positions: (left) Visualisation of
network structure, with lines connecting interacting agents, coloured by node degree. (right) Position
distribution histograms indicating a fairly uniform distribution in x and y
13
3.6 Tuning model parameters - achieving collective motion
Figure 3: Agent model in figure 2 evolved through 20 timesteps: (left) Network visualisation identifying
cohesion and clustering of agents. (right) Position distribution histograms with peaks identifying agent
clusters
• Clustered agents reach a consensus velocity and drift together as a group with smaller groups
remaining fairly stable after reflection from boundaries.
• Interacting clusters commonly form a super-cluster, with a resultant group velocity in a direction
dictated by the combined velocity of the previous components.
• Alternatively group collisions may results in cluster fracturing with subsequent recombination; a
typical, and beautiful signature of natural collective motion.
Emergent behaviours such as these are prevalent in flocking starlings and indeed fish schools [3,4].
Animated examples of the mobile agent model, prior to implementing a control mechanism, can be
viewed at the the following URLs:
• 500 agents in a Lxy = 15 arena, with speed restriction vmax > v > vmin
- http://www.youtube.com/watch?v=uHccGYhHgy8
• 100 agents in a Lxy = 15 arena, speed constant v = 0.3
- http://www.youtube.com/watch?v=q3_X1pGu84U
• 500 agents in a Lxy = 30 arena, speed constant v = 0.6
- http://www.youtube.com/watch?v=Eve6GK2qusk
14
Global observables of the agent based model
4 Global observables of the agent based model
In order to quantitatively describe the evolution of the model we define a set of global observables based
on the state variables of a system at any time t. Global observables can be used to compare data
between the different parameterisations of the model, or combined to generate ensemble averages from
set of randomly initialised model realisations. In terms of the ABM we have described, the only state
variables which evolve in time are the positions and velocities of each agent, and the adjacency matrix
A describing the structure of the interaction network. From this information it is possible to construct
a number of useful observables describing dynamical and spatial group properties.
Observables described in this section are calculated continuously in each model realisation and are
therefore accessible to the analytical wrapper functions described in 3.5.2.
4.1 Spatial observables
The primary observables used to analyse collective dynamics in this study are the mean position of all
agents µcm, and the associated standard deviation σcm. These vectors provide a snapshot of the agent
system in terms of their combined position as a ‘super-cluster’, along with a measure of how tightly
the agents are gathered about the mean position. Crucially, these two global variables will be used to
construct the coarse-grained variables used in the equation-free multiscale analysis discussed in section
6.
4.1.1 Global centre of mass
The global mean position, referred to as the global centre of mass µcm, describes the average vector
position taking into account all agents, defined as:
µcm (t) =
1
N
N
i=1
xi (t) (15)
with an associated vector for each agent relative to the centre of mass:
ri (t) = xi (t) − µcm (t) (16)
4.1.2 Global standard deviation
The standard deviation around the mean vector, resolved as a vector in orthogonal dimensions, is com-
puted in the usual way for a complete set of discrete variables:
σcm (t) =
1
N
N
i=1
(xi − µcm)
2
(t) (17)
4.2 Dynamic observables
Two additional global observables are introduced, which are useful in describing the coordinated dynamics
of the agent system in terms of the velocity vectors. We define a normalised group momentum P, and a
normalised group angular momentum L in the same way as described in [17] to study the dynamics of
real fish schools.
15
4.3 Local approximation of global observables
Although the calculation of P and L are incorporated within the ABM as described, the scope of this
preliminary investigation has limited their inclusion in a full analysis or in the equation-free approach.
A brief summary of their calculation and significance, is however provided below.
4.2.1 Normalised group momentum
The normalised group momentum P can be viewed as an order parameter describing the collective motion
of the system, capturing the degree to which the velocity vectors of the group are aligned, irrespective of
their magnitude or position. Given this description, the group momentum is equal 1 when all agents are
aligned in the same direction, and equal to 0 when the velocity unit vectors are uniformly distributed.
The latter condition is satisfied when the group centre of mass is stationary, i.e. µcm (t + 1) = µcm (t)
P (t) =
N
i=1
vi (t)
N
i=1
vi (t)
(18)
4.2.2 Normalised group angular momentum
The normalised group angular momentum L is useful for studying emergent structures which are highly
aligned relative to the group centre of mass - for example single mill structures in which agents collectively
rotate around the centre of mass. The group angular momentum is at a maximum when every agent
rotates around the centre of mass in the same direction, and zero when the angular momentum w.r.t.
the centre of mass is zero.
L (t) =
N
i=1
ri (t) × vi (t)
N
i=1
ri (t) vi (t)
(19)
The variables P and L have been plotted as a time-series in figure 4 (right) with a plot (left) visualising
the resulting typical agent network after 500 timesteps, with random initial conditions as before. A red
marker identifies the calculated global centre of mass, positioned at the centroid of the group. Initial
agent velocities are randomised uniformly and therefore P = 0 at t = 0. The group momentum rapidly
increases from zero as agents become coherently aligned. Rapid decreases in P are observed when agent
clusters collide and reflect from boundaries, where successive numbers of agents align to oppose the
velocity of the original cluster. As a cluster moves away from a boundary, proximal agents quickly align
their velocity and P once again increases. The evolution of L is less trivial to interpret from the data.
There does however appear to be a strong correlation between the boundary collisions events revealed
by P, and the formation of transient milling structures which subsequently die away as clusters reach
a new velocity consensus. In the later stages of this time evolution, a complete cluster is formed and
agents reach a consensus velocity resulting in a value of P ≈ 1.
4.3 Local approximation of global observables
For our investigation into control, presented in following chapter, it is presumed that a given controller,
or group of controllers released into a population, initially possess only local knowledge about the state
variables or dynamics of the system. This is to say we assume that controllers do not have direct access
to global information, for example: the entire network structure A, global centre of mass µcm or other
observables, P,L etc, which may be subject to control. It is likely in fact that a controller, or robofish,
would not even be ‘aware’ of basic system variables such as the number of agents, or the dimensions of
16
4.3 Local approximation of global observables
Figure 4: 30 agent system evolved through 500 timesteps: (left) final agent configuration at t = 500,
(right) P and L as a function of time - L generally increases over time with rapid loss of global alignment
as agent clusters reflect from boundaries
the arena they find themselves in. In the context of this research, a robofish may ultimately be required
to control an unknown number of fish in a dynamic ocean environment. It is important therefore to find
out to what extent global properties can be estimated from local information.
To test the viability of obtaining local estimates of the global observables, we will consider a set of
controllers, or scout agents, each of which can measure the state of a local subset of the agent network.
Controllers in this model are considered to be autonomous, possessing of a set of internal rules oper-
ating on a description of their local environment, similar to that of any other self-driven agent. Here,
control agents have an additional feature in that they can communicate or broadcast knowledge to other
controllers, and report to the outside world, over arbitrary distances. The total knowledge of the con-
trol agents is therefore distributed and decentralised, limited by their total distribution in the population.
4.3.1 Defining a two species agent model
We extend our current model by splitting the agent population into two subsets or species. The descrip-
tion of the agent network described in section 3.1 is modified to differentiate between γ-species control
agents (robofish) and the rest of the population, α-species (fish). We consider each species as a subset
of the network vertices in the following way:
• γ-species consisting of Nγ control agents as a subset of the total agent population of size N:
γ ⊂ V {Vi, i = 1, ..., Nγ} (20)
• α-species consisting of Nα = N − Nγ ‘normal’, or fish agents completing the set:
α ⊂ V {Vi, i = Nγ + 1, ..., N} (21)
Following this definition, the description of the network given by the adjacency matrix A includes agents
from both subsets α and γ. If we wish to study the resultant dynamics of the controlled agents, the fish
population, we can extract the structure of the α-agent network Aα as submatrix of A:
17
4.3 Local approximation of global observables
Aα ⊂ A, where A = [aij] : i, j ∈ [1, .., N] (22)
Aα = [aij] : i, j ∈ [Nγ + 1, .., N] (23)
4.3.2 ‘Scout’ agents as estimators
Before discussing specific control strategies in the next chapter, it is interesting to assess how well a subset
of agents can estimate the global observables which one may wish to control. Here we refer to γ-species
agents as ‘scouts’ in that they have identical interaction rules as those of the normal α-species. The only
difference as before, is the ability of γ-agents to combine local information extracted from the full network.
The first example of a local estimation we describe in in terms of the network structure. Since the com-
putation of Aα in (22) explicitly requires the full controller-agent-network description given by A, both
matrices represent global information which is unavailable to the subset of control agents. However by
sharing local information, scout agents can derive an approximation Aα by computing a network from
inter-species (α−γ) links, including all α-species agents currently interacting with scout agents. Further
to this, if scouts share their positions and relative positions of connected α-species agents, missing α links
can be inferred which would otherwise not be known to scouts acting in isolation. The networks shown
in figure 5 provide a visual representation of a single agent network A in terms of the α-species subgraph
Aα, and scout approximation Aα. The ability to approximate global network structure in this way may
prove to be a huge advantage in the development of advanced control strategies. Current research in
this area, for example pinning control techniques developed in [29], can only be effectively applied if the
network topology is known.
A Aα Aα
Figure 5: Network visualisations describing: (left) the full agent network A, (middle) the α-species
agent network Aα and (right) network Aα of α-species agents as shared knowledge of γ-species controllers.
Nγ = 6, Nα = 24 - larger circles represent control γ-species
Another simple example is chosen to demonstrate how the global centre of mass µcm can be estimated
from average local group values of a set of scout agents. As we are now interested in estimating the
centre of mass exclusively of the α-species population, the perceived centre of mass reported by scout
agent i becomes:
x i =
N
j=Nγ +1
aijxj
N
Nγ +1
aij
(24)
18
4.3 Local approximation of global observables
leading to an estimate for the global centre of mass µest calculated as follows, by Nγ scout agents:
µest =
1
Nc
Nγ
i=1
x i (25)
[Note: scout agents with no links to normal agents will not contribute and therefore should not be included
in the average in (25)]
Before we can compare estimates to the true global values, it important to note that summations over
the agents in equations (15) to (19) are been modified to include only the α-species population, i.e.
(i = Nγ + 1, .., N). An evolution of an agent-scout system is shown in figure 6, with a plot of µest−µcm
- the scalar difference in estimated and global values. From results like this, it was found that the simple
estimator µest provides a good estimate to µcm after sufficient time such that α-agents have clustered
into a small number of groups, providing there are enough scout agents to be distributed evenly among
the clusters. For example, even for a very low relative density of scout agents, a very good approximation
can be obtained for µcm if the α-species forms a single, large cohesive group - as expected.
Figure 6: ABM time-evolution with ‘scout’ agents to estimate global centre of mass - Nα = 50, Nγ = 5.
(left) network structure A after t = 200 timesteps. (right) µest − µcm - as a function of time,
indicating a more accurate approximation to µcm as time progresses.
19
Controlling a network model of mobile agents
5 Controlling a network model of mobile agents
5.1 Problem definition
The primary objective of this research is to implement and analyse a control mechanism designed to in-
duce stable configurations of agent states, with average global observables converging on pre-determined
values. In this model we implement a control strategy which guides the agent population to converge
on a specific target (goal) position, and remain at the target in a stable configuration for as long as the
control is active. More specifically, the objective is to arbitrarily control the centre of mass position of
the agent-school µcm, and regulate the standard deviation σcm around the target location near a given
threshold. Using the agent-based model described in chapter 3, we are able to describe a system of
fish-like autonomous mobile agents, moving in accordance with a set of pre-defined rules, or steering
behaviours. Unlike the additional behaviours supposed by other investigations into control and agent
rendezvous [33–35], we assume that the α-species (fish) agents have no predetermined objectives or mo-
tivation to move in any other direction other than those given by the basic rules defined in section 3.3.
When considering the control of living creatures such as fish, we are able only to consider methods which
achieve desired responses through the external influence of their existing behaviours, with no means of
modifying the genetically hard-wired behavioural response itself. Ethorobotic control must therefore
introduce an external influence in the form of controllers, with an additional set of behaviours designed
in such a way they can modulate the behaviour of the population. The objectives of control are met
when this influence is such that a stable, predictable or predetermined evolution of the population is
achieved.
There are two general classes of control interaction which have been used to engage live fish schools, a re-
pulsive predator-prey type interaction; and an attractive interaction induced by biomemetic acceptance.
Recent work by Swain et al. [14] incorporates a fish sized robot, magnetically controlled from beneath
the tank, inducing a predator-like behavioural response from the fish. The robot predator is controlled
using real-time feedback, in such a way as to chase the moving centroid of the school or dart towards it
momentarily. The dynamic response of the fish can then be analysed providing a more complete under-
standing of their behavioural responses. Ongoing research conducted by Porfiri’s group [12,13,15,17] has
taken a different approach by developing self-contained biomemetic robot fish, with a propulsion system
carefully engineered in order to mimic the swimming motion of real fish. From this work it has been
found that fish can be attracted to the robot fish, as if accepting it as one of their own. Furthermore,
the attraction is observed to strengthen when the tail is beating rather than static, perhaps due to the
hydrodynamic efficiencies of swimming within the wake-field generated by the robot. The observation
and analysis of both types of control-fish interaction provides a basis for the development of a variety of
different control strategies.
5.2 A method for distributed, local control
The control mechanism developed in this work takes its inspiration from the familiar gather-and-fetch
task of a sheepdog, rounding up the flock in order to deliver it to a predetermined target position. This
comparison assumes a specific, predator-prey like response between the fish and a controller, similar
to those studied in experiments where robotic-predators engage a school of fish [14]. By equating the
sheep-sheepdog and predator-fish attraction-repulsion interactions, we develop a comparable mechanism
for controlling the global properties of the agent-based model of schooling fish.
20
5.2 A method for distributed, local control
A primary motivation to explore this strategy has come from research by Vaughan et al. [16] and their
experiments in automatic flock control, known as the ‘Robot-Sheepdog Project’. In this work, both a
simulated and practical method was devised to successfully steer a flock of geese towards a target goal
using a mobile robot, controlled by a steering algorithm using global position data acquired from over-
head cameras. The control mechanism described in this section operates using similar principles to the
robot-sheepdog, however with an important difference. Whereas the robot-sheepdog method used by
Vaughan et al. uses the global average flock position as feedback for the control algorithm, the method
implemented in this study uses multiple controllers with access to local information only. In the current
scope of this research, the control mechanism proposed operates even in the absence of approximated
global observables, as discussed in section 4.3. The resulting control mechanism is distinct in that it
provides a method of distributed, local control. A distributed approach, with minimal controller com-
munication is highly desirable given the motivation for this research: to control densely populated fish
shoals in potentially large underwater environments.
5.2.1 Agent-control interaction
The specific implementation used by Vaughan et al. achieves control by exploiting the predator-prey
interaction, using a potential field model to combine an attractive force on the robot directed towards
the changing flock centre of mass, and a repulsive force felt by flock members due to the robot. The
control mechanism is completed by including a third force, acting on the robot with constant magni-
tude to repel a static goal position. The combination of the fields experienced by the robot results in a
potential minimum positioned directly behind the flock with respect to the goal and attracts the robot
to that position. The repulsive force experienced by the flock agents in response to the robot results in
motion away from the controller position and thus towards the goal. In the present study, similar control
interactions are introduced by extending the steering behaviours of agents discussed in section 3.3 to
include a repulsive predator-reaction in response to controllers. A subset of mobile controller agents,
defined here as the γ-species in (20), need only to be provided with a steering behaviour to repel the goal
position, ‘inheriting’ also the basic agent rules of cohesion, alignment and separation described earlier.
The details of the interactions are discussed below.
• The perceived neighbourhood centre of mass and local group velocity via (9) and (10) for each
agent neighbourhood, with care to include only α-species (non-controller) neighbours. Velocity
corrections are computed according to basis rules described in 3.3 with an extra steering rule in
terms of velocity correction vector vr - a vector in the opposite direction to controllers - representing
predator repulsion:
vr(i) = −
Nγ
j=1
aij (xj − xi) (26)
The effect of the predator-repulsion rule is shown in figure 7 in which all α-species agents correct
their velocity by vr to move away from a controller within the interaction radius R.
• A steering rule is introduced for controllers in terms of a velocity correction vector vg producing a
constant vector away from some arbitrary goal position g inside the arena:
21
5.2 A method for distributed, local control
Figure 7: Representation of the agent-controller interaction: α-agents react with velocity cor-
rection vr away from a γ-species control position. Controllers however are attracted to the local
α-species centroid via the normal cohesion rule vcm
vg(i) =



− (g−xi)
g−xi
if
N
j=Nγ +1
aij > 0
0 otherwise
(27)
The correction evaluated in (27) produces a non-zero vector to repel the goal only there are one or
more α-agents in the neighbourhood of a given controller. Controllers otherwise roam freely within
the simulation arena until normal agents are encountered within their interaction radius R.
With the controller behaviour described, γ-species agents do not actively search for α agents to
control, rather they exert influence on α-agents which they encounter on their otherwise straight
trajectory. Given this mechanism, we predict that a threshold density of controllers Nγ/Nα, relative
to the population density ρα = Nα/L2
xy, below which stable control cannot be achieved. Optimised
search strategies could be considered in which a non-interacting controller actively seeks α-species
agents. For example, a more intelligent strategy could be devised which exploits the cooperation
between controllers using shared global estimators, as discussed in chapter 4. Individual based
methods could implement a default controller behaviour with space-searching trajectories based on
L´evy flights which are thought to underpin many animal foraging [52] strategies. A full investiga-
tion into these ideas would be a desirable topic for future research.
Figure 8: (left) Controller attracted to α-neighbourhood centroid (vcm) and repelled from goal
(vg) resulting in trajectory show by black dashed line. (right) Controller moves behind group
w.r.t. goal such that α-agent repulsion from control (vr) drives them towards goal.
22
5.2 A method for distributed, local control
The diagrams in figure 8 highlight the combined effects of the control rules which cause agents
within radius R of a controller to be diverted in the direction of the goal. The diagram (left) shows
a single controller being attracted to the centroid of the α-species group, whilst simultaneously
repelled from the goal position. The resultant trajectory (black dashed line) positions it behind
the group with respect to the goal, dynamically responding to the motion of the agents. The
diagram to the right, a short time in the future, shows α-agents subsequently repelled by the
controller in the direction of the goal as desired. Pictured for a single group interaction these
diagrams describe the control process operating on a local subspace of the simulation arena. By
utilizing multiple control agents, control can be achieved on a global scale as locally controlled
agent clusters across the simulation arena combine and converge on a single goal position.
• A crucial addition to the agent model is to allow γ-agents to exceed the speed of normal α-agents,
governed by scale factor fv, > 0 multiplying the normal restriction vmax defined in (8). Although
limited in a practical application, the control mechanism described depends on γ-controllers being
able to move and react faster than α-agents, such that they can move rapidly to the position
necessary to manoeuvre them towards the goal.
5.2.2 Controlled agent dynamics and gain parameter tuning
At each timestep, the total velocity correction due to the steering rules is computed as a linear combi-
nation of the species specific velocity corrections described above:
• α-species agents:
v(i) (t + 1) = v(i) (t) + kava(i) (t) + kcmvcm(i) (t) + ksvs(i) (t) + krvr(i) (t) (28)
• γ-species control agents: (inherit identical rules, with extra rule vg to repel goal)
v(i) (t + 1) = v(i) (t) + Kava(i) (t) + Kcmvcm(i) (t) + Ksvs(i) (t) + Krvr(i) (t) + Kgvg(i) (t) (29)
where k..., K... : R > 0 - are independent steering gain parameters describing the relative strength
of each steering behaviour for α and γ agents respectively.
In order to achieve the desired steering behaviour required by the control mechanism, an appropriate set
of gain parameters was found heuristically and is summarised in table 3. Gain parameters ka (alignment),
kcm (cohesion) and ks (separation) describing the α-species (fish) are left unchanged from the default
values listed in table 2. The additional parameter required to moderate the predation-reaction, gain kr,
was selected by visually observing the dynamics of ABMs over a range of parameter values. A value of
kr ∼ 0.5 was chosen as the default value for this investigation - providing sufficient predation-response
like repulsion, observed to be strong enough to override their normal group behaviours in order to rapidly
evade proximal controllers.
Given the ‘fixed’ behaviour of the α-species agents representing the fish population, we must now choose
appropriate values for the gain parameters Ka,cm,s,r,g affecting the behaviour of the γ-species controller
agents. The two most important parameters which impact the control mechanism are the control gains
Kcm and Kg, affecting the attraction to local α-neighbourhood centroids and goal repulsion respectively.
Once again, these parameters were empirically selected on the basis of visual observations of the simu-
lated behaviour. The ratio of the two parameters was considered suitable when the combined interaction
produced qualitatively correct control behaviour. By making the controllers somewhat more strongly
23
5.3 Control validation
Model variables α position (i = Nγ + 1..N) : xi
α velocity (i = Nγ + 1..N) : vi
γ position (i = 1..Nγ) : xi
γ velocity (i = 1..Nγ) : vi
control specific parameters α repulsion gain : kr = 0.50
γ repulsion gain : Kr = 0.25
γ alignment gain : Ka = 0.15
γ cohesion gain : Kcm = 0.30
γ separation gain : Ks = 0.50
γ goal repulsion gain : Kg = 0.50
γ vmax scaling factor : fv = 3.00
Table 3: Control specific variables and parameters, extending those from table 1
bound to the α-neighbourhood centroid than the equivalent goal repulsion such that Kcmvcm > Kgvg
in general, we ensure that control agents push and follow agents towards the goal, making control more
robust. If the goal repulsion is proportionally too weak however, controllers do not achieve the correct
position relative to α-agents for the desired control; often approaching the group centroid too closely
causing α-agents to scatter radially in an unpredictable manner.
Defined as a subset of the agent population, controllers also inherit the remaining steering behaviours,
moderated by the corresponding control gain parameters Ka,Ks and Kr. Although non-essential for the
control mechanism described, the values for these parameters are selected to be non-zero for the following
reasons:
• The γ − γ interaction gain Kr is chosen to be non-zero such that it provides a moderate repulsion
between controllers. This behaviour, discourages the clustering of controllers which, as part of a
distributed control mechanism, are assumed to be more effective when distributed more evenly
among the population.
• A minimum controller separation distance rsep is defined identically as for normal agents, since in
reality all agents including controllers should avoid collisions. For this reason Kr = 0.5, the same
for normal agents.
• The gain parameter Ka moderates how strongly a controller aligns its velocity with the α-neighbourhood
average. Although a role for this behaviour is not explicit in the description of the control mecha-
nism, the default value Ka = 0.15 is used throughout.
The remaining tunable parameter is the scale factor increasing the maximum speed, or dynamic response,
of controllers relative to α-agents, where fv = 3 was found to be sufficient for adequate control.
5.3 Control validation
In order to validate the effectiveness of this control mechanism we can analyse the dynamical evolution
of the agent based with varying numbers of controllers, and in the absence of control where Nγ = 0.
5.3.1 Effect of control on a single network
In the first instance we obtain a qualitative validation of control effectiveness by calculating the root
mean squared (r.m.s.) deviation of α-agents from the goal position as a function of time. In the
following results, we specify an arbitrary goal position g = [1, 0] and evolve the agent system through
24
5.3 Control validation
Nγ = 0 (no control) Nγ = 5 Nγ = 10
Figure 9: Evolution of the r.m.s. deviation from the goal position of Nα = 50 α-agents over 2000
timesteps with Nγ controllers
2000 timesteps, initialised with uniform random positions in the plane. Results are shown in the figure
9 with a system of Nα = 50 agents.
The results in figure 9 indicate a substantial decrease in the average r.m.s. deviation from the goal
when controllers are active among the population. In a system without control, the average position
of α-agents in the arena is essentially random and fluctuates with a periodicity related to the speed of
the agents and the size of the arena, irrespective of the goal. The effect of adding more controllers is to
increasingly suppress large periodic fluctuations and reduce the average r.m.s.d value indicating a general
convergence on the goal position.
5.3.2 Ensemble simulations
A more conclusive analysis of the behaviour of controlled systems is obtained from generating ensemble
simulations with the benefit of a reduction in statistical errors ∼ N
−1/2
r , where Nr is the number of
independent realisations. Each realisation of the agent-based model, differs in that the initial configu-
ration of agents and their velocities is sampled pseudo-randomly from a uniform distribution. At each
timestep of every simulation we calculate the global observables described in section 4, recording mean
values averaged by the number of realisations. The main observables used to analyse and evaluate the
control mechanism are the vector norms of the global centre of mass µcm and the corresponding global
standard deviation σcm .
The data shown in figure 10 shows the time evolution of µcm for Nα = 30 agents evolved over 600
time-steps under the influence of Nγ = 0..10 controllers with a goal target at g = [1, 0]. Time-series plots
are calculated by averaging data from Nr = 500 independent network realisations, each initialised from
a uniform distribution ( µcm ≈ 0) within an arena of dimensions Lxy = 15 giving an α-species density
ρα = Nα/L2
xy = 0.1˙3. Initial agent velocity components are sampled uniformly between vmin and vmax.
The results in figure 10 clearly indicate the effect of increasing the relative density of controllers
Nγ
Nα
on the resulting global centre of mass. At higher controller density, above Nγ ∼ 5, µcm is found
to converge close to the desired value of g = 1 (blue horizontal line), an indication that the desired
global control goal has been achieved and remains stable over the simulation period subject to only
minor fluctuations. With fewer controllers, control stability is decreased and much larger centre of mass
fluctuations are observed. In the time window simulated, stable goal convergence is not achieved with
Nγ < 3 where large amplitude, periodic oscillations are observed. The effect of control in all simulations
with Nγ > 0 produces an initial rapid linear increase in µcm which is not observed in the uncontrolled
system (Nγ = 0); suggesting that at least some of the agent population is initially directed by control
25
5.3 Control validation
Figure 10: Time-series evolution of µcm of Nα = 30 agents interacting with: (left) Nγ = 0..5
controllers, (right) Nγ = 6..10 controllers. Goal target position g = [1, 0]. Data averaged over Nr = 500
network realisations
action towards the goal. Only when a sufficient relative density of controllers is reached however, does
the average system configuration converge on the goal position and remain stable with small fluctuations
in µcm around the target value.
The action of control is also observed to produce an overshoot in the centre of mass position, with an
evolution that either becomes damped towards the target value when controller density is sufficiently
high, or otherwise remains unstable. These observations are clarified in figure 11 in which the averaged
values of µcm , and associated fluctuations in terms of the standard deviation σfluc., for each time-series
are plotted as a function of Nγ = [0..21], using data values after the last overshoot from t = [200..600].
These results suggest that 5 controllers Nγ/Nα = 1
6 is sufficient to provide accurate convergence on the
target goal, whilst further increasing controller density provides more stable dynamics after the conver-
gence. However, the flattening of the decreasing tail of σfluc. in figure 11 (right), indicates a minimum
background level of µcm fluctuation, reached with Nγ > 10 controllers and suggests an upper limit to the
number of controllers required for stable control for this particular system. As an important consideration
for controlling the motion of real fish, the model and tools provided in this investigation should allow for
a more complete analysis of control-agent density requirements with further research. Specifically in the
current model, controllers wander freely in straight lines when not interacting with α-agents, constrained
by reflection at the boundaries. Increasing the area of simulation arena thus proportionally increases the
‘non-interacting void’ available to controllers. It is likely therefore that the controlled dynamics observed
in the previous discussion are dependent on the both the simulation size Lxy and the corresponding
density of agents ρα. The exact scaling is not however expected to be linear, primarily because agent
interaction rules depend on the radius of interaction R and therefore agent cluster sizes are independent
of the arena size.
From the same ensemble simulations, time-series data for σcm is used to study how control affects the
global deviation, or agent spread, around the mean position. The average values of this time-series data
are also computed for values after the overshoot in µcm , between [t = 200..600], shown in figure 12.
For the values of Nγ used in this analysis, we see a smooth decrease in the average deviation of agent
positions as the number of controllers is increased, reaching a minimum value of σcm ≈ 2. Evidently,
26
5.3 Control validation
Figure 11: (left) average values of µcm for varying numbers of controllers Nγ, calculated after
overshoot t = [200..600], (right) associated values of σfluc. as a function of Nγ. α-species size Nα = 30
the higher the density of controllers, the more tightly confined the average configuration of agents be-
comes; eventually reaching a limiting value. It is interesting to note that the minimum controlled value
of σcm does not converge on the uncontrolled value µcm Nγ =0 ∼ 0.77, found by fully equilibrating the
Nγ = 0 system. One suggestion is that the repulsive interaction between controllers and agents serves to
continuously perturb the system to an extent that the stable configuration never fully relaxes to the most
closely packed configuration allowed by the normal agent rules. Once again, these interesting questions
and ideas for more detailed experiments are left to further research.
Figure 12: Average values of σcm
after overshoot in µcm calculated be-
tween t = [200..600]. Data identifies
a smooth decrease to minimum value
σcm ≈ 2 - a factor 2.4 larger than
σcm Nγ =0 = 0.77
A final validation and analysis of the control mechanism is obtained by focusing on system dynamics in
response to the goal location g. The time-series plots in figure 13 show the global centre of mass response
of controlled ensemble simulations with Nα = 30, Nγ = 6, initialised with uniform position and velocity
distributions. Stable control is achieved for all goal targets g = [0..5]. Additionally, the maximum
deviation of the overshoot in µcm is observed to vary as the goal position is moved further from the
initial centre of mass at zero. A possible reason for this dependence is the following: As the goal is
moved away from the origin, the symmetry of the system is reduced with a higher proportion of agents
travelling further to reach the goal. Over longer distances, higher density agent clusters are able to form,
overshooting the goal with a more concentrated centre of mass and thus a larger relative contribution to
27
5.3 Control validation
the ensemble statistics.
Figure 13: Time-series data of µcm
for 6 different goal positions along
the x-axis, g = [0..5, 0] averaged over
500 network realisations per time se-
ries. Initialised with uniform posi-
tion, each time-series shows success-
ful, stable control at the desired tar-
get - g = [0..5] respectively. The
magnitude of the overshoot in µcm
prior to achieving stability appears to
be related to distance between initial
and final centre of mass values. Nα =
30, Nγ = 6 for all simulations.
The overshoot behaviour due to control action is analysed further by plotting a step-response time-series,
in which the goal position is changed at specific points throughout a simulation ensemble, at the same
time-step in each realisation. The graph in figure 14 identifies overshoots in the aggregate direction of
motion of α-agents: positive when the goal is shifted in a positive direction and correspondingly negative
when shifted back, in the opposite direction. As before, a larger overshoot is observed when the goal is
changed from g = 1 to g = 5 at t = 1000 than for the smaller shift between g = 1 to g = 2 at
t = 200. Interestingly, a large shift in the goal position is accompanied by a perturbation in σcm which
is not observed for the smaller goal shift. This behaviour, can be observed by watching the animations
described in the next section, and is almost certainly due to agent dispersal by controllers via the repulsive
interaction krvr. A large change in goal position often leads to fracturing of the large cluster, gathered at
the previous goal, into smaller clusters. The longer transit duration to a more distant goal allows these
clusters to become more spread out from one another, increasing σcm , before the control mechanism
eventually stabilises the configuration into a larger cluster around the new goal position. Regardless of
the relative position of the new goal, the perturbation is therefore always positive, indicating a transient
disruption to global agent cohesion as they are redirected to a new target in the arena. Applying this
control mechanism to a system of real fish therefore would not guarantee a smooth transition of a single
school between dynamic goal positions. Instead, distributed controllers are likely to disperse fish into
multiple smaller schools, which move off independently in the general direction of the goal. In sufficient
numbers, controllers are then able to stabilise the vast majority of the fish around the goal position as
a single school.
5.3.3 Animated examples of agent control
This section provides some animated examples of a number of controlled agent systems, available to
view or download from the web at the URLs indicated below. The first example, an agent system with
Nα = 30 provides a direct comparison with the results discussed in the previous sections. Latter exam-
ples employ larger agent populations Nα = 500, providing a qualitative assessment of control at higher
agent densities, and various control-agent densities. In all examples, agents are initialised with random
uniform distributions in position and velocity as described previously.
Each animation follows the evolution of a a single model realisation in terms of the agents positions,
and the structure of the agent network A. The complete agent population is visualised as a dynamic
28
5.3 Control validation
Figure 14: Step response due to goal repo-
sitioning - evolution of µcm and σcm over
1800 timesteps, averaged over 500 network reali-
sations.
geometric network. α-species nodes are represented by circles, with larger circles identifying γ-species
controllers. Pairwise agent interactions defined by the network edges, are indicated by adjoining lines.
All node circles are coloured relative to their network degree - identifying otherwise obscured tight clus-
tering between agents.
In addition to the network structure, the corresponding x, y position distribution is displayed as a his-
togram with vertical markers representing the goal position. The position of the goal is moved to a new
location within the arena every few hundred timesteps to study the effects of dynamic control and the
overshoot behaviour discussed earlier.
• Model parameters: Nα = 30, Nγ = 6, Lxy = 15
- http://www.youtube.com/watch?v=8kfd6xHElZI
Control mechanism achieves fairly stable control within the simulation arena. Occasionally a large
cluster of agents is ‘lost’ only to be quickly corralled back by controllers.
• Model parameters: Nα = 500, Nγ = 10, Lxy = 30
- http://www.youtube.com/watch?v=FJqU06b3eMs
Agents rapidly coalesce into a large cluster, aided by controllers steering agents towards the central
goal position. Convergence towards a new goal position is rapid and coherent, with only minor
disruptions of the large cluster by control agents. Given the high density of agents, outlying agents
are quickly located by controllers and manoeuvred towards the main cluster at the goal. Note that
controllers need only to interact briefly with α-agents in order to direct them towards the goal.
• Model parameters: Nα = 500, Nγ = 5, Lxy = 30
- http://www.youtube.com/watch?v=qRmTAHl89rM
Agents coalesce from their initial distribution, however taking much longer to merge into a single
large cluster than in the previous example with frequent cluster fracturing observed. Reaction to
the controllers is still fast, however clusters of agents now overshoot the goal position more often
as the lower controller density struggles to maintain stability around the target. Here we see an
example where the inertia of multiple clusters is too high to be well controlled by too few controllers
near the goal position.
• Model parameters: Nα = 500, Nγ = 2, Lxy = 30
- http://www.youtube.com/watch?v=xmAc3qJO34I
29
5.3 Control validation
As before, agents rapidly form multiple large clusters, this time remaining distinct throughout
the entire simulation. Controllers effectively direct encountered clusters towards the goal position,
however the disturbances provoked by controllers are poorly contained as due to insufficient con-
troller density. Agent clusters therefore either traverse the goal unrestrained, or miss the target
entirely.
• Model parameters: Nα = 500, Nγ = 10, Lxy = 60
- http://www.youtube.com/watch?v=icGujj9xFgM
Controller density is high enough in this larger simulation arena, to maintain the agent population
tightly bound in a single cluster. After a period of ‘sweeping’ the simulation arena for outliers,
the large cluster is controlled with reasonable stability at the various goal positions. Although
agent dispersal by controllers is fairly pronounced, sufficient numbers of controllers are available
to regroup the agents and direct them towards the goal.
• Model parameters: Nα = 500, Nγ = 5, Lxy = 60
- http://www.youtube.com/watch?v=0ywTaQtZPWQ
In this example we see very similar behaviour to the previous evolution, however the control density
is not sufficient to maintain a single large cluster. The motion of the resulting clusters is neither
controlled efficiently enough, nor fast moving enough to reach the goal target before it is moved to
a new location.
Please note that the URLs above link to videos hosted on YouTube and are therefore subject to change.
If the links become inactive then alternative access to the animations can be provided by the author.
30
Coarse-grained multiscale analysis
6 Coarse-grained multiscale analysis
6.1 The Equation-free method
Having already introduced the basic concepts of the Equation-Free method and our motivation in section
2.3, we now address the core elements of this computational framework, enabling a coarse-grained de-
scription of the agent-based model. A more complete description of the methods outlined in this section
can be found in the literature [18], including a recent review of Equation-Free methods by the original
authors [19] and specific applications to agent-based models [39].
The primary tool of the Equation-Free framework is the coarse timestepper which evolves a macroscopic
model of the system through a single coarse-timestep. The application of the following methods relies on
the assumption that a description of the micro-scale model, in this case the agent-based model describ-
ing the micro dynamics of our controlled system, can be sufficiently described by a reduced number of
‘coarse-grained’ variables, or macro-observables. Using this approach our goal is to obtain a description
of a coarse-grained model of the micro-dynamics, which may exist conceptually however is unavailable in
closed form. Upon finding a correct form of the closure via the coarse timestepper, we able to bridge the
gap between the micro-level description, the fine-scale simulations developed in the previous chapters,
and a coarse system-level description. This coarse-graining enables us to deploy the traditional inventory
of numerical techniques, for example coarse-grained bifurcation analysis and optimisation routines.
Given an initial coarse-grained initial condition X at time t, i.e. U(X, t), the coarse timestepper imple-
ments a single macro timestep using a three step procedure:
1. Lifting - the transformation of a coarse-grained initial conditions via a lifting operator ψ, initial-
ising a set of micro-level ensembles u(x, t) with consistent coarse-grained observables:
u(x, t) = ψU(X, t) (30)
where x, x ∈ Dm and t are fine-scale variables, X ∈ DM are coarse-grained variables.
2. Micro-simulation - the evolution of the micro-scale dynamics of each independent realisation of
the ensemble, outputting the values of the fine-scale variables x after a short macroscopic time step
δt - the time horizon. Given a single timestep micro-evolution fs:
u(x, t + dt) = fs[u(x, t), dt] (31)
we perform fine-scale simulations, evolved over the period of the time horizon δt:
u(x, t) at t ∈ [t, t + δt] (32)
where the time horizon δt consisting of k fine-scale timesteps dt, i.e. δt = kdt.
3. Restriction - compute the averaged coarse-grained variables corresponding to the fine-scale vari-
ables of the microscopic ensemble, via a restriction operator M - obtaining the new coarse-grained
state from:
U(X, t) = Mu(x, t) (33)
31
6.2 Selection of coarse-grained observables
Figure 15: Schematic of the coarse timestepper, taken from [19]. IC: initial condition, ABMs: agent-
based models, PDE: partial differential equation
Implementing this full procedure produces a coarse-timestepper FS operating on the coarse-grained
description to evolve a macro-scale system through one time horizon, i.e. U(X, t + δt) according to:
FS[U(X, t), δt] = M(Fk
s {ψ[U(X, t], dt}) (34)
The formulation of the coarse timestepper in (34) uses the underlying micro-level simulations and coarse-
grained initial conditions, to provide a map or function FS which outputting the results of an evolution
over a given time horizon δt. At this point we can now consider the standard array of analytical
techniques ‘wrapped’ around the coarse function which now encapsulates and provides a closure to the
micro-dynamics of an ensemble of simulations. These outer solvers may include PDE based methods,
and the Newton-Broyden root finding method described later on. The main concepts of the coarse
timestepper are neatly described in the schematic in figure 15.
6.2 Selection of coarse-grained observables
A central assumption of the coarse timestepper is that there exists a closed form solution, or master
equation, describing the dynamics of the associated coarse-grained model. The coarse timestepper is a
function FS or map, providing this closure ‘on-demand’ by restricting the model using a relatively small
subset of coarse-grained variables, corresponding to specific system level observables. The correct choice
of the coarse-variables is crucial; ideally consisting of a few low-order moments of the micro-level sys-
tem. Effective closure therefore depends on higher-order moments of the microscopic dynamics rapidly
becoming functionals of the fewer, lower-order moments [19].
Before proceeding with a multiscale analysis using the coarse timestepper, we must therefore choose an
appropriate set of observables that can be computed given evolved states of the (micro-scale) agent based
model. For the current investigation we consider the same two variables already used to in the previous
chapter to analyse the effects of control: the global centre of mass µcm, and the associated standard
deviation σcm, representing the first and second order moments of the α-species agent population subset
α ⊂ V {Vi, i = Nγ + 1, ..., N}:
32
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)
Robofish - Final Report (amended)

More Related Content

What's hot

Alpha and Gamma Oscillations in MEG-Data: Networks, Function and Development.
Alpha and Gamma Oscillations in MEG-Data: Networks, Function and Development.Alpha and Gamma Oscillations in MEG-Data: Networks, Function and Development.
Alpha and Gamma Oscillations in MEG-Data: Networks, Function and Development.FrdricRoux5
 
Classical mechanics
Classical mechanicsClassical mechanics
Classical mechanicshue34
 
Emotions prediction for augmented EEG signals using VAE and Convolutional Neu...
Emotions prediction for augmented EEG signals using VAE and Convolutional Neu...Emotions prediction for augmented EEG signals using VAE and Convolutional Neu...
Emotions prediction for augmented EEG signals using VAE and Convolutional Neu...BouzidiAmir
 
Final Report - Major Project - MAP
Final Report - Major Project - MAPFinal Report - Major Project - MAP
Final Report - Major Project - MAPArjun Aravind
 
Trade-off between recognition an reconstruction: Application of Robotics Visi...
Trade-off between recognition an reconstruction: Application of Robotics Visi...Trade-off between recognition an reconstruction: Application of Robotics Visi...
Trade-off between recognition an reconstruction: Application of Robotics Visi...stainvai
 
Neural Networks on Steroids
Neural Networks on SteroidsNeural Networks on Steroids
Neural Networks on SteroidsAdam Blevins
 
aniketpingley_dissertation_aug11
aniketpingley_dissertation_aug11aniketpingley_dissertation_aug11
aniketpingley_dissertation_aug11Aniket Pingley
 
Classification System for Impedance Spectra
Classification System for Impedance SpectraClassification System for Impedance Spectra
Classification System for Impedance SpectraCarl Sapp
 
Au anthea-ws-201011-ma sc-thesis
Au anthea-ws-201011-ma sc-thesisAu anthea-ws-201011-ma sc-thesis
Au anthea-ws-201011-ma sc-thesisevegod
 
Six Myths and Paradoxes of Garbage Collection
Six Myths and Paradoxes of Garbage Collection Six Myths and Paradoxes of Garbage Collection
Six Myths and Paradoxes of Garbage Collection Holly Cummins
 
Integrating IoT Sensory Inputs For Cloud Manufacturing Based Paradigm
Integrating IoT Sensory Inputs For Cloud Manufacturing Based ParadigmIntegrating IoT Sensory Inputs For Cloud Manufacturing Based Paradigm
Integrating IoT Sensory Inputs For Cloud Manufacturing Based ParadigmKavita Pillai
 
Lecture notes on planetary sciences and orbit determination
Lecture notes on planetary sciences and orbit determinationLecture notes on planetary sciences and orbit determination
Lecture notes on planetary sciences and orbit determinationErnst Schrama
 
Efficient algorithms for sorting and synchronization
Efficient algorithms for sorting and synchronizationEfficient algorithms for sorting and synchronization
Efficient algorithms for sorting and synchronizationrmvvr143
 

What's hot (17)

Alpha and Gamma Oscillations in MEG-Data: Networks, Function and Development.
Alpha and Gamma Oscillations in MEG-Data: Networks, Function and Development.Alpha and Gamma Oscillations in MEG-Data: Networks, Function and Development.
Alpha and Gamma Oscillations in MEG-Data: Networks, Function and Development.
 
Classical mechanics
Classical mechanicsClassical mechanics
Classical mechanics
 
Physics grade 10-12
Physics grade 10-12Physics grade 10-12
Physics grade 10-12
 
Emotions prediction for augmented EEG signals using VAE and Convolutional Neu...
Emotions prediction for augmented EEG signals using VAE and Convolutional Neu...Emotions prediction for augmented EEG signals using VAE and Convolutional Neu...
Emotions prediction for augmented EEG signals using VAE and Convolutional Neu...
 
Final Report - Major Project - MAP
Final Report - Major Project - MAPFinal Report - Major Project - MAP
Final Report - Major Project - MAP
 
Trade-off between recognition an reconstruction: Application of Robotics Visi...
Trade-off between recognition an reconstruction: Application of Robotics Visi...Trade-off between recognition an reconstruction: Application of Robotics Visi...
Trade-off between recognition an reconstruction: Application of Robotics Visi...
 
Neural Networks on Steroids
Neural Networks on SteroidsNeural Networks on Steroids
Neural Networks on Steroids
 
aniketpingley_dissertation_aug11
aniketpingley_dissertation_aug11aniketpingley_dissertation_aug11
aniketpingley_dissertation_aug11
 
Classification System for Impedance Spectra
Classification System for Impedance SpectraClassification System for Impedance Spectra
Classification System for Impedance Spectra
 
Au anthea-ws-201011-ma sc-thesis
Au anthea-ws-201011-ma sc-thesisAu anthea-ws-201011-ma sc-thesis
Au anthea-ws-201011-ma sc-thesis
 
Six Myths and Paradoxes of Garbage Collection
Six Myths and Paradoxes of Garbage Collection Six Myths and Paradoxes of Garbage Collection
Six Myths and Paradoxes of Garbage Collection
 
Integrating IoT Sensory Inputs For Cloud Manufacturing Based Paradigm
Integrating IoT Sensory Inputs For Cloud Manufacturing Based ParadigmIntegrating IoT Sensory Inputs For Cloud Manufacturing Based Paradigm
Integrating IoT Sensory Inputs For Cloud Manufacturing Based Paradigm
 
andershuss2015
andershuss2015andershuss2015
andershuss2015
 
Lecture notes on planetary sciences and orbit determination
Lecture notes on planetary sciences and orbit determinationLecture notes on planetary sciences and orbit determination
Lecture notes on planetary sciences and orbit determination
 
Efficient algorithms for sorting and synchronization
Efficient algorithms for sorting and synchronizationEfficient algorithms for sorting and synchronization
Efficient algorithms for sorting and synchronization
 
Sarda_uta_2502M_12076
Sarda_uta_2502M_12076Sarda_uta_2502M_12076
Sarda_uta_2502M_12076
 
mscthesis
mscthesismscthesis
mscthesis
 

Viewers also liked

Viewers also liked (11)

Final report - Adam Zienkiewicz
Final report - Adam ZienkiewiczFinal report - Adam Zienkiewicz
Final report - Adam Zienkiewicz
 
Turvallista aikuista etsimässä uusi malli väkivaltaa perheessään kohdanneide...
Turvallista aikuista etsimässä  uusi malli väkivaltaa perheessään kohdanneide...Turvallista aikuista etsimässä  uusi malli väkivaltaa perheessään kohdanneide...
Turvallista aikuista etsimässä uusi malli väkivaltaa perheessään kohdanneide...
 
Evaluation question 4
Evaluation question 4Evaluation question 4
Evaluation question 4
 
Past perfect simple vs past perfect continuous
Past perfect simple vs past perfect continuousPast perfect simple vs past perfect continuous
Past perfect simple vs past perfect continuous
 
Major Madigan Resume
Major Madigan ResumeMajor Madigan Resume
Major Madigan Resume
 
Pitch deck Worcy
Pitch deck WorcyPitch deck Worcy
Pitch deck Worcy
 
InStyle_Havelka
InStyle_HavelkaInStyle_Havelka
InStyle_Havelka
 
Entrepreneurship-G5
Entrepreneurship-G5Entrepreneurship-G5
Entrepreneurship-G5
 
Community voices
Community voicesCommunity voices
Community voices
 
Unit 3 alphabets
Unit 3 alphabetsUnit 3 alphabets
Unit 3 alphabets
 
ems
emsems
ems
 

Similar to Robofish - Final Report (amended)

Stochastic Processes and Simulations – A Machine Learning Perspective
Stochastic Processes and Simulations – A Machine Learning PerspectiveStochastic Processes and Simulations – A Machine Learning Perspective
Stochastic Processes and Simulations – A Machine Learning Perspectivee2wi67sy4816pahn
 
Maxim_Clarke_Thesis_Submission
Maxim_Clarke_Thesis_SubmissionMaxim_Clarke_Thesis_Submission
Maxim_Clarke_Thesis_SubmissionMaxim Clarke
 
Nweke digital-forensics-masters-thesis-sapienza-university-italy
Nweke digital-forensics-masters-thesis-sapienza-university-italyNweke digital-forensics-masters-thesis-sapienza-university-italy
Nweke digital-forensics-masters-thesis-sapienza-university-italyAimonJamali
 
Optimization Models and Computational Methods for Systems Biology
Optimization Models and Computational Methods for Systems BiologyOptimization Models and Computational Methods for Systems Biology
Optimization Models and Computational Methods for Systems BiologyYang Cong
 
Lecture notes on hybrid systems
Lecture notes on hybrid systemsLecture notes on hybrid systems
Lecture notes on hybrid systemsAOERA
 
SeniorThesisFinal_Biswas
SeniorThesisFinal_BiswasSeniorThesisFinal_Biswas
SeniorThesisFinal_BiswasAditya Biswas
 
2012-02-17_Vojtech-Seman_Rigorous_Thesis
2012-02-17_Vojtech-Seman_Rigorous_Thesis2012-02-17_Vojtech-Seman_Rigorous_Thesis
2012-02-17_Vojtech-Seman_Rigorous_ThesisVojtech Seman
 
Opinion Formation about Childhood Immunization and Disease Spread on Networks
Opinion Formation about Childhood Immunization and Disease Spread on NetworksOpinion Formation about Childhood Immunization and Disease Spread on Networks
Opinion Formation about Childhood Immunization and Disease Spread on NetworksZhao Shanshan
 
A Seminar Report On NEURAL NETWORK
A Seminar Report On NEURAL NETWORKA Seminar Report On NEURAL NETWORK
A Seminar Report On NEURAL NETWORKSara Parker
 
UCHILE_M_Sc_Thesis_final
UCHILE_M_Sc_Thesis_finalUCHILE_M_Sc_Thesis_final
UCHILE_M_Sc_Thesis_finalGustavo Pabon
 
UCHILE_M_Sc_Thesis_final
UCHILE_M_Sc_Thesis_finalUCHILE_M_Sc_Thesis_final
UCHILE_M_Sc_Thesis_finalGustavo Pabon
 

Similar to Robofish - Final Report (amended) (20)

Thesis_Prakash
Thesis_PrakashThesis_Prakash
Thesis_Prakash
 
Stochastic Processes and Simulations – A Machine Learning Perspective
Stochastic Processes and Simulations – A Machine Learning PerspectiveStochastic Processes and Simulations – A Machine Learning Perspective
Stochastic Processes and Simulations – A Machine Learning Perspective
 
PhD-2013-Arnaud
PhD-2013-ArnaudPhD-2013-Arnaud
PhD-2013-Arnaud
 
Maxim_Clarke_Thesis_Submission
Maxim_Clarke_Thesis_SubmissionMaxim_Clarke_Thesis_Submission
Maxim_Clarke_Thesis_Submission
 
Nweke digital-forensics-masters-thesis-sapienza-university-italy
Nweke digital-forensics-masters-thesis-sapienza-university-italyNweke digital-forensics-masters-thesis-sapienza-university-italy
Nweke digital-forensics-masters-thesis-sapienza-university-italy
 
Master_Thesis
Master_ThesisMaster_Thesis
Master_Thesis
 
Optimization Models and Computational Methods for Systems Biology
Optimization Models and Computational Methods for Systems BiologyOptimization Models and Computational Methods for Systems Biology
Optimization Models and Computational Methods for Systems Biology
 
Lecture notes on hybrid systems
Lecture notes on hybrid systemsLecture notes on hybrid systems
Lecture notes on hybrid systems
 
JPMthesis
JPMthesisJPMthesis
JPMthesis
 
SeniorThesisFinal_Biswas
SeniorThesisFinal_BiswasSeniorThesisFinal_Biswas
SeniorThesisFinal_Biswas
 
Inglis PhD Thesis
Inglis PhD ThesisInglis PhD Thesis
Inglis PhD Thesis
 
2012-02-17_Vojtech-Seman_Rigorous_Thesis
2012-02-17_Vojtech-Seman_Rigorous_Thesis2012-02-17_Vojtech-Seman_Rigorous_Thesis
2012-02-17_Vojtech-Seman_Rigorous_Thesis
 
probabilidades.pdf
probabilidades.pdfprobabilidades.pdf
probabilidades.pdf
 
Opinion Formation about Childhood Immunization and Disease Spread on Networks
Opinion Formation about Childhood Immunization and Disease Spread on NetworksOpinion Formation about Childhood Immunization and Disease Spread on Networks
Opinion Formation about Childhood Immunization and Disease Spread on Networks
 
Neural networks and deep learning
Neural networks and deep learningNeural networks and deep learning
Neural networks and deep learning
 
A Seminar Report On NEURAL NETWORK
A Seminar Report On NEURAL NETWORKA Seminar Report On NEURAL NETWORK
A Seminar Report On NEURAL NETWORK
 
main
mainmain
main
 
UCHILE_M_Sc_Thesis_final
UCHILE_M_Sc_Thesis_finalUCHILE_M_Sc_Thesis_final
UCHILE_M_Sc_Thesis_final
 
UCHILE_M_Sc_Thesis_final
UCHILE_M_Sc_Thesis_finalUCHILE_M_Sc_Thesis_final
UCHILE_M_Sc_Thesis_final
 
thesis
thesisthesis
thesis
 

Robofish - Final Report (amended)

  • 1. Bristol Centre for Complexity Science Robofish Control of networked ethorobotic systems Adam Zienkiewicz Supervisors: Prof. Mario di Bernardo (University of Bristol) Dr. David Barton (University of Bristol) A dissertation submitted to the University of Bristol in accordance with the requirements of the degree of Master of Research by advanced study in Complexity Science in the Faculty of Engineering Submitted: 21 September 2012 15,502 words
  • 2.
  • 3. Abstract Collective groups of animals are able to efficiently self-organise producing coordinated motion and emergent behaviours. Evolution has moulded the behaviour of individuals, resulting in the complex, controlled dynamics observed at the macro-level due to the survival benefits offered by coordinated group behaviour. At the individual level we find that complicated patterns and structures form in the absence of leaders, emerging instead from local interactions with individuals tracking the motion of a limited number of neighbours. A new field of ethorobotics, studies the intersection of animal and robot groups, addressing the question of how we might modulate the behaviour of collective animal networks in order to control their system-level behaviour. Following recent developments in engineering robotic fish, and the study of their interaction with real shoals, we investigate strategies able to steer shoaling behaviour and produce stable, controlled dynamics in a simulated model of fish. In this work, we develop an agent-based network model to simulate the collective motion of fish shoals and analyse ensemble dynamics via a set of global observables. We also investigate methods for approximating global information by communicating local information. A distributed, local control strategy is developed, based on a predator-prey interaction on a two-species (fish-controller) network which is able to steer a simulated shoal to a designated target and maintain high density clusters. Controlled dynamics are investigated using both animated model visualisations and through analysis of fine-scale ensemble simulations to observe global steady-states. Further to this, we implement an Equation-Free multiscale approach to investigate the macroscale dynamics in terms of a few low- dimensional coarse variables. After establishing a simplified coarse-grained system, we use numerical methods to perform a preliminary study of the stability and robustness of the controlled system.
  • 4.
  • 5. Dedication and Acknowledgements I would like thank my supervisors, Mario and David, for their continuous enthusiasm and assistance throughout this research. I am also indebted to my colleagues, for their moral and academic support: my desk neighbours Holly, for keeping the kettle warm; and Richard for his pleasantly distracting nuggets of plant-related facts and ‘did-you-knows’; and the rest of my cohort with whom I share a calm and stim- ulating working environment. However, I dedicate this work to my girlfriend Riek, as without her love, kindness, support and recipe ideas, I would not have made it far enough to write this sentence. Thank you Riek, for helping me through the difficult times, for hearing my struggles, and for giving me the energy and harmony I so needed. This work was supported by the Engineering and Physical Science Research Council (EPSRC) [Grant number: EP/I013717/1].
  • 6.
  • 7. Author declaration I declare that the work in this dissertation was carried out in accordance with the requirements of the University’s Regulations and Code of Practice for Taught Postgraduate Programmes and that it has not been submitted for any other academic award. Except where indicated by specific reference in the text, this work is my own work. Work done in collaboration with, or with the assistance of others, is indicated as such. I have identified all material in this dissertation which is not my own work through appropri- ate referencing and acknowledgement. Where I have quoted from the work of others, I have included the source in the references/bibliography. Any views expressed in the dissertation are those of the author. SIGNED: (Signature of student) DATE:
  • 8.
  • 9. Contents 1 Introduction 1 2 Background 3 2.1 Modelling collective motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Control of complex networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.3 The Equation-free method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 An agent based model of schooling fish 6 3.1 Proximity Network Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 Time evolution - network dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.3 Steering rules - simplified model of schooling fish behaviour . . . . . . . . . . . . . . . . . 8 3.3.1 Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3.2 Cohesion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3.3 Separation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.4 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.5 Model implementation in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.5.1 ABM class object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.5.2 Analytical toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.6 Tuning model parameters - achieving collective motion . . . . . . . . . . . . . . . . . . . . 12 3.6.1 Parameter values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.6.2 Evolution of the ABM - visualisation and validation . . . . . . . . . . . . . . . . . 13 4 Global observables of the agent based model 15 4.1 Spatial observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.1.1 Global centre of mass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.1.2 Global standard deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.2 Dynamic observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.2.1 Normalised group momentum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.2.2 Normalised group angular momentum . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.3 Local approximation of global observables . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.3.1 Defining a two species agent model . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.3.2 ‘Scout’ agents as estimators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 Controlling a network model of mobile agents 20 5.1 Problem definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.2 A method for distributed, local control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.2.1 Agent-control interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.2.2 Controlled agent dynamics and gain parameter tuning . . . . . . . . . . . . . . . . 23 5.3 Control validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.3.1 Effect of control on a single network . . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.3.2 Ensemble simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.3.3 Animated examples of agent control . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6 Coarse-grained multiscale analysis 31 6.1 The Equation-free method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.2 Selection of coarse-grained observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 6.3 Restriction operator - obtaining coarse variables . . . . . . . . . . . . . . . . . . . . . . . 33 6.4 Lifting operator - generating micro-scale ensembles . . . . . . . . . . . . . . . . . . . . . . 33 6.5 Configuring the coarse timestepper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 6.6 Coarse time integration - validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 6.7 Coarse-grained stability analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 6.7.1 Linearised stability analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 6.7.2 Quasi-Newton solvers and bifurcation analysis . . . . . . . . . . . . . . . . . . . . 39 7 Conclusions 42 7.1 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
  • 10.
  • 11. Introduction 1 Introduction Flocking is a general description of the collective behaviour of a wide variety of different animals which live and cooperate in large social groups. Otherwise known as schooling in fish, or swarming in insects or bacterial colonies; the emergent behaviour and complex patterns displayed by gregarious animals have intrigued naturalists, theoreticians and the layman alike. The accepted view that collective motion of this type results in the absence of a leader has been justified through the simulation of artificial flocks which display similar behaviour. The rich, dynamic structures of a flock emerge as a result of simple interactions between the group members based solely on local information. A major development in this area by Aoki [1] and subsequently Reynolds in 1986 [2] has lead to myriad theoretical models expressing animal group behaviour in terms of heuristic rules which govern their individual motion. In a wide variety of disciplines, from social science to physics, there has been a strong desire to understand and develop theories on how some complex structures self-organise. Indeed, many such theories now support the idea that the complex spatio-temporal patterns, noted in both eusocial insects colonies, and higher vertebrates such as schooling fish [3] and birds [4]; emerge through interactions between individuals ex- hibiting simple sets of behavioural rules [5–8]. The course of evolution has moulded the collective behaviour of species, given the survival benefits pro- vided only when cooperating as a group [9, 10]. Specific advantages include optimised group foraging, predator evasion, or efficient locomotion for example in schooling fish [11,12]. The specific behaviours, or rules, governing the collective dynamics of different animals is therefore wholly determined by their evolutionary path. A novel way of studying these different behaviours has been developed in the fields of robotics and biomemetics, specifically in studying the interactions and behaviour of schooling fish. By engineering artificial robots, or robofish, to imitate certain aspects of fish behaviour, recent studies have provided a more complete understanding of the interactions amongst fish and their surroundings [12–14]. Interestingly this field of research, known as ethorobotics, has also demonstrated how group behaviour can be manipulated by targeting specific sensory cues, with widespread applications for control theory in robotics and dynamical systems in general. The purpose of this work, motivated by recent developments in biomimetic robofish and their interaction with live schools of fish, is to model a two-component population comprised of fish and artificial con- troller agents, where intra-species interactions are manipulated for the purposes of control. In developing a control mechanism for a school of fish, we compare two recent experimental examples of fish-robofish interaction, a repulsive predation-response [14], and the novel discovery of group acceptance, or attrac- tion, of fish to a biomimetic robot [12, 15]. In this report we present a network embedded agent-based model of the collective motion, with an open-ended structure incorporating an extendible set of inter- action behaviours. Subsequently, we propose a distributed control mechanism, inspired by an existing method of global flock control designed to fetch and gather mobile agents to predetermined goal [16]. While the latter technique has proved successful in automating the task of a well trained sheepdog and his farmer, the motivation for actively controlling fish is inspired by more compassionate considerations. In the face of the ever-increasing threat from environmental disasters, it is hoped that by controlling large fish schools, we could to steer whole populations away from areas known to be hazardous [15]. Unfortunately, many of these hazards arise from human caused accidents such as oil spills, affecting huge areas of the ocean for extended periods of time. The unprecedented ability to control marine life may therefore provide an effective way to mitigate the widespread damage caused by these potentially catastrophic disasters. 1
  • 12. Introduction In conjunction with existing analytical methods characterising the collective behaviour of fish schools engaging a robot fish [17], we extend our analysis of controlled agent dynamics using a multiscale compu- tational approach. As with many complex systems we observe the characteristic patterns and emergent behaviours of collective motion largely in terms of its macroscopic evolution. Having developed a agent- based model simulating the microscopic evolution of fish under the influence of control, we implement the Equation Free method to derive a macroscopic system where coarse-grained evolutionary dynamics can be subjected to traditional numerical methods of analysis [18,19]. In the available scope of this work, we perform a preliminary system-level analysis investigating control stability at macroscopic steady states with respect to realistic parameters of the agent model. The results from this analysis largely provide a foundation for future work and highlight important considerations for construction of the coarse-grained model. In the following chapter, we provide a brief background summary into the important aspects of the research, including techniques for modelling collective behaviour; control of complex networks, and an introduction to multiscale computational methods. A description of the agent-based model is provided in chapter 3, with our definitions of global system observables and preliminaries of control outlined in chapter 4. The development of the control mechanism in discussed in chapter 5 including a validation and summary of our results. Having provided a micro-scale model of fish and potential robofish, we then discuss a multiscale computational approach using the Equation-Free method and the results of this analysis in chapter 6. A final summary of our conclusions and challenges for the future is discussed in chapter 7. 2
  • 13. Background 2 Background 2.1 Modelling collective motion The modelling of flocks, herds and schools has been considered by a diverse community of specialists from backgrounds such as computer graphics, biology and more recently theoretical physics. The most well known model to simulate flocking, attracting the attention of these groups, was an algorithm by Reynolds in 1987 [2], developed purely in the interests of visualising coherently flying objects. Imple- menting what is known as a ‘self-propelled particles’ model (SPP), objects in this model move along trajectories determined by equations describing three interactions rules acting between neighbouring ob- jects. Reynold’s model followed soon after the pioneering work of Aoki [1] which studied the collective motion of fish. In this paper Aoki first introduced the rules which are now ubiquitous in generic models of coordinated animal motion: avoiding collisions, aligning in the direction of neighbours and staying close to the local centre of mass (see figure 1 in the following chapter. Importantly, models such as these successfully confirmed the statement that collective motion occurs in the absence of leaders, arising from local interactions. The models described above belong to a class known as agent-based models (ABM). Seen as the nat- ural extension to cellular-automata (CA) models which describe grids of interacting cells with variable internal states, agent-based models are not restricted to performing actions simultaneously at constant time-steps, instead updating their internal states according to discrete-event environmental cues. Im- portantly to the study of biological systems, agent-based models allow for the ‘cohabitation’ of agents with different environmental (external) experiences and are not required to explicitly tile the simulated arena. For these reasons, agent-based models have been used extensively in the study of complex sys- tems allowing us to study macroscopic behaviour when only a precise microscopic description is available. A decade after the first SPP models were first introduced, an important quantitative analysis was pub- lished by Vicsek [20] in 1995. Using a statistical-physics type approach, this work introduced stochastic perturbations into a simplified deterministic SPP model in order to study phase transitions between ordered and disordered motion. The Standard Vicsek Model as it is known, laid the foundations for myriad variants investigating specifics such as finite size scaling behaviour [21]; single rules models [22]; potential-field models [23]; and adaptations for studying bacterial swarms by nematic-collision [24]. The accumulation of results in this field highlight the huge variety of macroscopic behaviours which emerge from simple, local interaction rules, dependent on limited set of parameters. As we have discussed, agent-based models provide a valuable tool for modelling the micro-scale dynamics of collective motion. In addition to this micro-scale approach, a variety of important continuum methods have been developed, in the context of providing a macroscopic description of SPP models. Methods such as those by Toner and Tu [25] and later Bertin et al. [26] provide fully nonlinear descriptions of collective motion in terms of the higher-dimensional dynamics. Much in the same way as the Navier-Stokes equa- tions provide a continuum description of fluid mechanics, these models incorporate equations derived from symmetry and conservation laws with parameters describing large-scale system behaviour. Other macro-scale analytical models include those which treat interacting individuals as coupled oscillators and study their synchronisation, or coordination, in a spatial framework [27]. This latter technique extends existing theories of synchronisation within static networks, such as those of heart cells and neurons, to networks with spatial dynamics such as fish schools. A key advantage of an appropriate continuum ap- proach is the ability to provide quantitative predictions of long-time, or long-distance flocking behaviour, 3
  • 14. 2.2 Control of complex networks a feature which is inaccessible to micro-scale agent-based dynamical models. As we shall discuss later, a system-level analysis using standard numerical methods typically requires a full macroscopic dynamical description. 2.2 Control of complex networks Network theory has become increasingly popular resource in the study of complex systems, providing an extensive toolbox of methods to analyse and interpret systems composed of many interacting subsystems. The basic description of a network, or graph, is a set of vertices, or nodes, interconnected with a set of links or edges. More complex descriptions of networks include directed edges which can be assigned a specific weight, or cost function. Typically the distribution of edges is such that it reflects the variable density of the structure described by the network. The ubiquity of networks in the modern world, both physical and abstract, has motivated diverse research efforts to develop a framework to control com- plex networks and self-organising systems. Recent developments include analysing the controllability of networks given their specific degree (edge) distribution [28] and ‘pinning’ techniques which induce synchronisation throughout a network by external control of a small fraction of nodes [29]. Unfortu- nately however, the interpretation of these results in the context of collective motion is non-trivial where descriptor network topologies are inherently dynamic [30]. When describing a group of flocking animals, or robots, we generally consider a dynamically evolving network of nodes (agents), connected with a set of edges which varies in time. In this description, connected components are said to be interacting, or can share information. Provided with this network interpretation it possible to obtain theoretical explanations for the observations in the dynamics of specific SPP models: for example, how agents reach consensus in their alignment despite the continuous rewiring of the decentralised network [31]. Theories of consensus and ‘rumour-spreading’ on networks are central to understanding how the dynam- ics on, and the dynamics of networks, can be controlled. The parallels between flocking behaviour and consensus on networks have are discussed by Blondel et al. [32] in terms of an ‘agreement’ algorithm which enables asynchronously communicating agents to reach consensus on a scalar value. These re- sults have a direct relationship to general control problems such as multiple agent rendezvous [33, 34] (consensus on location) and obstacle avoidance. The main focus of research into multi-agent control has been to develop distributed flocking algorithms to solve these control problems by devising local control strategies applied to individual agents, for example those representing a swarm of robots. The engi- neering applications of flocking are wide ranging, from mobile sensor networks, self-organisation of data networks and the many, less tasteful military applications. A general theoretical framework of consensus algorithms, designed to control flocking is discussed by Olfati-Saber et al. [35]. With respect to our investigation, there has been comparatively less research into combined networks of robots and animals, also known as ethorobotics. In these joint networks we can study methods of influencing animal motion by modulating their behaviour through interaction with robots. In their pa- per [36], Halloy et al. used mini-robot cockroaches to successfully influence a majority decision among the population. The work which has motivated the current study is due to Porfir and Marras et al. [12] who have produced a biomimetic robot fish, who’s presence in a live school is ‘accepted‘ as attractive stimulus. In their paper Aureli et al. [17] present a set of analytical methods which are used to study the interactions between the shoal and robofish. The work presented in the current study integrates some of these methods, developing a two-species agent-based model and control mechanism based on the modulation of intra and inter-species behavioural interactions. Specifically we will describe a control 4
  • 15. 2.3 The Equation-free method mechanism based on a predator-prey type interaction between fish and robots, investigated experimen- tally by Swain et al. [14]. A control mechanism exploiting an attractive fish-robofish interaction could well be based on recent experiments by Celikkanat and Sahin (2010), in which robots swarms are guided by a minority of intelligent individuals [37]. 2.3 The Equation-free method When creating models of complex systems, especially those discussed in relation to collective motion, we are often restricted to providing a precise description only at the microscopic level. A common hallmark of such systems is the observation of behaviours or patterns at the macroscopic level, emerging as a result of the interactions and dynamics at the micro-level. For example in a school of fish, we find flowing bands of coherently aligned individuals; complex milling structures and clustering; dynamical features which are all observed only at the macroscopic level. As we now understand, this macroscopic behaviour is produced without leaders, resulting purely from interactions between individuals, or fine-scale processes. Given an accurate microscopic description, it is often impossible to analyse, and therefore predict, the macroscopic dynamics of such systems over large spatio-temporal scales. Direct simulations are often restricted to small subspaces or very short time-scales due to their computational expense and important methods such as numerical bifurcation analysis are impossible without a coarse-grained description. In certain cases, macroscopic models can be formally derived by considering relevant conservation laws or symmetries, as we discussed earlier on. For some systems there is an appropriate mathematical method which can be used to derive macroscopic equations from the fine-scale description. For many complex systems however, the coarse-scale dynamics are only accurately captured when a complete, fine-scale description is retained. The Equation-Free method developed by Kevrekidis et al. [18, 19] is a multi- scale approach, providing a bridge between a fine-level description and coarse-grained dynamics. A key component of this method is the coarse timestepper, discussed in more detail in chapter 6, which circum- vents the need to derive explicit equations to provide closure of the micro-scale system, hence the name ‘equation-free’. Coarse-graining is achieved by computing a set of low-order, macroscopic observables, which are used to initialise, or ‘lift’ an ensemble of micro-scale systems which are simulated in short bursts. By choosing the coarse-grained observables such that higher-order moments quickly become functionals of the low-order variables, the coarse timestepper can provide a closed form solution of the underlying, higher-dimensional dynamics. Once we have obtained the coarse-grained dynamics we can employ the traditional array of continuum numerical techniques as coarse-level solvers, for example to study bifurcations or optimisation. There have been a number of relevant applications of this method which have provided motivation for our implementation in chapter 6. One example, a paper by Moon et al. [38], uses an Equation-Free method to provide a coarse-grained solution to an alignment consensus problem in groups of animals similar to those discussed earlier. Also valuable to our study, has been the work of Tsoumanis et al. [39] who have implemented Equation-Free methods to provide a multiscale analysis of an agent-based model describing a toy social network. 5
  • 16. An agent based model of schooling fish 3 An agent based model of schooling fish In order to simulate the interactions and dynamics of a collection of autonomous individuals, an agent- based model (ABM) is used which describes both the internal states of individuals and the rules by which they interact. ABMs of this kind, known as self-propelled particle models (SPP), are commonly used to describe and explore the dynamics of flocks, swarms or schools of fish, and have been widely studied [20,35,40] due to the variety and complexity of group motion which emerges from a very simple set of rules. Given a set of agents with initial internal states, their evolution is entirely determined by the operation of the agent rules, subject to any stochastic variables defined in the model. Most commonly, a single population of identical agents is simulated in order to explore the behaviour of the group dynamics as a function of the rules common to all agents. As a prelude to a more behaviourally accurate model of fish interactions, the ABM developed in this project is a generalised ‘skeleton’ model, incorporating multiple interaction rules which are combined linearly with a proportional gain assigned to each. Using this approach the model can be later modified to more closely approximate the behaviour of a species of fish, or any other gregarious animal, with specific parameters obtained from the appropriate experimental research. Regardless of differing animal behaviours, the internal states of all agent can ultimately be described in terms of their position and velocity. In all models however the interaction rules will only describe a limited subset of the animals behaviours. By adjusting the rules and fine tuning the relevant parameters, one can hope to replicate the motion of sparrows or zebrafish from the same basis model without the need to worry about feathers or fins. The implementation of the ABM in this investigation follows a modified version of a self-driven particle model, colloquially known as ‘boids’, originally conceived by C.W. Reynolds [2] in the 1980s. The al- gorithm used in the model gained much recognition in the field of computer graphics with its ability to reproduce the natural complexities of collective motion in an entirely deterministic manner. The model includes three primary steering behaviours which describe how an individual agent, or fish, reacts in accordance with its local neighbours in the group. The local group is characterised by a fixed distance representing the maximum range R, of influence each agent has on others. The importance of localising agent interactions is twofold: firstly it emulates the natural limitation of communication at a distance, for example fish swimming in murky water; and secondly in terms of greatly reducing the computational requirements for large agent populations. Individual fish are represented as members of an ‘Agent’ class encapsulating the core variables for each agent; specified simulation parameters and the variety of functions required to perform the time evolution of the multi-agent system. Similar to previous experiments studying the motion of fish [17, 41, 42], we consider a two-dimensional approximation, justified since the major component of collective motion within small schools of fish is generally observed to lie in the horizontal plane. The approximation is particularly appropriate to certain fish in shallow water habitats in the wild, or controlled experiments in shallow tanks. Each agent is therefore described in terms of their current position in a square arena, of side length Lxy centred on the origin; and their current velocity in orthogonal coordinates. Both properties are held internally as 2-vectors: x(i) = x(i)x, x(i)y v(i) = v(i)x, v(i)y (1) 6
  • 17. 3.1 Proximity Network Model i.e. the speed of each fish equal to the magnitude of the vector v: ui = vi (2) 3.1 Proximity Network Model In this model, all agents within the specified radius of influence affect each other equivalently, where interactions can be decomposed into a linear combination of pairwise contributions. Interacting agents can therefore be considered as connected nodes in an undirected, time-varying network of order N (N agent population), where an edge exists between agents separated by a distance less or equal to an imposed cut-off radius R: G = (V, E) V = {Vi|i = 1, ..., N} ∼ N individual agents E = {Vi, Vj} , Vi, Vj ∈ V ∼ edges between interacting agents (3) where the graph G is undirected, i.e.: Evi,vj = Evj ,vi (4) At any individual timestep throughout the simulation, the connectivity of a proximity network is therefore fully described by the adjacency matrix A = [aij], changing over time with elements ai,j according to: aij = 1 if |xi − xj| ≤ R 0 otherwise (5) The network structure reflects the connectivity of the agents in terms of those which are currently influencing each other. In this simple implementation, the network model treats the radius of influence as a hard cut-off between interaction and non-interaction. Communication between all agents within the radius R are therefore identical in their relative strength. 3.2 Time evolution - network dynamics The SPP model implemented utilises a discrete-time, sequential agent update method with unit length simulation timesteps, in arbitrary units of time (i.e. dt = 1). At each timestep of the simulation, the net- work structure is updated using (5) before calculating a set of steering correction vectors va(i), vcm(i), vs(i) for the i’th agent in sequence. The velocity of agent i at the next timestep (t + 1) is updated by the linear combination of the ‘steering’ vectors, as follows: v(i) (t + 1) = v(i) (t) + kava(i) (t) + kcmvcm(i) (t) + ksvs(i) (t) (6) where ka, kcm, ks : R ≥ 0 - are gain parameters adjusting the relative strength of each steering behaviour. The position of each agent at the next timestep therefore becomes: x(i) (t + 1) = x(i) (t) + v(i) (t) dt, dt = 1 (7) At each time step the speed of each agent, vi is restricted within a range from a minimum value vmin and maximum vmax. A realistic model of animal motion should prevent agents from moving arbitrarily 7
  • 18. 3.3 Steering rules - simplified model of schooling fish behaviour fast whilst a minimum speed restriction prevents the group velocity from diminishing to zero. The direction of motion is maintained by renormalising the unit vector of agent velocities outside the limits as follows: vi = vi vi · vmax if vi > vmax vi vi · vmin if vi < vmin (8) A similar operation to the one in (8) is also available if we wish to prescribe constant speed to all agents in the simulation. 3.3 Steering rules - simplified model of schooling fish behaviour Agents are subject to three primary steering rules which are combined and used to update each par- ticle’s velocity at the next timestep of the simulation. These simple rules are designed to represent some of the known behaviours generally observed in gregarious animals. Central to each steering rule is the calculation of a vector describing the average position or velocity of the local group, or neigh- bourhood ni of agent i as perceived by the agent. The neighbourhood of an agent is defined as the set of nearby agents within a range of influence of radius R from a given agent, excluding itself where: ni = {j ∈ V : xj − xi < R} , j = i. The simplified model coordinating motion within a school of fish therefore relies on each agent’s perceived local averages and knowledge of its own position or velocity relative to this average. Given that entire agent class is embedded within a dynamically evolving network, vector calculations can be conveniently expressed as a sum of appropriate elements aij of the the network adjacency matrix A. Averages are calculated simply by accumulating the position and velocity information over the local group and dividing by the node degree of the agent. • Average position (centre of mass) of group local to agent i: x i = N j=1 (aijxj) N j=1 aij (9) • Average velocity vector of group local to agent i: v i = N j=1 (aijvj) N j=1 aij (10) It is emphasised that these ‘perceived’ vector averages do not include the position or velocity of the primary agent i, and are denoted with angle brackets. In this model, behavioural rules are each expressed in terms of individual steering correction vectors which are added to the current velocity, altering the trajectory of an agent according to its various interactions at the previous timestep. The basic rules used in this model are described, along with their motivation, in the following sections. 8
  • 19. 3.3 Steering rules - simplified model of schooling fish behaviour 3.3.1 Alignment A traditional component in SPP models describing collective motion has been to provide a rule that allows agents to match their velocity with neighbouring agents. Many important insights into collective motion, for example the aforementioned work by Vicsek et al. [20] are models based solely on this type of interaction. In the Standard Vicsek model, agents have a fixed speed v , with velocity described by a heading angle, updated to match the neighbourhood average. The alignment rule implemented in this model differs in that v is not fixed, computing instead a velocity correction as a function of the current velocity and the local group average velocity: alignment va(i) = v i − vi (11) The vector va computed by the alignment rule in (11) is simply the two component difference between the current velocity of agent i and the local group average. Adding a proportion of this vector to the current agent velocity has the effect of aligning the velocity of agent i with the neighbourhood average, moderated by gain parameter ka. 3.3.2 Cohesion In addition to aligning with their close neighbours, it is frequently observed that members of a school or flock or animals display a tendency to minimise their distance from their closest neighbours. Group cohesion is a distinctive feature of the many gregarious animals where it is usually asserted that members of the flock gather together in order to benefit from a perceived ‘safety-in-numbers’. A strong tendency for group cohesion is observed in fish schools [12, 17, 42, 43]. The exact behavioural processes inducing group cohesion are of course unique to different species. Across all species however, the evolution of flocking behaviour is thought to be primarily driven by predation; however there are different inter- pretations of how safety-in-numbers benefits a population or the individual. A ‘many-eyes’ theory [9] suggests that information regarding a threat is disseminated more efficiently in large, cohesive popula- tion. A ‘selfish herd’ theory on the other hand, suggests that there are spacial benefits of a large group, enabling individuals to change their relative position between another member of the group and a po- tential predator [44]. Recent experiments testing these hypotheses with real sheep-sheepdog interactions have provided increased support for the latter [45]. The generality of these results however, and the implications for interpreting interactions in fish schools, is not fully clear. vcm(i) = x i − xi (12) The cohesion rule in (12) above calculates a velocity correction from the position vectors xi of the agent and local group average x i (perceived local centre of mass position). The resulting correction depends implicitly on the distance between the two points, producing a proportionally stronger correction at greater distances. The cohesion rule therefore heuristically reflects experimental evidence which finds that fish separated by greater distances compensate more strongly in order to regain their cohesion [42]. In this model, application of the cohesion rule moves agents fractionally closer to the local group position, moderated by the gain parameter kcm. 3.3.3 Separation A separation rule is used to enforce a ‘soft’ repulsion between agents, reflecting experimental observations of fish behaviour and prevents agents becoming so close that they would physically overlap. A steering correction vector vs is calculated by accumulating vectors opposing all neighbouring agents closer than 9
  • 20. 3.4 Boundary Conditions a radius rsep away from agent i: vs(i) = − N j=1 aijd (xi, xj) (xj − xi) (13) where: d (x, y) = 1 if x − y ≤ rsep 0 otherwise (14) The separation rule in (13) returns a total separation correction vector which produces steering in the opposite direction to the nearby neighbours, with a strength moderated by gain parameter ks. Schematic examples of the steering rules are show in figure 1, courtesy of C.W. Reynolds website [46], where each is described in isolation, acting on a single agent with respect to its neighbours. Alignment Cohesion Separation Figure 1: Schematic representation of steering rules [46] 3.4 Boundary Conditions Two methods of applying finite size simulation boundaries are considered: reflective and periodic bound- aries. Both methods provide the means to constrain agent positions within the square simulation arena, defined by the side length Lxy - a necessary restriction in any simulated particle model. The reflective algorithm constrains particles encountering the boundary by negating the velocity component orthogonal to the respective boundary vector. Alternatively, a periodic boundary maps agent position vectors onto the opposite side of the simulation arena by addition or subtraction of Lxy. Periodic conditions are commonly used when simulating an arena of infinite size, for example to study bulk properties of materials. Applying this method normally has the advantage of minimising artificial boundary effects which can cause undesirable (unphysical) artefacts, or fluctuations in global observables (see 4.2.2). For the purposes of this investigation however, reflective boundaries were chosen as being most appropriate for the study of a dynamical system modelling physically confined agents, i.e. fish in a tank. A ‘hard’ reflective boundary condition inevitably produces artefacts in global observables, which should be considered in the full analysis of the dynamical system. 3.5 Model implementation in Python Both the agent based model, and the suite of analytical functions constructed to investigate controlled collective motion have been developed using the open source Python programming language [47]. The ability to modify model parameters interactively and write flexible, customisable scripts for analysing the resulting dynamics, is a major benefit of interpreted languages like Python. By utilising pre-compiled libraries (SciPy/NumPy) for precise numerical calculations, a good comprise is reached between faster performing languages such as C or Fortran development time. The simulation program is divided into 10
  • 21. 3.5 Model implementation in Python Model variables agent position (i = 1..N) : xi agent velocity (i = 1..N) : vi network structure : A simulation time step : t Model parameters simulation arena size : Lxy interaction radius : R steering rule gains : ka, kcm, ks, kn velocity restrictions : umin, umax minimum agent separation : rsep Functions / Methods randomise positions : assign position to agents from a uniform dist. randomise velocities : assign velocity to agents from a uniform dist. network update : update network adjacency via (5) get local info : compute local group values via (9 & 10) velocity update : compute new agent velocities via (6) position update : update agent positions via (7) restrict speed : apply speed restrictions via (8) output observables : compute global observables (see 4) Table 1: Overview of the agent-based model object class (extended in section 5.2.2) two parts, described in the following sections. 3.5.1 ABM class object The primary code structure is an object class encapsulating the entire agent-based model, which can be instantiated independently with unique parameters, as many times as memory restrictions permit. Each ABM object instantiated in memory represents an isolated realisation of the model; storing agent position / velocity vectors; model parameters and the functions (methods) used to evolve the micro- scale system through each time iteration. A synopsis of an the ABM class, including the basic model parameters in table 1. The ABM class acts as a self-contained micro-scale simulation model which can be initiated with a set of initial conditions and parameters, evolved in time using the model functions, and probed for numerical outputs. The model object inherits functionality from the NetworkX Python library; providing a comprehensive suite of functions to describe, analyse and visualise network structures [48]. 3.5.2 Analytical toolbox The second unit of code is a wrapper module containing a set of ‘external’ procedures which initiate, instruct and analyse the agent based model realisations. Most of the analytical methods described in this investigation, and essentially the multiscale coarse-grained analysis, rely exclusively on computing ensemble averages of model dynamics. A major benefit of using an object oriented approach is the ability to parallelise the simulation of multiple micro-scale realisations to exploit the full processing power of multi-core processors. A set of ABM realisations can then queued and run independently cores, in parallel, until each ‘thread’ is completed. The outputs of each model are then accumulated prior to analysis. Since information is not shared between model realisations until each is completed, an approximately linear performance gain can be achieved relative to the number of processing cores. The experiments in this work have been performed on up to four, dual-processor (4 cores per CPU) Linux machines, each with 8 Gb of system memory. Further processing efficiency can be achieved via more complex algorithms and multiple machine clusters, a technique addressed in a number of papers specifically modelling the dynamics of fish schools [49,50]. Using the current implementation and 11
  • 22. 3.6 Tuning model parameters - achieving collective motion hardware, it is possible to initialise and simulate a 30 agent model through 100 timesteps on an 8-core machine in ∼ 3 seconds and a corresponding ensemble of 500 simultaneous simulations, using parallel code, in approximately 188 seconds. For ensemble processing therefore, the multi-core approach indeed provides a linear (∼ 8 times) increase in speed. 3.6 Tuning model parameters - achieving collective motion The parametrisation of the fish ABM model described in this research remains entirely without specific units, for the purposes of both simplicity and generality. Similarly, the dimensions of all parameters are trivial, expressing either a position, length, velocity or are dimensionless gain factors. It is already understood that the general model description is capable of representing a wide variety of complex global behaviours [2]. It is important however, that the parameters of the model are defined such that the steering rules act in such a way that results in a minimum level of collective motion, whilst being approximately commensurate to those of real fish. A valid set parameters for this implementation was obtained heuristically, based on certain restrictions. The task of accurately matching specific parameters with experimental values is left to future work (see 7.1). 3.6.1 Parameter values Given the limited time and computing resources available for this investigation, the number of agents N per model realisation is restricted to around ∼ 30 agents for our numerical analysis. The procedure implemented to update the agent network is of complexity O(N2 ) - a naive algorithm evaluating all pairwise euclidean separations. Although faster classes of algorithms do indeed exist for this task [51], small agent (fish) populations are found to be acceptable for the current research. Although agents are not explicitly assigned a size in the model, a scaling approximation can be derived in terms of the minimum separation parameter rsep, interpreted as a unit of the order of one fish body length (BL). The set of default parameters used in the model are listed in table 2, and can be compared with some of those in other experiments with real fish [17]. simulation arena size : Lxy = 15 ∼ 75 BL minimum agent separation : rsep = 0.2 ∼ 1 BL interaction radius : R = 3 ∼ 15 BL maximum agent speed : vmax = 0.3 ∼ 1.5 BL/∂t minimum agent speed : vmin = 0.05 ∼ 0.25 BL/∂t alignment gain factor : ka = 0.15 cohesion gain factor : kcm = 0.01 separation gain factor : ks = 0.5 Table 2: default parameter set for fish ABM - with length/velocity units expressed in nominal units of fish body length (BL) The parameters values defined in table 2 are found to produce evolving dynamics consistent with the behaviours described by the steering rules in 3.3. The density of agents in the simulation arena has been chosen such that it is of a similar order of magnitude to a typical system which could be studied experimentally. Velocity restrictions are also within a correct order of magnitude relative to a fish body length. 12
  • 23. 3.6 Tuning model parameters - achieving collective motion 3.6.2 Evolution of the ABM - visualisation and validation The evolution of a single agent-network realisation, is produced via the following sequence: 1. initialise agent positions e.g. with a uniform distribution across the simulation area 2. initialise agent velocities with uniform random samples within the speed restrictions 3. compute/update the network adjacency (update network structure) 4. compute individual steering correction vectors and apply total velocity corrections to each agent in sequence 5. apply speed restrictions to all velocity vectors 6. update agents positions and apply boundary conditions 7. repeat from (3) At any given timestep, the evolution of the particle system can be visualised by plotting the positions of the agents in the x, y plane, with pairwise links identifying interacting agents. A histogram of the position data is then used to highlight the distribution in the plane. The functionality of the model is tested by initialising agents uniformly in the plane with randomised velocity vectors. A representative evolution of a system of 30 agents is shown as two time snapshots in figure 2 and 3. After observing many prolonged time evolutions of the agent system, the following observations have been made, successfully including all of the expected hallmarks of collective motion: • Initialised uniformly in the plane, agents undergo a rapid phase of clustering, due to their initial proximity. • Agents on the outskirts of a cluster are observed both to align with the local group average velocity, and converge towards the group centroid position. • The distribution of particles in a particular cluster do not converge to a single point, instead maintaining a relatively stable distance from one another as intended by the separation rule. Figure 2: Agent model initialised with uniformly distributed random positions: (left) Visualisation of network structure, with lines connecting interacting agents, coloured by node degree. (right) Position distribution histograms indicating a fairly uniform distribution in x and y 13
  • 24. 3.6 Tuning model parameters - achieving collective motion Figure 3: Agent model in figure 2 evolved through 20 timesteps: (left) Network visualisation identifying cohesion and clustering of agents. (right) Position distribution histograms with peaks identifying agent clusters • Clustered agents reach a consensus velocity and drift together as a group with smaller groups remaining fairly stable after reflection from boundaries. • Interacting clusters commonly form a super-cluster, with a resultant group velocity in a direction dictated by the combined velocity of the previous components. • Alternatively group collisions may results in cluster fracturing with subsequent recombination; a typical, and beautiful signature of natural collective motion. Emergent behaviours such as these are prevalent in flocking starlings and indeed fish schools [3,4]. Animated examples of the mobile agent model, prior to implementing a control mechanism, can be viewed at the the following URLs: • 500 agents in a Lxy = 15 arena, with speed restriction vmax > v > vmin - http://www.youtube.com/watch?v=uHccGYhHgy8 • 100 agents in a Lxy = 15 arena, speed constant v = 0.3 - http://www.youtube.com/watch?v=q3_X1pGu84U • 500 agents in a Lxy = 30 arena, speed constant v = 0.6 - http://www.youtube.com/watch?v=Eve6GK2qusk 14
  • 25. Global observables of the agent based model 4 Global observables of the agent based model In order to quantitatively describe the evolution of the model we define a set of global observables based on the state variables of a system at any time t. Global observables can be used to compare data between the different parameterisations of the model, or combined to generate ensemble averages from set of randomly initialised model realisations. In terms of the ABM we have described, the only state variables which evolve in time are the positions and velocities of each agent, and the adjacency matrix A describing the structure of the interaction network. From this information it is possible to construct a number of useful observables describing dynamical and spatial group properties. Observables described in this section are calculated continuously in each model realisation and are therefore accessible to the analytical wrapper functions described in 3.5.2. 4.1 Spatial observables The primary observables used to analyse collective dynamics in this study are the mean position of all agents µcm, and the associated standard deviation σcm. These vectors provide a snapshot of the agent system in terms of their combined position as a ‘super-cluster’, along with a measure of how tightly the agents are gathered about the mean position. Crucially, these two global variables will be used to construct the coarse-grained variables used in the equation-free multiscale analysis discussed in section 6. 4.1.1 Global centre of mass The global mean position, referred to as the global centre of mass µcm, describes the average vector position taking into account all agents, defined as: µcm (t) = 1 N N i=1 xi (t) (15) with an associated vector for each agent relative to the centre of mass: ri (t) = xi (t) − µcm (t) (16) 4.1.2 Global standard deviation The standard deviation around the mean vector, resolved as a vector in orthogonal dimensions, is com- puted in the usual way for a complete set of discrete variables: σcm (t) = 1 N N i=1 (xi − µcm) 2 (t) (17) 4.2 Dynamic observables Two additional global observables are introduced, which are useful in describing the coordinated dynamics of the agent system in terms of the velocity vectors. We define a normalised group momentum P, and a normalised group angular momentum L in the same way as described in [17] to study the dynamics of real fish schools. 15
  • 26. 4.3 Local approximation of global observables Although the calculation of P and L are incorporated within the ABM as described, the scope of this preliminary investigation has limited their inclusion in a full analysis or in the equation-free approach. A brief summary of their calculation and significance, is however provided below. 4.2.1 Normalised group momentum The normalised group momentum P can be viewed as an order parameter describing the collective motion of the system, capturing the degree to which the velocity vectors of the group are aligned, irrespective of their magnitude or position. Given this description, the group momentum is equal 1 when all agents are aligned in the same direction, and equal to 0 when the velocity unit vectors are uniformly distributed. The latter condition is satisfied when the group centre of mass is stationary, i.e. µcm (t + 1) = µcm (t) P (t) = N i=1 vi (t) N i=1 vi (t) (18) 4.2.2 Normalised group angular momentum The normalised group angular momentum L is useful for studying emergent structures which are highly aligned relative to the group centre of mass - for example single mill structures in which agents collectively rotate around the centre of mass. The group angular momentum is at a maximum when every agent rotates around the centre of mass in the same direction, and zero when the angular momentum w.r.t. the centre of mass is zero. L (t) = N i=1 ri (t) × vi (t) N i=1 ri (t) vi (t) (19) The variables P and L have been plotted as a time-series in figure 4 (right) with a plot (left) visualising the resulting typical agent network after 500 timesteps, with random initial conditions as before. A red marker identifies the calculated global centre of mass, positioned at the centroid of the group. Initial agent velocities are randomised uniformly and therefore P = 0 at t = 0. The group momentum rapidly increases from zero as agents become coherently aligned. Rapid decreases in P are observed when agent clusters collide and reflect from boundaries, where successive numbers of agents align to oppose the velocity of the original cluster. As a cluster moves away from a boundary, proximal agents quickly align their velocity and P once again increases. The evolution of L is less trivial to interpret from the data. There does however appear to be a strong correlation between the boundary collisions events revealed by P, and the formation of transient milling structures which subsequently die away as clusters reach a new velocity consensus. In the later stages of this time evolution, a complete cluster is formed and agents reach a consensus velocity resulting in a value of P ≈ 1. 4.3 Local approximation of global observables For our investigation into control, presented in following chapter, it is presumed that a given controller, or group of controllers released into a population, initially possess only local knowledge about the state variables or dynamics of the system. This is to say we assume that controllers do not have direct access to global information, for example: the entire network structure A, global centre of mass µcm or other observables, P,L etc, which may be subject to control. It is likely in fact that a controller, or robofish, would not even be ‘aware’ of basic system variables such as the number of agents, or the dimensions of 16
  • 27. 4.3 Local approximation of global observables Figure 4: 30 agent system evolved through 500 timesteps: (left) final agent configuration at t = 500, (right) P and L as a function of time - L generally increases over time with rapid loss of global alignment as agent clusters reflect from boundaries the arena they find themselves in. In the context of this research, a robofish may ultimately be required to control an unknown number of fish in a dynamic ocean environment. It is important therefore to find out to what extent global properties can be estimated from local information. To test the viability of obtaining local estimates of the global observables, we will consider a set of controllers, or scout agents, each of which can measure the state of a local subset of the agent network. Controllers in this model are considered to be autonomous, possessing of a set of internal rules oper- ating on a description of their local environment, similar to that of any other self-driven agent. Here, control agents have an additional feature in that they can communicate or broadcast knowledge to other controllers, and report to the outside world, over arbitrary distances. The total knowledge of the con- trol agents is therefore distributed and decentralised, limited by their total distribution in the population. 4.3.1 Defining a two species agent model We extend our current model by splitting the agent population into two subsets or species. The descrip- tion of the agent network described in section 3.1 is modified to differentiate between γ-species control agents (robofish) and the rest of the population, α-species (fish). We consider each species as a subset of the network vertices in the following way: • γ-species consisting of Nγ control agents as a subset of the total agent population of size N: γ ⊂ V {Vi, i = 1, ..., Nγ} (20) • α-species consisting of Nα = N − Nγ ‘normal’, or fish agents completing the set: α ⊂ V {Vi, i = Nγ + 1, ..., N} (21) Following this definition, the description of the network given by the adjacency matrix A includes agents from both subsets α and γ. If we wish to study the resultant dynamics of the controlled agents, the fish population, we can extract the structure of the α-agent network Aα as submatrix of A: 17
  • 28. 4.3 Local approximation of global observables Aα ⊂ A, where A = [aij] : i, j ∈ [1, .., N] (22) Aα = [aij] : i, j ∈ [Nγ + 1, .., N] (23) 4.3.2 ‘Scout’ agents as estimators Before discussing specific control strategies in the next chapter, it is interesting to assess how well a subset of agents can estimate the global observables which one may wish to control. Here we refer to γ-species agents as ‘scouts’ in that they have identical interaction rules as those of the normal α-species. The only difference as before, is the ability of γ-agents to combine local information extracted from the full network. The first example of a local estimation we describe in in terms of the network structure. Since the com- putation of Aα in (22) explicitly requires the full controller-agent-network description given by A, both matrices represent global information which is unavailable to the subset of control agents. However by sharing local information, scout agents can derive an approximation Aα by computing a network from inter-species (α−γ) links, including all α-species agents currently interacting with scout agents. Further to this, if scouts share their positions and relative positions of connected α-species agents, missing α links can be inferred which would otherwise not be known to scouts acting in isolation. The networks shown in figure 5 provide a visual representation of a single agent network A in terms of the α-species subgraph Aα, and scout approximation Aα. The ability to approximate global network structure in this way may prove to be a huge advantage in the development of advanced control strategies. Current research in this area, for example pinning control techniques developed in [29], can only be effectively applied if the network topology is known. A Aα Aα Figure 5: Network visualisations describing: (left) the full agent network A, (middle) the α-species agent network Aα and (right) network Aα of α-species agents as shared knowledge of γ-species controllers. Nγ = 6, Nα = 24 - larger circles represent control γ-species Another simple example is chosen to demonstrate how the global centre of mass µcm can be estimated from average local group values of a set of scout agents. As we are now interested in estimating the centre of mass exclusively of the α-species population, the perceived centre of mass reported by scout agent i becomes: x i = N j=Nγ +1 aijxj N Nγ +1 aij (24) 18
  • 29. 4.3 Local approximation of global observables leading to an estimate for the global centre of mass µest calculated as follows, by Nγ scout agents: µest = 1 Nc Nγ i=1 x i (25) [Note: scout agents with no links to normal agents will not contribute and therefore should not be included in the average in (25)] Before we can compare estimates to the true global values, it important to note that summations over the agents in equations (15) to (19) are been modified to include only the α-species population, i.e. (i = Nγ + 1, .., N). An evolution of an agent-scout system is shown in figure 6, with a plot of µest−µcm - the scalar difference in estimated and global values. From results like this, it was found that the simple estimator µest provides a good estimate to µcm after sufficient time such that α-agents have clustered into a small number of groups, providing there are enough scout agents to be distributed evenly among the clusters. For example, even for a very low relative density of scout agents, a very good approximation can be obtained for µcm if the α-species forms a single, large cohesive group - as expected. Figure 6: ABM time-evolution with ‘scout’ agents to estimate global centre of mass - Nα = 50, Nγ = 5. (left) network structure A after t = 200 timesteps. (right) µest − µcm - as a function of time, indicating a more accurate approximation to µcm as time progresses. 19
  • 30. Controlling a network model of mobile agents 5 Controlling a network model of mobile agents 5.1 Problem definition The primary objective of this research is to implement and analyse a control mechanism designed to in- duce stable configurations of agent states, with average global observables converging on pre-determined values. In this model we implement a control strategy which guides the agent population to converge on a specific target (goal) position, and remain at the target in a stable configuration for as long as the control is active. More specifically, the objective is to arbitrarily control the centre of mass position of the agent-school µcm, and regulate the standard deviation σcm around the target location near a given threshold. Using the agent-based model described in chapter 3, we are able to describe a system of fish-like autonomous mobile agents, moving in accordance with a set of pre-defined rules, or steering behaviours. Unlike the additional behaviours supposed by other investigations into control and agent rendezvous [33–35], we assume that the α-species (fish) agents have no predetermined objectives or mo- tivation to move in any other direction other than those given by the basic rules defined in section 3.3. When considering the control of living creatures such as fish, we are able only to consider methods which achieve desired responses through the external influence of their existing behaviours, with no means of modifying the genetically hard-wired behavioural response itself. Ethorobotic control must therefore introduce an external influence in the form of controllers, with an additional set of behaviours designed in such a way they can modulate the behaviour of the population. The objectives of control are met when this influence is such that a stable, predictable or predetermined evolution of the population is achieved. There are two general classes of control interaction which have been used to engage live fish schools, a re- pulsive predator-prey type interaction; and an attractive interaction induced by biomemetic acceptance. Recent work by Swain et al. [14] incorporates a fish sized robot, magnetically controlled from beneath the tank, inducing a predator-like behavioural response from the fish. The robot predator is controlled using real-time feedback, in such a way as to chase the moving centroid of the school or dart towards it momentarily. The dynamic response of the fish can then be analysed providing a more complete under- standing of their behavioural responses. Ongoing research conducted by Porfiri’s group [12,13,15,17] has taken a different approach by developing self-contained biomemetic robot fish, with a propulsion system carefully engineered in order to mimic the swimming motion of real fish. From this work it has been found that fish can be attracted to the robot fish, as if accepting it as one of their own. Furthermore, the attraction is observed to strengthen when the tail is beating rather than static, perhaps due to the hydrodynamic efficiencies of swimming within the wake-field generated by the robot. The observation and analysis of both types of control-fish interaction provides a basis for the development of a variety of different control strategies. 5.2 A method for distributed, local control The control mechanism developed in this work takes its inspiration from the familiar gather-and-fetch task of a sheepdog, rounding up the flock in order to deliver it to a predetermined target position. This comparison assumes a specific, predator-prey like response between the fish and a controller, similar to those studied in experiments where robotic-predators engage a school of fish [14]. By equating the sheep-sheepdog and predator-fish attraction-repulsion interactions, we develop a comparable mechanism for controlling the global properties of the agent-based model of schooling fish. 20
  • 31. 5.2 A method for distributed, local control A primary motivation to explore this strategy has come from research by Vaughan et al. [16] and their experiments in automatic flock control, known as the ‘Robot-Sheepdog Project’. In this work, both a simulated and practical method was devised to successfully steer a flock of geese towards a target goal using a mobile robot, controlled by a steering algorithm using global position data acquired from over- head cameras. The control mechanism described in this section operates using similar principles to the robot-sheepdog, however with an important difference. Whereas the robot-sheepdog method used by Vaughan et al. uses the global average flock position as feedback for the control algorithm, the method implemented in this study uses multiple controllers with access to local information only. In the current scope of this research, the control mechanism proposed operates even in the absence of approximated global observables, as discussed in section 4.3. The resulting control mechanism is distinct in that it provides a method of distributed, local control. A distributed approach, with minimal controller com- munication is highly desirable given the motivation for this research: to control densely populated fish shoals in potentially large underwater environments. 5.2.1 Agent-control interaction The specific implementation used by Vaughan et al. achieves control by exploiting the predator-prey interaction, using a potential field model to combine an attractive force on the robot directed towards the changing flock centre of mass, and a repulsive force felt by flock members due to the robot. The control mechanism is completed by including a third force, acting on the robot with constant magni- tude to repel a static goal position. The combination of the fields experienced by the robot results in a potential minimum positioned directly behind the flock with respect to the goal and attracts the robot to that position. The repulsive force experienced by the flock agents in response to the robot results in motion away from the controller position and thus towards the goal. In the present study, similar control interactions are introduced by extending the steering behaviours of agents discussed in section 3.3 to include a repulsive predator-reaction in response to controllers. A subset of mobile controller agents, defined here as the γ-species in (20), need only to be provided with a steering behaviour to repel the goal position, ‘inheriting’ also the basic agent rules of cohesion, alignment and separation described earlier. The details of the interactions are discussed below. • The perceived neighbourhood centre of mass and local group velocity via (9) and (10) for each agent neighbourhood, with care to include only α-species (non-controller) neighbours. Velocity corrections are computed according to basis rules described in 3.3 with an extra steering rule in terms of velocity correction vector vr - a vector in the opposite direction to controllers - representing predator repulsion: vr(i) = − Nγ j=1 aij (xj − xi) (26) The effect of the predator-repulsion rule is shown in figure 7 in which all α-species agents correct their velocity by vr to move away from a controller within the interaction radius R. • A steering rule is introduced for controllers in terms of a velocity correction vector vg producing a constant vector away from some arbitrary goal position g inside the arena: 21
  • 32. 5.2 A method for distributed, local control Figure 7: Representation of the agent-controller interaction: α-agents react with velocity cor- rection vr away from a γ-species control position. Controllers however are attracted to the local α-species centroid via the normal cohesion rule vcm vg(i) =    − (g−xi) g−xi if N j=Nγ +1 aij > 0 0 otherwise (27) The correction evaluated in (27) produces a non-zero vector to repel the goal only there are one or more α-agents in the neighbourhood of a given controller. Controllers otherwise roam freely within the simulation arena until normal agents are encountered within their interaction radius R. With the controller behaviour described, γ-species agents do not actively search for α agents to control, rather they exert influence on α-agents which they encounter on their otherwise straight trajectory. Given this mechanism, we predict that a threshold density of controllers Nγ/Nα, relative to the population density ρα = Nα/L2 xy, below which stable control cannot be achieved. Optimised search strategies could be considered in which a non-interacting controller actively seeks α-species agents. For example, a more intelligent strategy could be devised which exploits the cooperation between controllers using shared global estimators, as discussed in chapter 4. Individual based methods could implement a default controller behaviour with space-searching trajectories based on L´evy flights which are thought to underpin many animal foraging [52] strategies. A full investiga- tion into these ideas would be a desirable topic for future research. Figure 8: (left) Controller attracted to α-neighbourhood centroid (vcm) and repelled from goal (vg) resulting in trajectory show by black dashed line. (right) Controller moves behind group w.r.t. goal such that α-agent repulsion from control (vr) drives them towards goal. 22
  • 33. 5.2 A method for distributed, local control The diagrams in figure 8 highlight the combined effects of the control rules which cause agents within radius R of a controller to be diverted in the direction of the goal. The diagram (left) shows a single controller being attracted to the centroid of the α-species group, whilst simultaneously repelled from the goal position. The resultant trajectory (black dashed line) positions it behind the group with respect to the goal, dynamically responding to the motion of the agents. The diagram to the right, a short time in the future, shows α-agents subsequently repelled by the controller in the direction of the goal as desired. Pictured for a single group interaction these diagrams describe the control process operating on a local subspace of the simulation arena. By utilizing multiple control agents, control can be achieved on a global scale as locally controlled agent clusters across the simulation arena combine and converge on a single goal position. • A crucial addition to the agent model is to allow γ-agents to exceed the speed of normal α-agents, governed by scale factor fv, > 0 multiplying the normal restriction vmax defined in (8). Although limited in a practical application, the control mechanism described depends on γ-controllers being able to move and react faster than α-agents, such that they can move rapidly to the position necessary to manoeuvre them towards the goal. 5.2.2 Controlled agent dynamics and gain parameter tuning At each timestep, the total velocity correction due to the steering rules is computed as a linear combi- nation of the species specific velocity corrections described above: • α-species agents: v(i) (t + 1) = v(i) (t) + kava(i) (t) + kcmvcm(i) (t) + ksvs(i) (t) + krvr(i) (t) (28) • γ-species control agents: (inherit identical rules, with extra rule vg to repel goal) v(i) (t + 1) = v(i) (t) + Kava(i) (t) + Kcmvcm(i) (t) + Ksvs(i) (t) + Krvr(i) (t) + Kgvg(i) (t) (29) where k..., K... : R > 0 - are independent steering gain parameters describing the relative strength of each steering behaviour for α and γ agents respectively. In order to achieve the desired steering behaviour required by the control mechanism, an appropriate set of gain parameters was found heuristically and is summarised in table 3. Gain parameters ka (alignment), kcm (cohesion) and ks (separation) describing the α-species (fish) are left unchanged from the default values listed in table 2. The additional parameter required to moderate the predation-reaction, gain kr, was selected by visually observing the dynamics of ABMs over a range of parameter values. A value of kr ∼ 0.5 was chosen as the default value for this investigation - providing sufficient predation-response like repulsion, observed to be strong enough to override their normal group behaviours in order to rapidly evade proximal controllers. Given the ‘fixed’ behaviour of the α-species agents representing the fish population, we must now choose appropriate values for the gain parameters Ka,cm,s,r,g affecting the behaviour of the γ-species controller agents. The two most important parameters which impact the control mechanism are the control gains Kcm and Kg, affecting the attraction to local α-neighbourhood centroids and goal repulsion respectively. Once again, these parameters were empirically selected on the basis of visual observations of the simu- lated behaviour. The ratio of the two parameters was considered suitable when the combined interaction produced qualitatively correct control behaviour. By making the controllers somewhat more strongly 23
  • 34. 5.3 Control validation Model variables α position (i = Nγ + 1..N) : xi α velocity (i = Nγ + 1..N) : vi γ position (i = 1..Nγ) : xi γ velocity (i = 1..Nγ) : vi control specific parameters α repulsion gain : kr = 0.50 γ repulsion gain : Kr = 0.25 γ alignment gain : Ka = 0.15 γ cohesion gain : Kcm = 0.30 γ separation gain : Ks = 0.50 γ goal repulsion gain : Kg = 0.50 γ vmax scaling factor : fv = 3.00 Table 3: Control specific variables and parameters, extending those from table 1 bound to the α-neighbourhood centroid than the equivalent goal repulsion such that Kcmvcm > Kgvg in general, we ensure that control agents push and follow agents towards the goal, making control more robust. If the goal repulsion is proportionally too weak however, controllers do not achieve the correct position relative to α-agents for the desired control; often approaching the group centroid too closely causing α-agents to scatter radially in an unpredictable manner. Defined as a subset of the agent population, controllers also inherit the remaining steering behaviours, moderated by the corresponding control gain parameters Ka,Ks and Kr. Although non-essential for the control mechanism described, the values for these parameters are selected to be non-zero for the following reasons: • The γ − γ interaction gain Kr is chosen to be non-zero such that it provides a moderate repulsion between controllers. This behaviour, discourages the clustering of controllers which, as part of a distributed control mechanism, are assumed to be more effective when distributed more evenly among the population. • A minimum controller separation distance rsep is defined identically as for normal agents, since in reality all agents including controllers should avoid collisions. For this reason Kr = 0.5, the same for normal agents. • The gain parameter Ka moderates how strongly a controller aligns its velocity with the α-neighbourhood average. Although a role for this behaviour is not explicit in the description of the control mecha- nism, the default value Ka = 0.15 is used throughout. The remaining tunable parameter is the scale factor increasing the maximum speed, or dynamic response, of controllers relative to α-agents, where fv = 3 was found to be sufficient for adequate control. 5.3 Control validation In order to validate the effectiveness of this control mechanism we can analyse the dynamical evolution of the agent based with varying numbers of controllers, and in the absence of control where Nγ = 0. 5.3.1 Effect of control on a single network In the first instance we obtain a qualitative validation of control effectiveness by calculating the root mean squared (r.m.s.) deviation of α-agents from the goal position as a function of time. In the following results, we specify an arbitrary goal position g = [1, 0] and evolve the agent system through 24
  • 35. 5.3 Control validation Nγ = 0 (no control) Nγ = 5 Nγ = 10 Figure 9: Evolution of the r.m.s. deviation from the goal position of Nα = 50 α-agents over 2000 timesteps with Nγ controllers 2000 timesteps, initialised with uniform random positions in the plane. Results are shown in the figure 9 with a system of Nα = 50 agents. The results in figure 9 indicate a substantial decrease in the average r.m.s. deviation from the goal when controllers are active among the population. In a system without control, the average position of α-agents in the arena is essentially random and fluctuates with a periodicity related to the speed of the agents and the size of the arena, irrespective of the goal. The effect of adding more controllers is to increasingly suppress large periodic fluctuations and reduce the average r.m.s.d value indicating a general convergence on the goal position. 5.3.2 Ensemble simulations A more conclusive analysis of the behaviour of controlled systems is obtained from generating ensemble simulations with the benefit of a reduction in statistical errors ∼ N −1/2 r , where Nr is the number of independent realisations. Each realisation of the agent-based model, differs in that the initial configu- ration of agents and their velocities is sampled pseudo-randomly from a uniform distribution. At each timestep of every simulation we calculate the global observables described in section 4, recording mean values averaged by the number of realisations. The main observables used to analyse and evaluate the control mechanism are the vector norms of the global centre of mass µcm and the corresponding global standard deviation σcm . The data shown in figure 10 shows the time evolution of µcm for Nα = 30 agents evolved over 600 time-steps under the influence of Nγ = 0..10 controllers with a goal target at g = [1, 0]. Time-series plots are calculated by averaging data from Nr = 500 independent network realisations, each initialised from a uniform distribution ( µcm ≈ 0) within an arena of dimensions Lxy = 15 giving an α-species density ρα = Nα/L2 xy = 0.1˙3. Initial agent velocity components are sampled uniformly between vmin and vmax. The results in figure 10 clearly indicate the effect of increasing the relative density of controllers Nγ Nα on the resulting global centre of mass. At higher controller density, above Nγ ∼ 5, µcm is found to converge close to the desired value of g = 1 (blue horizontal line), an indication that the desired global control goal has been achieved and remains stable over the simulation period subject to only minor fluctuations. With fewer controllers, control stability is decreased and much larger centre of mass fluctuations are observed. In the time window simulated, stable goal convergence is not achieved with Nγ < 3 where large amplitude, periodic oscillations are observed. The effect of control in all simulations with Nγ > 0 produces an initial rapid linear increase in µcm which is not observed in the uncontrolled system (Nγ = 0); suggesting that at least some of the agent population is initially directed by control 25
  • 36. 5.3 Control validation Figure 10: Time-series evolution of µcm of Nα = 30 agents interacting with: (left) Nγ = 0..5 controllers, (right) Nγ = 6..10 controllers. Goal target position g = [1, 0]. Data averaged over Nr = 500 network realisations action towards the goal. Only when a sufficient relative density of controllers is reached however, does the average system configuration converge on the goal position and remain stable with small fluctuations in µcm around the target value. The action of control is also observed to produce an overshoot in the centre of mass position, with an evolution that either becomes damped towards the target value when controller density is sufficiently high, or otherwise remains unstable. These observations are clarified in figure 11 in which the averaged values of µcm , and associated fluctuations in terms of the standard deviation σfluc., for each time-series are plotted as a function of Nγ = [0..21], using data values after the last overshoot from t = [200..600]. These results suggest that 5 controllers Nγ/Nα = 1 6 is sufficient to provide accurate convergence on the target goal, whilst further increasing controller density provides more stable dynamics after the conver- gence. However, the flattening of the decreasing tail of σfluc. in figure 11 (right), indicates a minimum background level of µcm fluctuation, reached with Nγ > 10 controllers and suggests an upper limit to the number of controllers required for stable control for this particular system. As an important consideration for controlling the motion of real fish, the model and tools provided in this investigation should allow for a more complete analysis of control-agent density requirements with further research. Specifically in the current model, controllers wander freely in straight lines when not interacting with α-agents, constrained by reflection at the boundaries. Increasing the area of simulation arena thus proportionally increases the ‘non-interacting void’ available to controllers. It is likely therefore that the controlled dynamics observed in the previous discussion are dependent on the both the simulation size Lxy and the corresponding density of agents ρα. The exact scaling is not however expected to be linear, primarily because agent interaction rules depend on the radius of interaction R and therefore agent cluster sizes are independent of the arena size. From the same ensemble simulations, time-series data for σcm is used to study how control affects the global deviation, or agent spread, around the mean position. The average values of this time-series data are also computed for values after the overshoot in µcm , between [t = 200..600], shown in figure 12. For the values of Nγ used in this analysis, we see a smooth decrease in the average deviation of agent positions as the number of controllers is increased, reaching a minimum value of σcm ≈ 2. Evidently, 26
  • 37. 5.3 Control validation Figure 11: (left) average values of µcm for varying numbers of controllers Nγ, calculated after overshoot t = [200..600], (right) associated values of σfluc. as a function of Nγ. α-species size Nα = 30 the higher the density of controllers, the more tightly confined the average configuration of agents be- comes; eventually reaching a limiting value. It is interesting to note that the minimum controlled value of σcm does not converge on the uncontrolled value µcm Nγ =0 ∼ 0.77, found by fully equilibrating the Nγ = 0 system. One suggestion is that the repulsive interaction between controllers and agents serves to continuously perturb the system to an extent that the stable configuration never fully relaxes to the most closely packed configuration allowed by the normal agent rules. Once again, these interesting questions and ideas for more detailed experiments are left to further research. Figure 12: Average values of σcm after overshoot in µcm calculated be- tween t = [200..600]. Data identifies a smooth decrease to minimum value σcm ≈ 2 - a factor 2.4 larger than σcm Nγ =0 = 0.77 A final validation and analysis of the control mechanism is obtained by focusing on system dynamics in response to the goal location g. The time-series plots in figure 13 show the global centre of mass response of controlled ensemble simulations with Nα = 30, Nγ = 6, initialised with uniform position and velocity distributions. Stable control is achieved for all goal targets g = [0..5]. Additionally, the maximum deviation of the overshoot in µcm is observed to vary as the goal position is moved further from the initial centre of mass at zero. A possible reason for this dependence is the following: As the goal is moved away from the origin, the symmetry of the system is reduced with a higher proportion of agents travelling further to reach the goal. Over longer distances, higher density agent clusters are able to form, overshooting the goal with a more concentrated centre of mass and thus a larger relative contribution to 27
  • 38. 5.3 Control validation the ensemble statistics. Figure 13: Time-series data of µcm for 6 different goal positions along the x-axis, g = [0..5, 0] averaged over 500 network realisations per time se- ries. Initialised with uniform posi- tion, each time-series shows success- ful, stable control at the desired tar- get - g = [0..5] respectively. The magnitude of the overshoot in µcm prior to achieving stability appears to be related to distance between initial and final centre of mass values. Nα = 30, Nγ = 6 for all simulations. The overshoot behaviour due to control action is analysed further by plotting a step-response time-series, in which the goal position is changed at specific points throughout a simulation ensemble, at the same time-step in each realisation. The graph in figure 14 identifies overshoots in the aggregate direction of motion of α-agents: positive when the goal is shifted in a positive direction and correspondingly negative when shifted back, in the opposite direction. As before, a larger overshoot is observed when the goal is changed from g = 1 to g = 5 at t = 1000 than for the smaller shift between g = 1 to g = 2 at t = 200. Interestingly, a large shift in the goal position is accompanied by a perturbation in σcm which is not observed for the smaller goal shift. This behaviour, can be observed by watching the animations described in the next section, and is almost certainly due to agent dispersal by controllers via the repulsive interaction krvr. A large change in goal position often leads to fracturing of the large cluster, gathered at the previous goal, into smaller clusters. The longer transit duration to a more distant goal allows these clusters to become more spread out from one another, increasing σcm , before the control mechanism eventually stabilises the configuration into a larger cluster around the new goal position. Regardless of the relative position of the new goal, the perturbation is therefore always positive, indicating a transient disruption to global agent cohesion as they are redirected to a new target in the arena. Applying this control mechanism to a system of real fish therefore would not guarantee a smooth transition of a single school between dynamic goal positions. Instead, distributed controllers are likely to disperse fish into multiple smaller schools, which move off independently in the general direction of the goal. In sufficient numbers, controllers are then able to stabilise the vast majority of the fish around the goal position as a single school. 5.3.3 Animated examples of agent control This section provides some animated examples of a number of controlled agent systems, available to view or download from the web at the URLs indicated below. The first example, an agent system with Nα = 30 provides a direct comparison with the results discussed in the previous sections. Latter exam- ples employ larger agent populations Nα = 500, providing a qualitative assessment of control at higher agent densities, and various control-agent densities. In all examples, agents are initialised with random uniform distributions in position and velocity as described previously. Each animation follows the evolution of a a single model realisation in terms of the agents positions, and the structure of the agent network A. The complete agent population is visualised as a dynamic 28
  • 39. 5.3 Control validation Figure 14: Step response due to goal repo- sitioning - evolution of µcm and σcm over 1800 timesteps, averaged over 500 network reali- sations. geometric network. α-species nodes are represented by circles, with larger circles identifying γ-species controllers. Pairwise agent interactions defined by the network edges, are indicated by adjoining lines. All node circles are coloured relative to their network degree - identifying otherwise obscured tight clus- tering between agents. In addition to the network structure, the corresponding x, y position distribution is displayed as a his- togram with vertical markers representing the goal position. The position of the goal is moved to a new location within the arena every few hundred timesteps to study the effects of dynamic control and the overshoot behaviour discussed earlier. • Model parameters: Nα = 30, Nγ = 6, Lxy = 15 - http://www.youtube.com/watch?v=8kfd6xHElZI Control mechanism achieves fairly stable control within the simulation arena. Occasionally a large cluster of agents is ‘lost’ only to be quickly corralled back by controllers. • Model parameters: Nα = 500, Nγ = 10, Lxy = 30 - http://www.youtube.com/watch?v=FJqU06b3eMs Agents rapidly coalesce into a large cluster, aided by controllers steering agents towards the central goal position. Convergence towards a new goal position is rapid and coherent, with only minor disruptions of the large cluster by control agents. Given the high density of agents, outlying agents are quickly located by controllers and manoeuvred towards the main cluster at the goal. Note that controllers need only to interact briefly with α-agents in order to direct them towards the goal. • Model parameters: Nα = 500, Nγ = 5, Lxy = 30 - http://www.youtube.com/watch?v=qRmTAHl89rM Agents coalesce from their initial distribution, however taking much longer to merge into a single large cluster than in the previous example with frequent cluster fracturing observed. Reaction to the controllers is still fast, however clusters of agents now overshoot the goal position more often as the lower controller density struggles to maintain stability around the target. Here we see an example where the inertia of multiple clusters is too high to be well controlled by too few controllers near the goal position. • Model parameters: Nα = 500, Nγ = 2, Lxy = 30 - http://www.youtube.com/watch?v=xmAc3qJO34I 29
  • 40. 5.3 Control validation As before, agents rapidly form multiple large clusters, this time remaining distinct throughout the entire simulation. Controllers effectively direct encountered clusters towards the goal position, however the disturbances provoked by controllers are poorly contained as due to insufficient con- troller density. Agent clusters therefore either traverse the goal unrestrained, or miss the target entirely. • Model parameters: Nα = 500, Nγ = 10, Lxy = 60 - http://www.youtube.com/watch?v=icGujj9xFgM Controller density is high enough in this larger simulation arena, to maintain the agent population tightly bound in a single cluster. After a period of ‘sweeping’ the simulation arena for outliers, the large cluster is controlled with reasonable stability at the various goal positions. Although agent dispersal by controllers is fairly pronounced, sufficient numbers of controllers are available to regroup the agents and direct them towards the goal. • Model parameters: Nα = 500, Nγ = 5, Lxy = 60 - http://www.youtube.com/watch?v=0ywTaQtZPWQ In this example we see very similar behaviour to the previous evolution, however the control density is not sufficient to maintain a single large cluster. The motion of the resulting clusters is neither controlled efficiently enough, nor fast moving enough to reach the goal target before it is moved to a new location. Please note that the URLs above link to videos hosted on YouTube and are therefore subject to change. If the links become inactive then alternative access to the animations can be provided by the author. 30
  • 41. Coarse-grained multiscale analysis 6 Coarse-grained multiscale analysis 6.1 The Equation-free method Having already introduced the basic concepts of the Equation-Free method and our motivation in section 2.3, we now address the core elements of this computational framework, enabling a coarse-grained de- scription of the agent-based model. A more complete description of the methods outlined in this section can be found in the literature [18], including a recent review of Equation-Free methods by the original authors [19] and specific applications to agent-based models [39]. The primary tool of the Equation-Free framework is the coarse timestepper which evolves a macroscopic model of the system through a single coarse-timestep. The application of the following methods relies on the assumption that a description of the micro-scale model, in this case the agent-based model describ- ing the micro dynamics of our controlled system, can be sufficiently described by a reduced number of ‘coarse-grained’ variables, or macro-observables. Using this approach our goal is to obtain a description of a coarse-grained model of the micro-dynamics, which may exist conceptually however is unavailable in closed form. Upon finding a correct form of the closure via the coarse timestepper, we able to bridge the gap between the micro-level description, the fine-scale simulations developed in the previous chapters, and a coarse system-level description. This coarse-graining enables us to deploy the traditional inventory of numerical techniques, for example coarse-grained bifurcation analysis and optimisation routines. Given an initial coarse-grained initial condition X at time t, i.e. U(X, t), the coarse timestepper imple- ments a single macro timestep using a three step procedure: 1. Lifting - the transformation of a coarse-grained initial conditions via a lifting operator ψ, initial- ising a set of micro-level ensembles u(x, t) with consistent coarse-grained observables: u(x, t) = ψU(X, t) (30) where x, x ∈ Dm and t are fine-scale variables, X ∈ DM are coarse-grained variables. 2. Micro-simulation - the evolution of the micro-scale dynamics of each independent realisation of the ensemble, outputting the values of the fine-scale variables x after a short macroscopic time step δt - the time horizon. Given a single timestep micro-evolution fs: u(x, t + dt) = fs[u(x, t), dt] (31) we perform fine-scale simulations, evolved over the period of the time horizon δt: u(x, t) at t ∈ [t, t + δt] (32) where the time horizon δt consisting of k fine-scale timesteps dt, i.e. δt = kdt. 3. Restriction - compute the averaged coarse-grained variables corresponding to the fine-scale vari- ables of the microscopic ensemble, via a restriction operator M - obtaining the new coarse-grained state from: U(X, t) = Mu(x, t) (33) 31
  • 42. 6.2 Selection of coarse-grained observables Figure 15: Schematic of the coarse timestepper, taken from [19]. IC: initial condition, ABMs: agent- based models, PDE: partial differential equation Implementing this full procedure produces a coarse-timestepper FS operating on the coarse-grained description to evolve a macro-scale system through one time horizon, i.e. U(X, t + δt) according to: FS[U(X, t), δt] = M(Fk s {ψ[U(X, t], dt}) (34) The formulation of the coarse timestepper in (34) uses the underlying micro-level simulations and coarse- grained initial conditions, to provide a map or function FS which outputting the results of an evolution over a given time horizon δt. At this point we can now consider the standard array of analytical techniques ‘wrapped’ around the coarse function which now encapsulates and provides a closure to the micro-dynamics of an ensemble of simulations. These outer solvers may include PDE based methods, and the Newton-Broyden root finding method described later on. The main concepts of the coarse timestepper are neatly described in the schematic in figure 15. 6.2 Selection of coarse-grained observables A central assumption of the coarse timestepper is that there exists a closed form solution, or master equation, describing the dynamics of the associated coarse-grained model. The coarse timestepper is a function FS or map, providing this closure ‘on-demand’ by restricting the model using a relatively small subset of coarse-grained variables, corresponding to specific system level observables. The correct choice of the coarse-variables is crucial; ideally consisting of a few low-order moments of the micro-level sys- tem. Effective closure therefore depends on higher-order moments of the microscopic dynamics rapidly becoming functionals of the fewer, lower-order moments [19]. Before proceeding with a multiscale analysis using the coarse timestepper, we must therefore choose an appropriate set of observables that can be computed given evolved states of the (micro-scale) agent based model. For the current investigation we consider the same two variables already used to in the previous chapter to analyse the effects of control: the global centre of mass µcm, and the associated standard deviation σcm, representing the first and second order moments of the α-species agent population subset α ⊂ V {Vi, i = Nγ + 1, ..., N}: 32