NLWrapper.RunExperiment: NLWrapper.RunExperiment

Description Usage Arguments Value Examples

Description

Executes a NetLogo Model using rNetLogo

Usage

1
NLWrapper.RunExperiment(obj, r = 1, design, FUN)

Arguments

obj

The object retuned by NLWrapper.Model

r

The number of replications

design

The desing matrix holding parameter sampling

FUN

THe calibration function.

Value

A list containing the the parameters, the calibration functio output and the whole resultset

Examples

 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)

evoper documentation built on May 2, 2019, 12:13 a.m.