Modelagem Dinâmica com TerraME: A Gentle Introduction Dezembro/09 Pedro Ribeiro de Andrade...
Transcript of Modelagem Dinâmica com TerraME: A Gentle Introduction Dezembro/09 Pedro Ribeiro de Andrade...
Modelagem Dinâmicacom TerraME:
A Gentle Introduction
Dezembro/09
Pedro Ribeiro de AndradeDSA/CCST/INPEhttp://www.terrame.org
MotivaçãoÉ crescente a demanda por modelos dinâmicos que permitam a
avaliação e o prognóstico dos impactos causados por mudanças ambientais e que considerem de forma integrada fatores sociais, econômicos, hidrológicos, climáticos e ecológicos.– Projeto Land Use and Cover Change - LUCC– Projeto GEOMA
?Fonte: (Carneiro,
2006)
Processo cognitivo no qual os princípios de uma ou mais teorias são aplicados para se produzir um modelo de um determinado fenômeno, sistema ou processo real.
Desmatamento ?
Teoria de Modelagem
If (... ? ) then ...
Fonte: (Carneiro, 2006)
Causa e Efeito
rainrain rain
N
Itacolomi do ItambéPeak Lobo’s Range
Fonte: (Carneiro, 2006)
Área de estudo – ALAP BR 319 e entorno
ALAP BR 319Estradas pavimentadas em 2010Estradas não pavimentadasRios principais
Portos
new road
Data models but not process models
Geographic Information Systems (GIS)
Simulação Computacional
Caixa Preta
Variação de Temperatura
-40
-30
-20
-10
0
10
20
30
40
50
60
0 20 40 60 80 100
tempo (s)
gra
us
ce
ntí
gra
do
s
Entrada
Modelo1
Modelo2
Objetivo
Modelo3: 0,1
Modelo3: |f-o|/(|f|+|o|)
Source: (Carneiro, 2006)
TerraME:Terra Modelling Environment
Lua and the Web
Where is Lua?
• Inside Brazil– Petrobras, the Brazilian Oil Company– Embratel (the main telecommunication company
in Brazil)– many other companies
• Outside Brazil– Lua is used in hundreds of projects, both
commercial and academic– CGILua still in restricted use
• until recently all documentation was in Portuguese
TerraME Programming Language: Extension of LUALUA is the language of choice for computer games
[Ierusalimschy et al, 1996]source: the LUA team
Methodology: TerraME architecture & applications
Fonte: (Carneiro, 2006)
Basic concepts
The Earth’s environment …
can be represented as a synthetic environment…
… where analytical entities (rules) change the space properties in time.
Several interacting entities share the same spatiotemporal structure.Fonte: (Carneiro, 2006)
TerraME’s way: Modular components
Spatial structure
1:32:00 Mens. 11.
1:32:10 Mens. 32.
1:38:07 Mens. 23.
1:42:00 Mens.44.. . .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]
Source: (Aguiar, 2003;; Carneiro, 2006)
CellCellularSpaceTrajectoryNeighbourhoo
d
( , )
Space
Cellular Space
AnariCells = CellularSpace {dbType = "ADO",host = "localhost",database ="c:\\terralibDB\\mas_lucc.mdb",user = "",password = "",layer = "celulas_500_Anari_1985_pasto",theme = "celulas_500_Anari_1985_pasto",select = {"object_id", "cover", "owner“}
}
r = Trajectory{cellularspace, function(cell) return cell.height > 50 end, function(c1, c2) return c1.height > c2.height end}
( , )
Trajectory
Source: (Aguiar, 2003)
Which objects are closer?
Source: (Aguiar, 2003)
Which objects are closer?
Euclidean Spaces
Open Network Closed Network
GPM – strategies for building relations
GPM as a graphTo
Ag
en
t
Cell
a
b
a
b
c
c
Cell Agent
From
Vizinhança
createMooreNeighborhood(cs)cs:loadTerraLibGPM("name")cs:loadGALNeighborhood("file.gal")
Source: (Aguiar, 2003)
Behaviour
AgentAutomata
Fonte: (Carneiro, 2006)
Fonte: (Carneiro, 2006)
Desmatamento > 70%
recémImplantada
desflorestando
saturada
Latência > 6 anos
Evolução Desflorestamento - Fazenda
recessão
crescimento
normal
time = 1997
time = 1988
time = 1994
Sistema EconômicoHybridSituated
Behaviour – State Machines
State{id = "MoveDown", Jump{ function(event, agent) return input == "raise" end, target = "MoveUp" }, Jump{ function(event, agent) return gate.y == 0 end, target = "Closed" }, Flow{ function(event, agent) gate.y = gate.y - 9 if gate.y <= 0 then gate.y = 0 end end}}
State Machine
Temporal model
1:32:00 Mens. 11.
1:32:10 Mens. 32.
1:38:07 Mens. 23.
1:42:00 Mens.44.
Execute an agent over the cellular space regions
Save the spatial data
Draw cellular spaces and agents states
Carrie out the comunication between agents
. . .return value
true
1. Get first pair 2. Execute the ACTION
3. Timer =EVENT
4. timeToHappen += period
Fonte: (Carneiro, 2006)
time = Timer { Pair { Event{time = 1985, period = 1}, Message{ function(event) AgentRancher:execute(event) return 1 end} }, Pair { Event {time = 1988, period = 1}, Message { function(event) AgentSmall:execute(event) return 1 end} }}
Timer
myScale = Environment{ id = "MyScale", cs1 = CellularSpace{ ... }, -- ... csN = CellularSpace{ ... },
aut1 = Automata{ ... }, -- ... autN = Automata{ ... },
t1 = Timer{ ... }, -- ... tN = Timer{ ... },
sc1 = Environment{ ... }, -- ... scN = Environment{ ... },}
Environment
CellAgent
ForEachAgent ForEachCell
ForEachCellForEachNeighbor ForEachNeighbor
ForEachAgent
CellularSpaceSociety
Group Trajectory
DBMS
chuvachuva chuva
N
Pico do Itacolomido Itambé Serra do Lobo
Fonte: (Carneiro, 2006)
Autômatos Celulares
DRY WET
(soilWater > infCap) ?
(soilWater <= infCap) ?
Fonte: (Carneiro, 2006)
Simulationoutcome
fonte: Carneiro (2006)
STUDY AREA
Parque Nacional Serra das Emas
Fonte: (Almeida et al, 2008)
STUDY AREA
Dados de Entrada do Modelo
Fonte: (Almeida et al, 2008)
STUDY AREA
Propagação do Incêndio
Fonte: (Almeida et al, 2008)
Estimativa de Emissões por Desmatamento
Emissões de CO2 por Desmatamento de Floresta Primária na Amazônia e nos Estados (Modelo C1)
0
200
400
600
800
1000
1999 2000 2001 2002 2003 2004 2005 2006 2007 2008
Ano
Mto
nCO
2
Acre
Amapa
Amazonas
Maranha
Mato Grosso
Pará
Rondonia
Roraima
Tocantins
Amazonia
Fonte: (Aguiar et al, 2009)
Deforestation
Forest
Non-forest
Deforestation Map – 2000 (INPE/PRODES Project)
km
Projetos de Colonização
10
8
15
1614
13
Projetos antigosNovos projetosProjetos planejados
km
Projetos de Colonização
10
8
15
1614
13
Projetos antigosNovos projetosProjetos planejados
Projetos antigosNovos projetosProjetos planejados
Federal Government induced colonization area (since the 70’s):
Small, medium and large farms. Mosaic of land use patterns. Definition of land units and typology of actors
based on multi-temporal images (85-00) and colonization projects information (Escada, 2003).
Deforestation in Rondônia
Fonte: (Carneiro, 2006)
1985 to 1997
Source: adapted from (Carneiro, 2006)
Deforestation in Rondônia
BASELINE SCENARIO – Hot spots of change (1997 a 2020)
ALAP BR 319Estradas pavimentadas em 2010Estradas não pavimentadasRios principais
0.0 – 0.10.1 – 0.20.2 – 0.30.3 – 0.40.4 – 0.50.5 – 0.60.6 – 0.70.7 – 0.80.8 – 0.90.9 – 1.0
% mudança 1997 a 2020:
Fonte: (Aguiar, 2006)
GOVERNANCE SCENARIO – Differences from baseline scenario
ALAP BR 319Estradas pavimentadas em 2010Estradas não pavimentadasRios principais
0.0 -0.50Less:0.0 0.10More:
Differences:Protection areas
Sustainable areasFonte: (Aguiar, 2006)
STUDY AREA
São Félix do Xingu
Fonte: (Costa, 2009)
Landscape model: different rules of behavior at different partitions
Forest
Not ForestDeforest
River
FRONT
MIDDLE
BACK
SÃO FÉLIX DO XINGU - 1997
Observed deforestation in 1997
Fonte: (Costa, 2009)
Landscape model: different rules of behavior at different partitions which also change in time
FRENTE
MEIO
RETAGUARDA
Forest
Not ForestDeforest
River
FRONT
MIDDLE
BACK
SÃO FÉLIX DO XINGU - 2006
Observed deforestation in 2006
Fonte: (Costa, 2009)
Modeling results 97 to 2006
Observed 97 to 2006
Real Data
Simulation
Fonte: (Costa, 2009)
Modelagem Multi-Escala
Athmosphere, ocean, chemistry climate model (resolution 200 x 200
km)
Atmosphere only global climate model
(resolution 50 x 50 km)
Regional climate model(resolution 10 x 10 km)
Hydrology, VegetationSoil Topography (e.g, 1 x 1 km)
Regional land use changeSocio-economic changes
Adaptation (e.g., 100 x 100 m)
Fonte: (Camara, 2009)
Acoplamento de Modelos
Fonte: (Piribauer, 2009)
TerraME Hoje
• Versão 1.0 Beta prevista para fevereiro/2010• www.terrame.org • Extensão para acessar outros tipos de dados
(pontos, linhas, etc.) como células• TerraME-GIMS (Graphical Interface for Modeling
and Simulation)• TerraME-HPA (High Performance Architecture)• Dificuldade para visualizar dinamicamente os
resultados dos modelos