This is an old revision of the document!

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-5 (Released on 29 September 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

$> terrame

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. ZeroBraneStudio/spec (there is already one with this name here, overwrite it)
terrame.lua Tells ZBS how to use TerraME. ZeroBraneStudio/interpreters
user.lua Tells ZBS where to find the TerraME interpreter. ZeroBraneStudio/cfg

The default installation directories for Zero Brane are:

  1. Windows: C:\ZeroBraneStudio\
  2. Mac: /Applications/
  3. Linux: /opt/zbstudio/

Checking if it was correctly configured

  1. 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'.
  2. Go to File menu, and click New
  3. In the main window (which is blank), write print(“hello”)
  4. Save the file with .lua extension in your computer
  5. You will see that the names print and “hello” will become colored
  6. Go to Project menu, in Lua Interpreter, select TerraME
  7. Click in the green icon with two triangles pointing to the right (Execute the current project/file)
  8. If everything went fine, you will get the following text in the Output box in the bottom of Zero Brane:
  9. Program 'terrame' started in [...]
    Program completed in [...] seconds [...]


Discussion List

(New) TerraME's discussion list is terrame at freelists dot org. To join it please click here.



Frequently asked questions are answered here. (New).


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.
  • gis: 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


  • LUCCME, an extension for top-down land change modeling.
  • INPE-EM, a framework to compute greenhouse gases emission estimates from land cover change


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:

Supporting Software

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!



cnpq-logo.jpg logo-fundo-amazonia.jpg


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


Locations of visitors to this page

QR Code
QR Code TerraME: Multiparadigm Modeling Toolkit (generated for current page)