An Introduction to TerraME Pedro Ribeiro de Andrade São José dos Campos, 2011 www.terrame.org.

Slides:



Advertisements
Similar presentations
Modelagem Baseada em Agentes no TerraME: estado atual Pedro Ribeiro de Andrade feb/09.
Advertisements

TerraME - A modeling Environment for non-isotropic and non-homogeneous spatial dynamic models development TIAGO GARCIA CARNEIRO ANA PAULA AGUIAR MARIA.
Algebraic Formalism over Maps João Pedro Cerveira Cordeiro Gilberto Câmara Ubirajara F. Moura Cláudio Barbosa Felipe Almeida GeoInformation Group Image.
Spatio-Temporal Database Constraints for Spatial Dynamic Simulation Bianca Maria Pedrosa Luiz Camolesi Júnior Gilberto Câmara Marina Teresa Pires Vieira.
Deforestation Part 2: Database Pedro R. Andrade São José dos Campos, 2013.
Modelling Human-Environment Interactions: Theories and Tools Gilberto Câmara Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial ̶̶̶̶ Share.
Components of GIS.
We now have a Geo-Linux. What’s next? Gilberto Câmara National Institute for Space Research (INPE), Brazil Institute for Geoinformatics, University of.
Modelling Human-Environment Interactions with TerraME Gilberto Câmara (INPE) Tiago Carneiro (UFOP) Pedro Andrade Neto (INPE) Licence: Creative Commons.
Spatial Data Analysis: Course Outline Ifgi, Muenster, Fall School 2005 Gilberto Câmara INPE, Brazil.
Cellular Automata (Reading: Chapter 10, Complexity: A Guided Tour)
CELLULAR AUTOMATA Derek Karssenberg, Utrecht University, the Netherlands LIFE (Conway)
Computational Modelling of Road Traffic SS Computational Project by David Clarke Supervisor Mauro Ferreira - Merging Two Roads into One As economies grow.
A Language to Support Spatial Dynamic Modeling Bianca Pedrosa, Gilberto Câmara, Frederico Fonseca, Tiago Carneiro, Ricardo Cartaxo Brazil’s National Institute.
Introduction to the course January 9, Points to Cover  What is GIS?  GIS and Geographic Information Science  Components of GIS Spatial data.
Introduction At the heart of the growth of a multi-cellular organism is the process of cellular division… … aka (in computing) self-replication.
Nawaf M Albadia Introduction. Components. Behavior & Characteristics. Classes & Rules. Grid Dimensions. Evolving Cellular Automata using Genetic.
Spatial Dynamical Modeling with TerraME Tiago Carneiro Gilberto Câmara.
Spatial Dynamical Modeling with TerraME Tiago Carneiro Gilberto Câmara Pedro Andrade Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial.
Parallelization: Conway’s Game of Life. Cellular automata: Important for science Biology – Mapping brain tumor growth Ecology – Interactions of species.
Complex Systems and Emergence Gilberto Câmara Tiago Carneiro Pedro Andrade.
Modelling Human-Environment Interactions: Theories and Tools Gilberto Câmara, Tiago Carneiro Pedro Andrade Vespucci Summer School, 2010 Licence: Creative.
Modelling Human-Environment Interactions: Theories and Tools Gilberto Câmara Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial ̶̶̶̶ Share.
How to include Human Actions in Earth System Science Modelling? Gilberto Câmara Earth System Science Centre, INPE Workshop.
Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara.
TIAGO GARCIA CARNEIRO ANA PAULA AGUIAR GILBERTO CÂMARA ANTÔNIO MIGUEL MONTEIRO TerraME - A tool for spatial dynamic modelling LUCC Workshop Amsterdam,
Collective Spatial Actions: Policy and Planning as Emergent Properties of Human Interactions Gilberto Câmara Earth System Science Center, INPE Licence:
More Accurate Rate Estimation CS 170: Computing for the Sciences and Mathematics.
Governor’s School for the Sciences Mathematics Day 13.
Beyond OGC Standards: The New Challenges for Open Source GIS Gilberto Câmara Director General, National Institute for Space Research (INPE) Brazil OGRS.
Course material – G. Tempesti Course material will generally be available the day before the lecture Includes.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
Land change modelling Gilberto Câmara, Pedro Andrade Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial ̶̶̶̶ Share Alike
The Game of Life A simulation of "life". From simple rules, complex behavior arises Rules –A cell that is alive and has fewer than two live neighbors dies.
Cellular Automata. The Game The Game of Life is not your typical computer game. It is a 'cellular automation', and was invented by the Cambridge mathematician.
Playing God: The Engineering of Functional Designs in the Game of Life Liban Mohamed Computer Systems Research Lab
Cellular Automata Spatio-Temporal Information for Society Münster, 2014.
Model Iteration Iteration means to repeat a process and is sometimes referred to as looping. In ModelBuilder, you can use iteration to cause the entire.
Cellular Automata. John von Neumann 1903 – 1957 “a Hungarian-American mathematician and polymath who made major contributions to a vast number of fields,
Case-Based Reasoning for Eliciting the Evolution of Geospatial Objects Joice Mota, Gilberto Camara, Isabel Escada, Olga Bittencourt, Leila Fonseca, Lúbia.
Databases and Global Environmental Change Gilberto Câmara Diretor, INPE.
Complex Systems and Emergence Gilberto Câmara Tiago Carneiro Pedro Andrade Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial ̶̶̶̶ Share.
An Agent Epidemic Model Toward a general model. Objectives n An epidemic is any attribute that is passed from one person to others in society è disease,
Pedro R. Andrade Münster, 2013
Introduction to Enviromental Modelling Lecture 1 – Basic Concepts Gilberto Câmara Tiago Carneiro Ana Paula Aguiar Sérgio Costa Pedro Andrade Neto.
Deforestation Part 3: Top-down Modelling Pedro R. Andrade São José dos Campos, 2013.
Week 9 - Monday.  What did we talk about last time?  Method practice  Lab 8.
Week 9 - Wednesday.  What did we talk about last time?  2D arrays  Queen attacking pawn example  Started Game of Life.
Modelos Hidrologicos: Runoff Pedro Ribeiro de Andrade Gilberto Camara.
Spatial Dynamical Modeling with TerraME Tiago Carneiro Gilberto Câmara Pedro Andrade Licence: Creative Commons ̶̶̶̶ By Attribution ̶̶̶̶ Non Commercial.
Lua for TerraME: A Short Introduction Pedro Ribeiro de Andrade Tiago G. S. Carneiro Gilberto Câmara Münster, 2014.
Modelagem Dinâmica com TerraME Aula 5 – Building simple models with TerraME Tiago Garcia de Senna Carneiro (UFOP) Gilberto Câmara (INPE)
Modelagem Dinâmica com TerraME: Aula 3 Interface entre TerraME e LUA Gilberto Câmara (INPE) Tiago Garcia de Senna Carneiro (UFOP)
Environmental Modeling Pedro Ribeiro de Andrade Münster, 2013.
Disciplina SER 301 Análise Espacial de Dados Geográficos Autômatos Celulares Líliam C. Castro Medeiros Raian Vargas Maretto
Pedro Ribeiro de Andrade Münster, 2013
Spatio-Temporal Information for Society Münster, 2014
Cellular Automata Pedro R. Andrade Tiago Garcia de Senna Carneiro
Pedro Ribeiro de Andrade Münster, 2013
Pedro R. Andrade Münster, 2013
Líliam César de Castro Medeiros,
Spatial Dynamical Modeling with TerraME
Análise Espacial de Dados Geográficos
Lua for TerraME: A Short Introduction
Deforestation Part 1: Database
Pedro Andrade Gilberto Câmara
Pedro R. Andrade Münster, 2013
Spatio-temporal information in society: cellular automata
Objective- To use an equation to graph the
Pedro R. Andrade Munster, 2013
Presentation transcript:

