A apresentação está carregando. Por favor, espere

A apresentação está carregando. Por favor, espere

Agent-based models and social simulation Gilberto Câmara Tiago Carneiro Pedro Andrade Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial.

Apresentações semelhantes


Apresentação em tema: "Agent-based models and social simulation Gilberto Câmara Tiago Carneiro Pedro Andrade Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial."— Transcrição da apresentação:

1 Agent-based models and social simulation Gilberto Câmara Tiago Carneiro Pedro Andrade Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial ̶̶̶̶ Share Alike http://creativecommons.org/licenses/by-nc-sa/2.5/

2 Where does this image come from?

3 Map of the web (Barabasi) (could be brain connections)

4 Information flows in Nature Ant colonies live in a chemical world

5 Conections and flows are universal Yeast proteins (Barabasi and Boneabau, SciAm, 2003) Scientists in Silicon Valley (Fleming and Marx, Calif Mngt Rew, 2006)

6 Information flows in the brain Neurons transmit electrical information, which generate conscience and emotions

7 Information flows generate cooperation White cells attact a cancer cell (cooperative activity) Foto: National Cancer Institute, EUA http://visualsonline.cancer.gov/

8 Information flows in planet Earth Mass and energy transfer between points in the planet

9 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?

10 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.

11 What are complex adaptive systems?

12 Universal Computing Computing studies information flows in natural systems......and how to represent and work with information flows in artificial systems

13 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.

14 Agent-Based Modelling Goal Environment Representations Communication Action Perception Communication Gilbert, 2003

15 Agents: autonomy, flexibility, interaction Synchronization of fireflies

16 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)

17 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)

18 It has been used in different areas of science economy sociology archaeology ecology linguistics political sciences...

19 Source: http://www.leggmason.com/thoughtleaderforum/2004/conference/transcripts/arthur_trans.asp

20 Agents changing the landscape An individual, household, or institution that takes specific actions according to its own decision rules which drive land-cover change.

21 Four types of agents Natural agents, artificial environment Artificial agents, artificial environment Artificial agents, natural environment Natural Agents, natural environment fonte: Helen Couclelis (UCSB)

22 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 Behavioral Experiments Descriptive Model

23 Is computer science universal? Modelling information flows in nature is computer science http://www.red3d.com/cwr/boids/

24 Bird Flocking (Reynolds) Example of a computational model 1. No central autority 2. Each bird reacts to its neighbor 3. Model based on bottom up interactions http://www.red3d.com/cwr/boids/

25 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

26 Agents moving

27

28

29 Schelling segregation model

30 Segregation Some studies show that most people prefer to live in a non-segregated society. Why there is so much segregation?

31 Segregation Segregation is an outcome of individual choices But high levels of segregation indicate mean that people are prejudiced?

32 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

33 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

34 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 neighbours White cells change to black if there are X or more black neighbours Black cells change to white if there are X or more white neighbours How long will it take for a stable state to occur?

35 Schelling’s Model of Segregation Tolerance values above 30%: formation of ghettos

36 The Modified Majority Model for Segregation Include random individual variation Some individuals are more susceptible to their neighbours than others In general, white cells with five neighbours change to black, but: – Some “white” cells change to black if there are only four “black” neighbours – Some “white” cells change to black only if there are six “black” neighbours Variation of individual difference What happens in this case after 50 iterations and 500 iterations?

37 ABM in TerraME: Types and Functions

38 CellAgent forEachAgentforEachCell forEachRelative forEachNeighbor forEachAgent CellularSpace Society GroupTrajectory DBMS

39 Society 上海宋 ABC ACA AAC CCC BBC CBB CAC BBA CCB CBA AAA BAB

40 createAgent = function(capital) return Agent { capital = capital, --... } end data = {} data[1] = 100; data[2] = 50; data[3] = 25 mag = Society(createAgent, data) mag = Society(createAgent, 50) capital = 100capital = 50capital = 25 Society

41 CCC BBC CBB CAC BBA CCB CBA ABC ACA AAC AAA BAB Group

42 g = Group{mag, function(agent) return agent. capital > 40 end, function(a1, a2) return a1.capital > a2.capital end } capital = 100capital = 50capital = 25 Group

43 forEachAgent(mag, function(agent) agent.capital = agent.capital + 100 end) capital = 200capital = 150capital = 125 capital = 100capital = 50capital = 25 Traversing the Society

44 agents = cell:getAgents() if table.getn(agents) == 0 then -- empty agent:leave(oldcell) agent:enter(cell) end agents = cell:getAgents() if table.getn(agents) == 0 then -- empty agent:move(cell) end Agents within cells

45 Urban Growth in Latin American cities: exploring urban dynamics through agent-based simulation Joana Xavier Barros 2004

46 As cidades Latino-americanas Altas taxas de crescimento urbano (rápida urbanização) Pobreza + assentamentos espontâneos (favelas) Fraco controle das políticas públicas sobre o processo de desenvolvimento urbano Resultado espacial: tecido urbano fragmentado com padrões morfológicos diferentes e desconectados, que evoluem e se transformam ao longo do tempo.

47 Periferização São Paulo - Brasil Caracas - Venezuela Processo pelo qual a cidade cresce através da adição de assentamentos de baixa renda no anel periférico. Estas áreas são lentamente incorporadas à cidade pela expansão urbana, muitas vezes ocupadas por um grupo econômico mais alto, enquanto novos assentamentos de baixa renda continuam emergindo na periferia.

48 Crescimento urbano “Urban sprawl” nos Estados Unidos “Urban sprawl” na Europa (Inglaterra) Periferização na América Latina (Brasil)

49 Questões e metodologia Como esse processo acontece no espaço e no tempo?  DINÂMICA  modelagem e simulação  Como o espaço é moldado por decisões individuais?  Teoria da Complexidade  TEMPO + ESPAÇO  modelos autômatos celulares  Questões sociais  simulação baseada no agente ( agent-based simulation )

50 Simulador de Periferização  Reproduz o processo de expulsão e expansão simulando o processo de localização residencial de 3 grupos econômicos distintos.  Assume que apesar das diferenças econômicas, todos os agentes tem as mesmas preferências locacionais, ou seja, todos querem se localizar nas melhores áreas da cidade, que nas cidades latino-americanas Latina são as áreas de alta renda.  Todos os agentes tem as mesmas preferências mas restrições diferentes.

51 Módulo de Periferização  Agente alta renda – pode se localizar em qualquer lugar  Agente renda média – pode se localizar em qualquer lugar menos onde já existem agentes de alta renda  Agente renda baixa – só pode se localizar em lugares vazios Um agente pode ocupar a célula de outro agente e quando um agente é expulso ele procura outro lugar para se assentar.

52 Módulo de Periferização – exercícios de simulação Padrão espacial:  não existe nada nas regras que determine que o resultado espacial do modelo seja um padrão segregado ou que os agentes de renda alta se localizem no centro, rodeados por anéis de agentes de renda média e baixa.  o padrão se aproxima da estrutura espacial de localização residencial encontrada em cidades latino- americanas.  Sementes múltiplas como condição inicial – produz padrão com características de áreas metropolitanas.

53 Comparação com a realidade Mapas de distribuição de renda - São Paulo (Censo 2000) Mapas A and B: quantile breaks (3 and 6 ranges) Mapas C and D: natural breaks (3 and 6 ranges) Observação: Não trabalhamos com nenhum tipo de definição de grupos econômicos.

54 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. Cidade latino-americana 10 40 50 d = 3 steps = 2 steps2 = 4 steps3 = 2 decayStartPoint = 800 consolidationLimit = 600 Cidade EUA e Europa 40 50 10 d = 2 steps = 2 steps2 = 7 steps3 = 8 decayStartPoint = 400 consolidationLimit = 400

55 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.

56 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.

57 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 malha posição inicial dos agentes na célula-semente

58 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.

59 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.

60 Periferização no TerraME -- crie uma cidade (espaço celular) cidade = CellularSpace {xdim = TAMANHO, ydim = TAMANHO} -- define uma vizinhança 3x3 para o espaço celular createMooreNeighborhood(cidade, "1", false) -- preenche o espaço celular com celulas vazias iniciar (cidade) -- acha a celula central centro = Coord { x = TAMANHO/2, y = TAMANHO/2} celulaCentral = cidade:getCell(centro) -- cria uma sociedade de agentes populacao = Society(createAgent, POPULACAO) -- acha um lugar para cada agente na cidade forEachAgent(populacao, function(agent) acheLugar(agent) end)

61 Periferização no TerraME -- Parâmetros do modelo TAMANHO = 60 POPULACAO = TAMANHO*TAMANHO/2 VAGO = 0 POBRE = 1 REMEDIADO = 2 RICO = 3 PROP_RICO = 0.1 PROP_REMEDIADO = 0.4 PROP_POBRE = 0.5 ---- funcoes auxiliares function iniciar (cidade) forEachCell(cidade, function(cell) cell.ocupante = VAGO end ) end

62 Periferização no TerraME function createAgent() agent = Agent{ classe = geraClasse(), celula = celulaCentral } return agent End -- gera uma classe social para o agente function geraClasse() valor = math.random() if valor < PROP_POBRE then return POBRE elseif valor < PROP_POBRE + PROP_REMEDIADO then return REMEDIADO end return RICO end

63 Periferização no TerraME function acheLugar(agent) -- acha um lugar para morar achou_lugar = false repeat -- busca um lugar que gostaria de morar lugar = random_walk (agent) -- move o agente para o lugar que gostaria de morar agent.celula = lugar -- bate na porta e chama os moradores moradores = lugar:getAgents() -- verifica se tem alguem if getsize(moradores) == 0 then -- se nao tem ninguem, ocupa a celula agent:enter(lugar) lugar.ocupante = agent.classe achou_lugar = true else -- tem gente dono = moradores[1] achou_lugar = expulsa_morador (agent, dono, lugar) end until achou_lugar -- procura local para morar até achar end

64 Periferização no TerraME function random_walk (agent) -- ache um vizinho aleatorio numa vizinhança 3 x 3 vizinho = agent.celula:getNeighborhood():sample() -- ache o vizinho do vizinho vizinho2 = vizinho:getNeighborhood():sample() return vizinho2 end

65 Periferização no TerraME function expulsa_morador (agent, dono, lugar) -- compara a classe social do agente e do dono if (dono.classe == POBRE and (agent.classe == RICO or agent.classe == REMEDIADO)) or (dono.classe == REMEDIADO and agent.classe == RICO) then -- o morador sai da celula dono:leave(lugar) -- o agente entra na celula agent:enter(lugar) -- o status da celula muda lugar.ocupante = agent.classe -- o morador expulso procura outro lugar acheLugar(dono) -- indica que o agente achou um lugar para morar achou_lugar = true else achou_lugar = false -- nada feito end return achou_lugar end

66 Do it now!  Download all databases from the EXAMPLES available at www.terrame.orgwww.terrame.org  Put all the databases inside the c:\TerraME\database\  Download the models and make them run properly: – rain_drainage.lua – fire_spread-access.lua  Do the “try” commments inside the codes and explain the models’behavior


Carregar ppt "Agent-based models and social simulation Gilberto Câmara Tiago Carneiro Pedro Andrade Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial."

Apresentações semelhantes


Anúncios Google