NLQuit: Quits a NetLogo instance.

Description Usage Arguments Value Warning Author(s) See Also Examples

View source: R/NLQuit.R

Description

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

Usage

1
NLQuit(nl.obj=NULL, all=FALSE)

Arguments

nl.obj

(optional) A string identifying a reference to the NetLogo instance defined in nl.obj of NLStart.

all

(optional) A boolean variable: If TRUE all active instances of NetLogo created with NLStart are closed. Then, nl.obj argument is not used.

Value

No return value.

Warning

please note that you will not be ask to save changes when closing NetLogo. Furthermore, 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.

Author(s)

Jan C. Thiele <rnetlogo@gmx.de>

See Also

NLStart

Examples

1
2
3
4
5
6
## Not run: 
nl.path <- "C:/Program Files/NetLogo 6.0/app"
NLStart(nl.path)
NLQuit()

## End(Not run)

RNetLogo documentation built on May 2, 2019, 9:29 a.m.