
NLCommand
executes a NetLogo command (submitted as a string)
in the (submitted) NetLogo instance.
NLCommand(..., nl.obj=NULL)
An undefined number of strings with the NetLogo command(s) to be executed.
Vectors, lists and data.frames will be represented as NetLogo lists. To set a NetLogo list you can write 'set mylist',c(1,2,3)
if the current NetLogo model knows a list named mylist
.
Furthermore, you can execute multiple commands in series, e.g. 'setup','go'
(optional) A string identifying a reference to a NetLogo instance created with NLStart
.
No return value.
The command can be anything which can be submitted from the NetLogo Command Center.
A command has no return value! If you want to return a value from NetLogo use NLReport
and other report functions.
NLStart("C:/Program Files/NetLogo 6.0/app")
NLCommand("create-turtles 10")
Run the code above in your browser using DataLab