r-and-gama / gamar

An R interface to the GAMA platform (https://gama-platform.github.io)
https://r-and-gama.github.io/gamar
Other
13 stars 4 forks source link
agent-based-model agent-based-simulation gama gama-platform r

gamar

lifecycle CRAN\_Status\_Badge Travis build
status AppVeyor build
status codecov

gamar is an R interface to the GAMA agent-based simulation platform. It allows to

An experiment is a group of simulations. A simulation is an execution of a given model with

All the simulations of an experiment relate to the same model. In R, an experiment belongs to the class experiment that is an extension of the class data.frame. The creation and manipulation of experiments can thus efficiently be performed with the data.frame methods. The class experiment is also tidyverse-compliant, which allows its insertion into pipelines (or workflows). Outputs of experiment runs are in an object of class experiment too, with fields corresponding to the simulation outputs, typically data frames of time series of observed variables and / or links to snapshots that can subsequently be assembled into movies. The R environment allows to

In addition to above-mentionned data frame, an object of class experiment contains a link to a .gaml file containing the GAML model (input) and a link to a folder containing the outputs of simulations. It is possible to change these links but potentially dangerous and not advised. The .gaml file can be visualized in R but is not supposed to be modified by the user in R. Instead, a safe practice is to develop the model in the GAMA software and to reserve the use of gamar to the design and exploitation of experiments’ simulations as outlined above.

Structure of experiments in gamar

The package gamar contains one unique class, experiment that contains all the information of an experiment in a GAML model. This class is a subclass of data.frame as outlined below:

Each row of an experiment object corresponds to a simulation of the experiment. The columns corresponds to four type of data:

The name of the experiment, the links to input .gaml file and output directory, as well as the names of paramters and monitored variables that are common to all the simulations of the experiment are stored in the attributes of the experiment object and can be handled with accessor functions.

Installation and configuration

The package is still on development for Windows, it will be available soon.

You can install gamar from GitHub with:

installed_packages <- row.names(installed.packages())
if (! "devtools" %in% installed_packages) install.packages("devtools")
if (! "gamar" %in% installed_packages) devtools::install_github("r-and-gama/gamar")

After loading, gamar needs to be configured, a step that basically consists in linking gamar to a GAMA engine on the system. If GAMA is not installed on the system it will download and install it for you:

setup_gama()

and follow instructions. Otherwise, you can input your local path to the application Gama Platform, in this case the function will not be interactive and will configure GAMA path for gamar:

setup_gama("path/to/gama")

Developers

gamar is developed under the umbrella of the IRD- and OUCRU-funded EID JEAI by: