Learn R Programming

RNetLogo (version 0.9.4)

NLQuit: Quits a NetLogo instance.

Description

Quits the NetLogo workspace and closes the GUI window (if started with GUI).

Usage

NLQuit(nl.obj=NULL)

Arguments

nl.obj
(optional) The reference to a NetLogo instance, if several have been started.

Value

  • No return value.

Warning

There is currently no way to kill a NetLogo instance with GUI completely. After executing NLQuit on a GUI instance, you can't run NLStart again. You have to quit your R session first and start a new one. The reason is that NetLogo quits via System.exit (and has no functionality to quit all threads manually) but executing System.exit will terminate the whole JVM which will also terminate rJava and finally R. But there is a trick to run RNetLogo in GUI mode multiple times described in the document parallelProcessing.pdf in directory parallelProcessing in the installation directory of the package. It can happen that some memory is not released although you have executed NLQuit, because shutting down the running JVM via rJava and unloading the required libraries is not possible. Therefore, it is a good idea to start a new R session if possible when you load a new model.

See Also

NLStart

Examples

Run this code
nl.path <- "C:/Program Files/NetLogo 5.0.3"
NLStart(nl.path)
NLQuit()

Run the code above in your browser using DataLab