An Introduction to TerraME Pedro Ribeiro de Andrade São José dos Campos,

Cell Spaces Fonte: (Carneiro, 2006) Hipótese: Nenhuma abordagem sozinha é suficiente para representar a complexidade das interações sociedade-natureza TerraME: Ambiente Computacional Multi-paradigma para o Desenvolvimento de Modelos Integrados Natureza-Sociedade

 CCST-INPE  Pedro Andrade, Gilberto Camara, Raian Maretto  TerraLab/UFOP  Tiago Carneiro  DPI/OBT-INPE  Miguel Monteiro, Time TerraLib Desenvolvimento do TerraME

TerraME

Visualization (TerraView) Spatio-temporal Database (TerraLib) Modelling (TerraME) Data Mining(GeoDMA)Statistics (R interface) Software: Open source GIS

Spatial structure 1:32:00Mens :32:10Mens :38:07Mens :42:00Mens return value true 1. Get first pair 2. Execute the ACTION 3. Timer =EVENT 4. timeToHappen += period Temporal structure Newly implanted Deforesting Slowing down latency > 6 years Iddle Year of creation Deforestation = 100% Rules of behaviour Spatial relations Source: [Carneiro, 2006] TerraME: Components

 Lua classes using the constructor mechanism: Cell, CellularSpace, Neighborhood, Timer, Event, Legend  A CellularSpace is a multivalued set of Cells. It consists of a geographical area of interest, divided into regular or irregular objects.  Each Cell has a set of attributes.  CellularSpaces can be stored and retrieved from TerraLib databases if the modeler specify where the data is. TerraME extensions to Lua

