Description Usage Arguments Value Examples
Executes a NetLogo Model using rNetLogo
1 | NLWrapper.RunExperiment(obj, r = 1, design, FUN)
|
obj |
The object retuned by NLWrapper.Model |
r |
The number of replications |
design |
The desing matrix holding parameter sampling |
FUN |
THe calibration function. |
A list containing the the parameters, the calibration functio output and the whole resultset
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
rm(list=ls())
objectivefn<- function(params, results) { 0 }
f<- AddFactor(name="initial-number-sheep",min=100,max=250)
f<- AddFactor(factors=f, name="initial-number-wolves",min=50,max=150)
f<- AddFactor(factors=f, name="grass-regrowth-time",min=30,max=100)
f<- AddFactor(factors=f, name="sheep-gain-from-food",min=1,max=50)
f<- AddFactor(factors=f, name="wolf-gain-from-food",min=1,max=100)
f<- AddFactor(factors=f, name="sheep-reproduce",min=1,max=20)
f<- AddFactor(factors=f, name="wolf-reproduce",min=1,max=20)
design<- AoE.LatinHypercube(factors=f)
p<- "C:/Program Files/NetLogo 6.0.4/app"
m<- file.path(p, "models", "Sample Models", "Biology", "Wolf Sheep Predation.nlogo")
output<- c("count sheep", "count wolves")
o<- NLWrapper.Model(p, m, output, 150)
v<- RunExperiment(o, r=1, design, objectivefn)
NLWrapper.Shutdown(o)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.