Upload
daniel-martin-katz
View
1.429
Download
5
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
Daniel Martin KatzMichigan State University
College of Law
Introduction to Computing for Complex Systems
(Lab Session 5)
Simple Birth Rates
Simple Birth Rates
Simple Birth Rates
Simple Birth Rates
take a few minutes and play around with the model
consider the questions offered above
Thinking Conceptually:Simple Birth Rates
What Does the Turtle Movement Add to the Model?
Are Turtles Added to the Model? and If So How?
Are Turtles Removed from the Model? and If So How?
Simple Birth Rates:Exploring the Code
Simple Birth Rates
Experiment
Basic Setup
Simple Birth Rates
Death
Plots
Reproduction
Movement
Simple Birth Rates
“To Setup” Procedures
Simple Birth Rates
“To Go” Procedures
Simple Birth Rates
Turtle Movement Procedures
Simple Birth Rates
PleaseReview “ifelse”
How does it work?
Simple Birth Rates
Take a Look at the
Reproduction Procedures
Simple Birth Rates
Death Procedures
Plot Procedures
Step 1: map the dependancies
Step 2: learn the syntax and functionality for all unknown primitives
Step 3: read each line of code and determine what it doing
Simple Birth Rates
Step 4: sketch a procedures map that follows the chronology of your program
At this point it is more Important for you to go though the models line by line on your own using
the above protocol
Wolf-Sheep Predation
The Lotka-Volterra Equation is Traditional Approach to this Question is Differential Equation
Classic Predator-Prey
Question to answer ... what do we learn through the Agent Based Implementation that is not captured the standard approach?
Wolf-Sheep Predation
Wolf-Sheep Predation
A Mini Eco-System Model
Sheep rely on Grass
Wolf rely upon Sheep
Implicitly Wolf rely upon grass
Wolf-Sheep Predation
Set Different Starting Values for Sheep
Return Rates for Food Can Differ
There are Birth Rates for Grass, Sheep, Wolves
Wolf-Sheep Predation
Lots ofParameters
Grassswitcher
Shows how close an agent is to death
Plots are Useful for observing model stability
Wolf-Sheep Predation
Wolf-Sheep Predation
Wolf-Sheep Predation
Relies upon a number of different rules that we have seen in prior models
reproduction rule
death rule
different initial conditions
spatial movement around the landscape
etc.
Wolf-Sheep Predation
This is default settings with grass on
What is happening in the model?
Wolf-Sheep Predation
What is happening in the model?
Changed 1 parameter “sheep gain from food” (From 4 to 8)
Wolf-Sheep Predation
Notice the difference in the 4 model runs
Changed 1 extra parameter “wolf gain from food”Still “sheep gain from food” (From 4 to 8)Now also “wolf gain from food” (From 20 to 40)
Wolf-Sheep Predation
Wolf Sheep is more of an agent based model
remember in simple birth rates there was a system level carrying capacity
Here we keep track of individual turtles and they can die based upon individual values
And of course individual spatial interactions
Sheep vs. Grass
wolf v. sheep
Wolf-Sheep Predation
You can observe these interactions and the declining energy counts
mr. wolfbetter get some food
Wolf-Sheep Predation
This energy count might useful in a number of models
Simulated Market where “energy” could become money, etc.
Agents could make various cost / benefit calculations as they undertake a given action
Those agents need not make the “optimal” choice(i.e. they could have cognitive biases, etc. and you could write those into the model)
Novel Recombinations of Code
We are trying to show a set of models with useful features
to your substantive question(s) of interest
Then you can develop various novel combinations of these and other models
Recycle & Reuse Code
You should re-use as much code as possible
also, a code “scrapyard” from which you might acquire parts to fix your model
Lots of Code Examples in existing models
Lots of Code Examples online
Getting to the Code “Scrapyard”
Some Examples From The Code “Scrapyard”
The Flocking Model
Scale-free correlations in starling flocksAndrea Cavagnaa,b,1, Alessio Cimarellib, Irene Giardinaa,b,1, Giorgio Parisib,c,d,1, Raffaele Santagatib, Fabio Stefaninib,2,and Massimiliano Vialea,b
aIstituto dei Sistemi Complessi, Consiglio Nazionale delle Ricerche, 00185 Rome, Italy; bDipartimento di Fisica, Università di Roma “La Sapienza”, 00185 Rome,Italy; cSezione Istituto Nazionale di Fisica Nucleare, Università di Roma “La Sapienza”, 00185 Rome, Italy; and dUnità Organizzativa di Supporto di Roma,Istituto per i Processi Chimico-Fisici, Consiglio Nazionale delle Ricerche, 00185 Rome, Italy
Contributed by Giorgio Parisi, May 11, 2010 (sent for review December 6, 2009)
From bird flocks to fish schools, animal groups often seem to reactto environmental perturbations as if of one mind. Most studies incollective animal behavior have aimed to understand how a glob-ally ordered state may emerge from simple behavioral rules. Lesseffort has been devoted to understanding the origin of collectiveresponse, namely the way the group as a whole reacts to its envi-ronment. Yet, in the presence of strong predatory pressure on thegroup, collective response may yield a significant adaptive advan-tage. Here we suggest that collective response in animal groupsmay be achieved through scale-free behavioral correlations. Byreconstructing the 3D position and velocity of individual birds inlarge flocks of starlings, we measured to what extent the velocityfluctuations of different birds are correlated to each other. Wefound that the range of such spatial correlation does not havea constant value, but it scales with the linear size of the flock. Thisresult indicates that behavioral correlations are scale free: Thechange in the behavioral state of one animal affects and is affectedby that of all other animals in the group, no matter how large thegroup is. Scale-free correlations provide each animal with aneffective perception range much larger than the direct interindivid-ual interaction range, thus enhancing global response to perturba-tions. Our results suggest that flocks behave as critical systems,poised to respond maximally to environmental perturbations.
animal groups | collective behavior | flocking | self-organization |emergent behavior
Of all distinctive traits of collective animal behavior the mostconspicuous is the emergence of global order, namely the
fact that all individuals within the group synchronize to someextent their behavioral state (1–3). In many cases global orderingamounts to an alignment of the individual directions of motion, asin bird flocks, fish schools, mammal herds, and in some insectswarms (4–6). Yet, global ordering can affect also other behav-ioral states, as it happens with the synchronous flashing of tropicalfireflies (7) or the synchronous clapping in human crowds (8).The presence of order within an animal group is easy to detect.
However, order may have radically different origins, and dis-covering what is the underlying coordination mechanism is notstraightforward. Order can be the effect of a top–down central-ized control mechanism (for example, due to the presence of oneor more leaders), or it can be a bottom–up self-organized featureemerging from local behavioral rules (9). In reality, the lines areoften blurred and hierarchical and distributed control maycombine together (10). However, even in the two extreme cases,discriminating between the two types of global ordering is nottrivial. In fact, the prominent difference between the centralizedand the self-organized paradigm is not order, but response.Collective response is the way a group as a whole reacts to its
environment. It is often crucial for a group, or for subsets of it, torespond coherently to perturbations. For gregarious animalsunder strong predatory pressure, in particular, collective re-sponse is vital (2, 11, 12). The remarkable thing about a flock ofbirds is not merely the globally ordered motion of the group, butthe way the flock dodges a falcon’s attack. Collective response isthe trademark of self-organized order as opposed to a central-ized one. Consider a group where all individuals follow a leader,
without interacting with one another. Such a system is stronglyordered, as everyone moves in the same direction. Yet, there isno passing of information from individual to individual andhence behavioral fluctuations are independent: The change ofdirection of one animal (different from the leader) has very littleinfluence on that of other animals, due to the centralized natureof information transfer. As a consequence, collective response isvery poor: Unless detected directly by the leader, an externalperturbation does not elicit a global reaction by the group. Re-sponse, unlike order, is the real signature of self-organization.In self-organized groups the efficiency of collective response
depends on the way individual behavioral changes, typicallyforced by localized environmental perturbations, succeed inmodifying the behavior of the whole group. This key process isruled by behavioral correlations. Correlation is the expression ofan indirect information transfer mediated by the direct in-teraction between the individuals: Two animals that are outsidetheir range of direct interaction (be it visual, acoustic, hydrody-namic, or any other) may still be correlated if information istransferred from one to another through the intermediateinteracting animals. The turn of one bird attacked by a predatorhas an influence not only over the neighbors directly interactingwith it, but also over all birds that are correlated to it. Correla-tion measures how the behavioral changes of one animal in-fluence those of other animals across the group. Behavioralcorrelations are therefore ultimately responsible for the group’sability to respond collectively to its environment. In the sameway, correlations are likely to play a fundamental role in otherkinds of collective decision-making processes where informedindividuals (e.g., on food location or migration routes) can ex-tend their influence over many other group members (10).Of course, behavioral correlations are the product of in-
terindividual interaction. Yet interaction and correlation are dif-ferent things and they may have a different spatial (and sometimestemporal) span. Interaction is local in space and its range is typ-ically quite short. A former study (13) shows that in bird flocks theinteraction range is of the order of few individuals. On the otherhand, the correlation length, namely the spatial span of the cor-relation, can be significantly larger than the interaction range,depending chiefly on the level of noise in the system. An ele-mentary example is the game of telephone: A player whispersa phrase into her neighbor’s ear. The neighbor passes on themessage to the next player and so on. The direct interaction rangeis equal to one, whereas the correlation length, i.e., the number of
Author contributions:A. Cavagna, I.G., andG.P. designed research;A. Cavagna,A. Cimarelli,I.G., R.S., F.S., and M.V. performed research; A. Cavagna, I.G., F.S., and M.V. contributednewreagents/analytic tools;A. Cavagna,A.Cimarelli, I.G.,G.P., F.S., andM.V. analyzeddata;and A. Cavagna wrote the paper.
The authors declare no conflict of interest.
Freely available online through the PNAS open access option.1To whom correspondence may be addressed. E-mail: [email protected],[email protected], or [email protected].
2Present address: Institut für Neuroinformatik, Universität Zürich, Winterthurerstrasse190, CH-8057 Zurich, Switzerland.
This article contains supporting information online at www.pnas.org/lookup/suppl/doi:10.1073/pnas.1005766107/-/DCSupplemental.
www.pnas.org/cgi/doi/10.1073/pnas.1005766107 PNAS | June 29, 2010 | vol. 107 | no. 26 | 11865–11870
ECOLO
GY June 29, 2010 Issue
Flocking is still an active areaof research
This is a really interesting paper
Jing Han, Ming Li & Lei Guo
“soft control on collective behavior of a group of
autonomous Agents by a shill agent”
arX
iv:1
007.0
803v1 [c
s.M
A]
6 J
ul
2010
PUBLISHED IN JOURNAL OF SYSTEMS SCIENCE AND COMPLEXITY, 2006(19):54-62 1
Soft Control on Collective Behavior of a
Group of Autonomous Agents by a Shill Agent
Jing Han, Ming Li and Lei Guo
Abstract
This paper asks a new question: how can we control the collective behavior of self-organized multi-
agent systems? We try to answer the question by proposing a new notion called ‘Soft Control’, which
keeps the local rule of the existing agents in the system. We show the feasibility of soft control by
a case study. Consider the simple but typical distributed multi-agent model proposed by Vicsek et al.
for flocking of birds: each agent moves with the same speed but with different headings which are
updated using a local rule based on the average of its own heading and the headings of its neighbors.
Most studies of this model are about the self-organized collective behavior, such as synchronization of
headings. We want to intervene in the collective behavior (headings) of the group by soft control. A
specified method is to add a special agent, called a ‘Shill’, which can be controlled by us but is treated
as an ordinary agent by other agents. We construct a control law for the shill so that it can synchronize
the whole group to an objective heading. This control law is proved to be effective analytically and
numerically. Note that soft control is different from the approach of distributed control. It is a natural
way to intervene in the distributed systems. It may bring out many interesting issues and challenges on
the control of complex systems.
Index Terms
Collective Behavior, Multi-agent System, Soft Control, Boid Model, Shill Agent
This work was supported by the National Natural Science Foundation of China.
Jing Han and Lei Guo are with the Institute of Systems Science, AMSS, Chinese Academy of Sciences, Beijing,
100080, China. Ming Li is with the Institute of Theoretical Physics, Chinese Academy of Sciences. Corresponding author:
Thanks to John Holland For Suggesting it
The Flocking Model
The Flocking Model
The Flocking Model
Take a few minutes and explore the model including these questions
The Flocking Model
The Flocking Model
The Flocking ModelWhat is “Population”?
It is a variable on the slider
What is happening in the “To Setup”?
create population
set turtles to random shades of yellow
set the size to 1.5
start with random x,y heading coordinates
clear all
ask turtles [flock]
The Flocking Model
(We will get to [flock] in just a moment)
to understand how “display” helps the interface
remove it from code and then re-run the model interface
notice it is giving the model the smooth movement
The Flocking Model
What is [ask turtles [FD 0.2]?
Turtles are moving FD .2
Immediately Updated using the “display” command
.2 x (repeat 5) = 1this is the same as [ fd 1]
then the model “ticks” forward and does not stop until button is turned off
The Flocking Model
back to ask turtles [flock] which is used in the “to go”
“to flock” gateway to balance of the model
The Flocking Model
flockmates = turtles-own agentset of nearby turtles
We use the “Set” Command to assign it a value
“Set” to an agentset of “other turtles in-radius vision”
What is“other turtles
in-radius vision”?
Other = All Turtles in Radius Except for the Calling Turtle
Radius = Allows for an agentset that is defined by distance
from a calling agent
Vision = parameter value that was set
on the slider
It is going to use an “if” springing condition
If no flockmates than it is go ing to t ick the model forward (rinse and repeat)
If it does find a flockmate than notice there is also an “ifelse” within the “if”
“To Flock” Procedure
“find-nearest-neighbor”
First how does it do the “find-nearest-neighbor”?
it has to “set” a value for this
looks within the “flockmates” and selects “min one of” “flockmates” relative to distance from myself
“min-one-of” handles ties by selecting at random
remember “ifelse” sets up two possible conditions ...
the “ifelse” split in the road
Take a look at how it is split up
Notice the brackets
If Condition is satisfied than [ separate ]
If Condition is not satisfied (i.e. else) [ align cohere]
Cohere, Align & Separate
If Condition is satisfied than [ separate ]
If Condition is not satisfied (i.e. else) [ align cohere]
Please Review the Cohere, align & Separate Procedures on your own
Cohere, Align & Separate
relies upon other procedures as shown above
= slider variable= nested procedure
The Hawk/Dove Model
http://ccl.northwestern.edu/netlogo/models/community/
The Hawk/Dove Model
In the Community Models it is called “game theory”
http://ccl.northwestern.edu/netlogo/models/community/
Download the “gametheory.nlogo” file and save it to the desktop or to a folder of your choosing
The Hawk/Dove Model
Easiest Thing is to simultaneously install 3.1.5 along with Netlogo 4.1
Current Version of “gametheory” is Implemented in Netlogo 3.1.5
you should be able run netlogo 3.1.5 and 4.1 on the same machine
If you do not already have netlogo 3.1.5 as well as 4.1 --- please install it on your machine
How to Acquire Netlogo 3.1.5
http://ccl.northwestern.edu/netlogo/download.shtml
The Hawk/Dove Model
After Installing, Open Version 3.1.5 on your desktop
From within 3.1.5 File ---> Open
Find the “gametheory.nlogo” file and open it from within netlogo version 3.1.5
(If necessary close any open version of netlogo 4.1)
The Hawk/Dove Model
the interface is slightly different and some of the syntax is slightly different
The Hawk/Dove Model
The Hawk/Dove Model
The Hawk/Dove Model
Can you identify instances where the “retaliator” behavioral strategy does not win out?
Parameter Sweeps?Thinking about “parameter sweeps”
We would like to be able to evaluate all possible parameter values with all possible parameter values
100 doves
100 hawks
100 retaliators
10 values
10 costs
100 reproduce-thresholds
100 init-energies
100 energy-time-thresholds
x at least say 50 values
per parameter configuration to get some sort of
a statistical distribution
100,000,000,000,000
Even with some of Netlogo’s Parallelization, this is going to be hard -- here is why
Parameter Sweeps?
Perhaps we do not have to search the full space
perhaps we can grid the analysis and interpolate between the spaces
Even for a limited incursion into the space, we need to think about form of automation