Post on 18-Apr-2015
Agent-based models and social simulation
Gilberto CâmaraTiago CarneiroPedro Andrade
Licence: Creative Commons ���� By Attribution ���� Non Commercial ���� Share Alikehttp://creativecommons.org/licenses/by-nc-sa/2.5/
Where does this image come from?
Where does this image come from?
Map of the web (Barabasi) (could be brain connections)
Information flows in Nature
Ant colonies live in a chemical world
Conections and flows are universal
Yeast proteins(Barabasi and Boneabau,
SciAm, 2003)
Scientists in Silicon Valley(Fleming and Marx, Calif Mngt
Rew, 2006)
Information flows in the brain
Neurons transmit electrical information, which generate conscience and emotions
Information flows generate cooperation
White cells attact a cancer cell (cooperative activity)
Foto: National Cancer Institute, EUA http://visualsonline.cancer.gov/
Information flows in planet Earth
Mass and energy transfer between points in the planet
Complex adaptative systems
How come that a city with many inhabitants functions and exhibits patterns of regularity?
How come that an ecosystem with all its diverse species functions and exhibits patterns of regularity?
What are complex adaptive systems?
Systems composed of many interacting parts that evolve and adapt over time.
Organized behavior emerges from the simultaneous interactions of parts without any global plan.
What are complex adaptive systems?
Universal Computing
Computing studies information flows in natural systems...
...and how to represent and work with information flows in artificial systems
Agents as basis for complex systems
Agent: flexible, interacting and autonomous
An agent is any actor within an environment, any entity that can affect itself, the environment and other agents.
Agent-Based Modelling
Goal
Environment
Representations
Communication
ActionPerception
Communication
Gilbert, 2003
Agents: autonomy, flexibility, interaction
Synchronization of fireflies
Why is it interesting?
Structure structure is emergent from agent interaction this can be directly modeled
Agency agents have goals, beliefs and act this can be directly modeled
Dynamics things change, develop, evolve agents move (in space and social location) and learn these can be directly modeled
Source: (Gilbert, 2006)
Is it qualitative or quantitative?
Agent-based models can handle all types of data quantitative attributes
age size of organization
qualitative ordinal or categorical (e.g. ethnicity), relational (e.g. I am linked to him and her)
vague A sends B a message about one time in three
Source: (Gilbert, 2006)
It has been used in different areas of science
economy
sociology
archaeology
ecology
linguistics
political sciences
...
Source: http://www.leggmason.com/thoughtleaderforum/2004/conference/transcripts/arthur_trans.asp
Agents changing the landscape
An individual, household, or institution that takes specific actions according to its own decision rules which drive land-cover change.
Four types of agents
Natural agents, artificial environment
Artificial agents, artificial environment Artificial agents, natural environment
Natural Agents, natural environment
fonte: Helen Couclelis (UCSB)
Four types of agents
Natural agents, artificial environment
Artificial agents, artificial environment Artificial agents, natural environment
Natural Agents, natural environment
fonte: Helen Couclelis (UCSB)
e-science Engineering Applications
BehavioralExperiments
Descriptive Model
Is computer science universal?
Modelling information flows in nature is computer science
http://www.red3d.com/cwr/boids/
Bird Flocking (Reynolds)
Example of a computational model1. No central autority2. Each bird reacts to its neighbor3. Model based on bottom up
interactionshttp://www.red3d.com/cwr/boids/
Bird Flocking: Reynolds Model (1987)
www.red3d.com/cwr/boids/
Cohesion: steer to move toward the average position of local flockmates
Separation: steer to avoid crowding local flockmates
Alignment: steer towards the average heading of local flockmates
Agents moving
Agents moving
Agents moving
Schelling segregation model
Segregation
Some studies show that most people prefer to live in a non-segregated society. Why there is so much segregation?
SegregationSegregation is an outcome of individual choices
But high levels of segregation indicate mean that people are prejudiced?
Schelling’s Model of Segregation
< 1/3
Micro-level rules of the game
Stay if at least a third of neighbors are “kin”
Move to random location otherwise
Schelling’s Model of Segregation
Schelling (1971) demonstrates a theory to explain the persistence of racial segregation in an environment of growing tolerance
If individuals will tolerate racial diversity, but will not tolerate being in a minority in their locality, segregation will still be the equilibrium situation
Schelling Model for Segregation
Start with a CA with “white” and “black” cells (random)The new cell state is the state of the majority of the
cell’s Moore neighboursWhite cells change to black if there are X or more black
neighboursBlack cells change to white if there are X or more white
neighbours
How long will it take for a stable state to occur?
Schelling’s Model of Segregation
Tolerance values above 30%: formation of ghettos
ABM in TerraME:Types and Functions
Agen
t
Spa
ce
Space Agent
TerraME: nature-society modelling
T. Carneiro, P. Andrade, et al., “An extensible toolbox for modeling nature-society interactions”. Enviromental Modelling and Software, 2013 (Two PhDs).
Nature represented in cellular spaces, society represented as agents
Geometry
Cellular SpaceSocial Network
Object
Types in TerraLib ecosystem: new tools, new types
Coverage
Time Series Trajectory Event
Agent
2002
2010
2014
CellAgent
forEachAgent forEachCell
forEachCellforEachRelative forEachNeighbor
forEachAgent
CellularSpaceSociety
Group Trajectory
DBMS
agents = cell:getAgents()if #(agents) == 0 then -- empty agent:leave(oldcell) agent:enter(cell)end
Agents within cells
Society
上海宋ABC
ACA
AACCCC
BBC
CBB
CAC
BBA
CCB
CBA
AAA
BAB
createAgent = function(capital) return Agent { capital = capital, -- ... }end
data = {}data[1] = 100; data[2] = 50; data[3] = 25mag = Society(createAgent, data)
mag = Society(createAgent, 50)
capital = 100 capital = 50 capital = 25
Society
function createAgent (capital) person = Agent { init = function (self), -- ...
}end
data = {}data[1] = 100; data[2] = 50; data[3] = 25mag = Society(createAgent, data)
mag = Society(createAgent, 50)
capital = 100 capital = 50 capital = 25
Society
CCC
BBC
CBB
CAC
BBA
CCB
CBA
ABC
ACA
AAC
AAA
BAB
Group
g = Group{mag, function(agent) return agent. capital > 40 end, function(a1, a2) return a1.capital > a2.capital end}
capital = 100 capital = 50 capital = 25
Group
forEachAgent(mag, function(agent) agent.capital = agent.capital + 100end)
capital = 200 capital = 150 capital = 125
capital = 100 capital = 50 capital = 25
Traversing the Society
Emergence
source: (Bonabeau, 2002)
“Can you grow it?” (Epstein; Axtell; 1996)
Epstein (Generative Social Science)
If you didn´t grow it, you didn´t explain its generation
Agent-based model Generate a macro-structure
Agents = properties of each agent + rules of interaction
Target = macrostruture M that represents a plausible pattern in the real-world
Scientific method
Science proceeds by conjectures and refutations (Popper)
Explanation and Generative Sufficiency
Macrostructure
Spatial segregationBird flocking
Agent modelA1
Agent modelA2
Agent modelA3
?
Refutation
Conjectures
?
Explanation and Generative Sufficiency
Macrostructure
Occam´s razor:"entia non sunt multiplicanda praeter necessitatem", or
"entities should not be multiplied beyond necessity".
Agent modelA1
Agent modelA2
?
Explanation and Generative Sufficiency
Macrostructure
Popper´s view"We prefer simpler theories to more complex ones
because their empirical content is greater and because they are better testable"
Agent modelA1
Agent modelA2
?
Explanation and Generative Sufficiency
Macrostructure
Einstein´s rule:The supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of
experience"
"Theories should be as simple as possible, but no simpler.
Agent modelA1
Agent modelA2
?
Urban Growth in Latin American cities:exploring urban dynamics through agent-based simulation
Joana Xavier Barros
2004
Latin American cities
High rates of urban growth (rapid urbanization) Poverty + spontaneous settlements (slums) Poor control of public policies on urban development Fragmented urban fabric with different and disconnected
morphological patterns that evolve and transform over time.
Peripherization
São Paulo - Brasil Caracas - Venezuela
Process in which the city grows by the addition of low income ‐residential areas in the peripheral ring. These areas are slowly incorporated to the city by spatial expansion, occupied by a higher economic group while new low income settlements keep emerging on the periphery.‐ .
Urban growth
“Urban sprawl” in United States
“Urban sprawl”in Europe (UK)
Peripherization in Latin America
(Brazil)
Research question
How does this process happen in space and time?
How space is shaped by individual decisions? Complexity approachTime + Space automata model
Social issues agent‐based simulation)
Model: Growth of Latin American cities
Peripherisation module
Spontaneous settlements module
Inner city processes module
Spatial constraints module
Peripherization module
reproduces the process of expulsion and expansion by simulating the residential locational processes of 3 distinct economic groups.
assumes that despite the economic differences all agents have the same locational preferences. They all want to locate close to the best areas in the city which in Latin America means to be close to high‐income areas
all agents have the same preferences but different restrictions
Peripherization module: rules
1. proportion of agents per group is defined as a parameter2. high income agent –can locate anywhere ‐3. medium income agent –can locate anywhere except on high‐ ‐
income places4. low income agent –can locate only in the vacant space‐5. agents can occupy another agent’s cell: then the latter is
evicted and must find another
Peripherization module: rules
Peripherization module: rules
Spatial pattern:
the rules do not suggests that the spatial outcome of the model would be a segregated pattern
Approximates the spatial structure found in the residential locational pattern of Latin American cities
multiple initial seeds ‐resembles certain characteristics of metropolitan areas
Comparison with reality
Maps of income distribution for São Paulo, Brazil (census 2000)
Maps A and B: quantile breaks (3 and 6 ranges)
Maps C and D: natural breaks (3 and 6 ranges)
No definition of economic groups or social classes
Processos intra-urbanos – exercícios de simulação
Estudo comparativo entre dois padrões diferentes de desenvolvimento urbano: urban sprawl nas cidades dos EUA e Europa e o crescimento urbano das cidades latino-americanas.
Objetivo de testar hipóteses e teorias sobre processos intra-urbanos de transformação urbana em áreas residenciais e verificar a aplicabilidade dessas teorias para cidades de diferentes culturas.
1000 cells 2000 cells 3000 cells 4000 cells 5000 cells 6000 cells 7000 cells
Cidade latino-americana
10 40 50 d = 3steps = 2steps2 = 4
steps3 = 2decayStartPoint = 800consolidationLimit = 600
Cidade EUA e Europa
40 50 10 d = 2
steps = 2steps2 = 7
steps3 = 8decayStartPoint = 400
consolidationLimit = 400
Processos intra-urbanos – exercícios de simulação
Processos de filtragem, decadência do centro, e movimento das elites em direção ao anel periférico são de natureza semelhante em ambas cidades.
O padrão locacional espacial reverso parece ser causado por uma combinação de diferenças em grau em processos de natureza similar.
As diferenças na composição das sociedades urbanas de cada país parece exercer um grande impacto no resultado desses processos no padrão espacial urbano de localização residencial.
Módulo de Barreiras Espaciais
Introduz barreiras espaciais ao modelo de simulação Barreiras espaciais corpos de água, áreas com altas declividades, or
qualquer outra área onde a urbanização é impossível Implementação feita através da introdução de “áreas cinzas” como
condição inicial.
Agent’s rules: Agentes não se assentam ou caminham em sobre as áreas cinzas Para cada movimento que os agentes fazem em direção a uma nova célula, eles
checam se a nova posição é uma célula cinza ou não, e caso seja, eles retornam as suas posições iniciais e modificam suas direções para evitar que retornem para a mesma célula.
Exercícios com Barreiras Espaciais
Objetivo: testar os impactos das barreiras espaciais nas tendências de desenvolvimento espacial mostradas pelo modelo nos experimentos anteriores, e verificar como essas tendências podem ser relacionadas com a realidade. ]
Mostra como a simples introdução de áreas inatingíveis dentro da malha pode moldar o desenvolvimento espacial de maneiras tão diferentes.
Exercícios com Módulo de Periferização
posição inicial dos agentes no centro da malhaposição inicial dos agentes na célula-
semente
Exercícios com Barreiras Espaciais
Exercícios com Módulo de Processos Intra-urbanos
posição inicial dos agentes no centro da malha
posição inicial dos agentes na célula-semente
importância das barreiras espaciais para que a simulação produza um padrão mais realístico. o papel das barreiras espaciais para o entendimento da morfologia urbana.
Comparação com a realidade
Mapas of distribuição de renda para Porto Alegre.
(Censo 2000)
Mapas A e B: quantile breaks (3 and 6 ranges)
Mapas C e D: natural breaks (3 and 6 ranges)
Não trabalhamos com definição de grupos de renda.