Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/NLDoCommandWhile.R
NLDoCommandWhile
function executes a NetLogo command (submitted as a string)
in the submitted NetLogo instance more than one time. It works like NLCommand
but will
be repeated as long as the reporter returns TRUE
.
1 | NLDoCommandWhile(condition, ..., max.minutes=10, nl.obj=NULL)
|
condition |
A string with a NetLogo conditional reporter. |
... |
An undefined number of string(s) with the NetLogo command(s) to be executed. See NLCommand for details. |
max.minutes |
(optional) If |
nl.obj |
(optional) A string identifying a reference to a NetLogo instance created with |
This function is used to execute a command for more than one time. It can be used, for example, to run a simulation (by calling "go") while a variable is below some limit.
The condition is evaluated before the submitted commands are executed. If the condition is FALSE
at the first evaluation, the commands will never be executed.
Attention: Make sure that the condition switches from TRUE
to FALSE
sometime,
otherwise you will run an endless loop (which is stopped after 10 minutes by default, see argument max.minutes
).
No return value.
Jan C. Thiele <rnetlogo@gmx.de>
NLCommand
,
NLDoCommandWhile
,
NLReport
1 2 3 4 5 6 7 8 9 | ## Not run:
nl.path <- "C:/Program Files/NetLogo 6.0/app"
NLStart(nl.path)
model.path <- "/models/Sample Models/Earth Science/Fire.nlogo"
NLLoadModel(paste(nl.path,model.path,sep=""))
NLCommand("setup")
NLDoCommandWhile("burned-trees < 500", "go")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.