TerraME: Multiparadigm Modeling Toolkit
TerraME is a programming environment for spatial dynamical modelling. It supports cellular automata, agent-based models, and network models running in 2D cell spaces. TerraME provides an interface to TerraLib geographical database, allowing models direct access to geospatial data. Its modelling language has in-built functions that makes it easier to develop multi-scale and multi-paradigm models for environmental applications.
Two important innovations in TerraME are its use of anisotropic spaces and of hybrid automata models. Anisotropic spaces arise when modeling natural and human-related phenomena. For example, land settlers in a new area do not occupy all places at the same time. They follow roads and rivers, leading to an anisotropic pattern. Anisotropic spaces are implemented in TerraME using Generalized Proximity Matrices (GPM). The GPM is an extension of the usual definition of the spatial relations and include a combination of neighborhood measures in the absolute space and in the relative space.
A hybrid automaton is an abstract model for a system whose behavior has discrete and continuous parts. It extends the idea of finite automata to allow continuous change to take place between transitions. Adopting hybrid automata in spatial dynamical models allows complex models which include critical transitions.
A vision of research motivations and directions of Environmental Modelling in INPE is available in this presentation. An early presentation of our vision is How can GIScience contribute to Land Change Modelling?, the keynote speech at GIScience 2006. The rationale for the TerraME software is presented in the lecture Modelling human-environment interactions, presented in the Vespucci Summer School 2010.
The latest version of TerraME is 2.0-RC-1 (Released on 23 Mar 2017). It has installers for Windows and Mac and there is a compiled version for Linux.
In Windows, you can run TerraME by clicking in the icon on Desktop. In Mac and Linux, it is possible to run it by calling
using the command prompt. The graphical interface has options to run examples, configure and run models, see documentation, as well as download and install additional packages. There are links to the source code of the models as well as the examples in the documentation.
You can implement models in TerraME using any text file editor of your preference, such as Notepad++, Vim or Emacs. We currently suggest that you use ZeroBraneStudio as your programming environment to develop models in TerraME. After downloading and installing ZeroBraneStudio (ZBS), please execute the following steps:
Copy configuration files
Copy the three configuration files below to a directory within Zero Brane Studio installation directory.
|File||What it does||Copy to|
|lua.lua||Tells ZBS to highlight both Lua and TerraME keywords.||
|terrame.lua||Tells ZBS how to use TerraME.||
|user.lua||Tells ZBS where to find the TerraME interpreter.||
The default installation directories for Zero Brane are:
Checking if it was correctly configured
- If Zero Brain is running, close it and open again. In Linux, to execute TerraME properly, you must run 'zbstudio' from the command line, instead of clicking in the ZeroBrane icon. This will allow ZeroBrane to get your 'TME_PATH'.
- Go to
Filemenu, and click
- In the main window (which is blank), write
- Save the file with
.luaextension in your computer
- You will see that the names
“hello”will become colored
- Go to
Lua Interpreter, select
- Click in the green icon with two triangles pointing to the right (
Execute the current project/file)
- If everything went fine, you will get the following text in the
Outputbox in the bottom of Zero Brane:
Program 'terrame' started in [...] hello Program completed in [...] seconds [...]
(New) TerraME's discussion list is terrame at freelists dot org. To join it please click here.
You can execute a Google search in TerraME packages here. The two basic packages of TerraME that comes with its installation are:
- base: A package with the basic modelling concepts, such as Cell, CellularSpace, Agent, Timer, and Model.
- terralib: A package to handle geospatial data. It has types to manage TerraView projects as well as functions to create and fill cellular layers.
Using the graphical interface, it is possible to download and install packages from TerraME's repository. They are are:
- ca: Some cellular automata models.
- logo: Basic spatial agent-based models.
- sci: A small package with interpolation functions.
- sysdyn: Examples using system dynamics models.
Under development packages:
- calibration: Functions to run a given model several times, as well as metrics to compute goodness-of-fit and to calibrate models using genetic algorithms.
- gpm: Create geospatial data as well as neighbourhood files using connectivity networks such as roads.
- publish: Create webpages using the input as well as output of models.
- rstats: Integrate TerraME with R.
You can run examples directly in the graphical interface of TerraME. Click in the Desktop icon to open it in Windows or run “terrame” in the command line to open the graphical interface. From the graphical interface it is possible to see the documentation of each installed package.
- We use TerraME on our courses on Enviromental Modelling. We give regular graduate courses in the research programs in Earth System Science at INPE and Computer Science at UFOP.
Papers and reports
- Carneiro, T. G. S. ; Andrade, P. R. ; Câmara, G. ; Monteiro, A. M. V. ; Pereira, R. R. . An extensible toolbox for modeling nature-society interactions. Environmental Modelling & Software, 2013 (in press). DOI:10.1016/j.envsoft.2013.03.002.
- Silva, S. H. C. ; Carneiro, T. G. S. ; Lima, J.. TerraME HPA: Parallel Simulation of Multi-Agent Systems over SMP. ACM SIGSIM Conference on Principles of Advanced Discrete Simulation, 2013, Montreal.
- Rodrigues, A. J. C., Carneiro, T. G. S., Andrade, P. R.. TerraME Observer: An extensible real-time visualization pipeline for dynamic spatial models. XVIII Brazilian Symposium on Geoinformatics, Campos do Jordão, 2012.
- Evaldinólia Moreira, Sergio Costa, Ana Paula Aguiar, Gilberto Camara, Tiago Carneiro. Dynamical coupling of multiscale land change models,Landscape Ecology, 24(9), p. 1183-1194, 2009.
- Pedro Andrade, Antonio Miguel Monteiro, Gilberto Câmara, Sandra Sandri. Games on Cellular Spaces: How Mobility Affects Equilibrium.Journal of Artificial Societies and Social Simulation (JASSS), 12(1), p. 4, 2009.
- Tiago Carneiro, Gilberto Câmara, Raian Maretto. Irregular Cellular Spaces: Supporting Realistic Spatial Dynamic Modeling using Geographical Databases. X Brazilian Symposium on Geoinformatics, GeoInfo'08, Rio de Janeiro, 2008.
- Tiago Carneiro. Nested-CA: a foundation for multiscale modeling of land use and land change. PhD Thesis, INPE, 2006.
TerraView is a GIS application based on TerraLib, a library to handle vector and raster data using several data sources. TerraME currently works with TerraView 5.1.3.
The chief developers of TerraME are Pedro R. Andrade, from INPE, and Tiago Garcia de Senna Carneiro, from Federal University of Ouro Preto (UFOP). INPE's researchers involved in developing models using TerraME include Dr. Gilberto Camara, Dr. Antonio Miguel Monteiro, and Dr. Ana Paula Aguiar. The current development group is composed of:
- Rodrigo Avancini
- Antônio Oliveira Jr.
- Heitor Guerra
- João Chagas
- Pedro Henrique Costa
- Raphael Costa
Past contributors to TerraME include:
- Raian Vargas Maretto
- Sergio Souza Costa
The TerraME modelling language is an extension of the Lua programming language and interfaces to TerraLib GIS library for archival and retrieval of geospatial data. Many thanks to the Lua and TerraLib teams for providing such good environments to build upon!
TerraME has been developed as a joint effort among Earth System Science Center (CCST/INPE), TerraLab (Laboratory for Modelling and Simulation of Earth Systems), at Federal University of Ouro Preto, and Image Processing Division (DPI/INPE).