Learn R Programming

RNetLogo (version 0.9.2)

RNetLogo-package: Provides an interface to the agent-based modelling plattform NetLogo

Description

Interface to embed NetLogo into the R environment with headless (no GUI) and interactive GUI mode. Provides functions to load models, execute commands and to get values from reporters. Mostly equivalent to NetLogo Mathematica Link http://ccl.northwestern.edu/netlogo/docs/mathematica.html.

Arguments

Details

ll{ Package: RNetLogo Type: Package Version: 0.9 Date: 2011-07-13 License: GNU GPL v2 LazyLoad: yes } Start with the creation of a NetLogo instance by using NLStart. Then load a model with the function NLLoadModel and then use a command and/or reporter to do what you like. Please note, that the package is not tested with Mac OS. If you made experiences with the package on Mac, please let me know.

References

For NetLogo see http://ccl.northwestern.edu/netlogo. For R Extension for NetLogo see http://netlogo-r-ext.berlios.de. The RNetLogo package is an equivalent (and inspired by) to the NetLogo Mathematica Link http://ccl.northwestern.edu/netlogo/docs/mathematica.html.

See Also

NLStart, NLLoadModel, NLQuit, rJava package

Examples

Run this code
library(RNetLogo)
nl.path <- "C:/Program Files/NetLogo 4.1.3"
NLStart(nl.path)
model.path <- "/models/Sample Models/Earth Science/Fire.nlogo"
NLLoadModel(paste(nl.path,model.path,sep=""))
NLCommand("setup")
NLDoCommand(10, "go")
burned <- NLReport("burned-trees")
print(burned)

Run the code above in your browser using DataLab