Example 1: Random cellular space

Cellular Space in memory and forEachCell DEAD = 0 ALIVE = 1 cs = CellularSpace { xdim = 30, ydim = 20 } function random (cs) forEachCell (cs, function (cell) v = math.random() -- a value between 0 and 1 if v > 0.5 then cell.state = ALIVE else cell.state = DEAD end end) end random(cs)

Legend and Observer lifeLeg = Legend{ type = TYPES.NUMBER, groupingMode = GROUPING.UNIQUEVALUE, slices = 2, maximum = ALIVE, minimum = DEAD, colorBar1 = { {BLACK, DEAD}, {WHITE, ALIVE} }, } cs:createObserver(OBSERVERS.MAP, {"state"}, {lifeLeg}) cs:notifyObservers()

Example 2: Game of life

Synchronizing a CellularSpace  TerraME keeps two copies of a cellular space in memory: one stores the past values of the cells, and another stores the current (present) values of the cells.  The model equations must read the past copy and write the values to the present copy of the cellular space.  At the correct moment, it will be necessary to synchronize the past copy with the current values of the cellular space.

Game of life source code DEAD = 0 ALIVE = 1 TURNS = 400 function random (cs) forEachCell (cs, function (cell) v = math.random() -- a value between 0 and 1 if v > 0.5 then cell.state = ALIVE else cell.state = DEAD end end) end

Cellular Space and neighborhood cs = CellularSpace { xdim = 50 } random(cs) createMooreNeighborhood(cs, "1", false) function countAlive(cell) count = 0 forEachNeighbor(cell, function(cell, neigh) if neigh.past.state == ALIVE then count = count + 1 end end) return count end

Updating the cellular space function updateSpace(mycs) forEachCell(mycs, function(cell) n = countAlive(cell) -- cells with one or no neighbors die (loneliness). if n < 2 then cell.state = DEAD -- cells with four or more neighbors die (overpopulation). elseif n > 3 then cell.state = DEAD -- cells with two neighbors survive. elseif n == 2 then cell.state = cell.past.state -- cells with three neighbors become populated. elseif n == 3 then cell.state = ALIVE end end) end

Running and synchronizing lifeLeg = Legend{ type = TYPES.NUMBER, groupingMode = GROUPING.UNIQUEVALUE, slices = 2, maximum = ALIVE, minimum = DEAD, colorBar1 = { {BLACK, ALIVE}, {WHITE, DEAD} } cs:createObserver(OBSERVERS.MAP, {"state"}, {lifeLeg}) cs:notifyObservers() for i = 1,TURNS do cs:synchronize() updateSpace(cs) cs:notifyObservers() end

Example 3: Runoff rain Itacolomi do Itambé Peak Lobo’s Range

CellularSpace from database and neighborhood -- input and output data paths TERRAME_PATH = "e:\\Programas\\TerraME\\" INPUT_PATH = TERRAME_PATH.."Database\\" -- retrieve the cell space from the database csQ = CellularSpace{ database = INPUT_PATH.."cabecaDeBoi.mdb", theme = "cells", select = { "height", "soilWater" } } csQ:load() function filter(cell, neigh) if cell.height >= neigh.height then return true end return false end create3x3Neighborhood(csQ, filter)

Observers using two attributes heightLeg = Legend{ type = TYPES.NUMBER, groupingMode = GROUPING.EQUALSTEPS, slices = 50, maximum = 255, minimum = 0, colorBar1 = { {BLACK, 0}, {WHITE, 1} } soilWaterLeg = Legend{ type = TYPES.NUMBER, groupingMode = GROUPING.EQUALSTEPS, slices = 100, maximum = 200, minimum = 0, colorBar1 = { {WHITE, 0}, {BLUE, 200} } csQ:createObserver(OBSERVERS.MAP, {"soilWater", "height"}, {soilWaterLeg, heightLeg})

Rain and runoff RAIN = 4 -- rain/t MIN_HEIGHT = 200 function rain(cs) forEachCell(cs, function(cell) if ANYWHERE or (cell.height > MIN_HEIGHT) then cell.soilWater = cell.soilWater + RAIN end end) end function runoff(cs) cs:synchronize("soilWater") forEachCell(cs, function(cell) cell.soilWater = 0 end) forEachCell(cs, function(cell) countNeigh = cell:getNeighborhood():size() if countNeigh > 0 then soilWater = cell.past.soilWater / countNeigh forEachNeighbor(cell, function(cell, neigh) neigh.soilWater = neigh.soilWater + soilWater end) else cell.soilWater = cell.soilWater + cell.past.soilWater end end) end

Timer RAINING_TIME = 5 FINAL_TIME = 50 t = Timer{ Event{message = function(event) rain(csQ) if event:getTime() > RAINING_TIME then return false end end}, Event{message = function(event) runoff(csQ) end}, Event{priority = 5, message = function(event) csQ:notifyObservers() end} } t:execute(FINAL_TIME)

Large farm environments: 2500 m resolution Continuous variable: % deforested Two alternative neighborhood relations: connection through roads farm limits proximity Small farms environments: 500 m resolution Categorical variable: deforested or forest One neighborhood relation: connection through roads Different spatial resolutions

Generalized Proximity Matrices (GPM)

Models of Computation Agent based models Cellular automata models (Rosenschein and Kaelbling, 1995) (Wooldbridge, 1995) (von Neumann, 1966)(Minsky, 1967) (Aguiar et al, 2004) (Pedrosa et al, 2003) (Straatman et al, 2001)

Create pasture/ Deforest Speculator/ large/small bad land management money surplus Subsistence agriculture Diversify use Manage cattle Move towards the frontier Abandon/Sell the property Buy new land Settlement/ invaded land Sustainability path (alternative uses, technology) Sustainability path (technology) State machines

To Agent Cell a b a b c c Cell Agent From GPM as a graph

CellAgent forEachAgent forEachCell forEachRelativeforEachNeighbor forEachAgent CellularSpace Society GroupTrajectory DBMS Agent-based modelling relations

Prodes/INPE Nested environments

up-scaling Escala 1 Escala 2 pai filho down-scaling Nested environments

An Introduction to TerraME Pedro Ribeiro de Andrade São José dos Campos,