
Thus, executing run_nl_all() will report a tibble containing all metrics, metrics.turtles and metrics.patches. This experiment will run for 100 ticks (runtime) and collects all metrics, metrics.turtles and metrics.patches on each tick (evalticks).
Netlogo scale color install#
Library ( nlrx ) library ( ggplot2 ) library ( gganimate ) # devtools::install_github('thomasp85/gganimate') - if you have troubles installing gganimate, you most likely also need to install gifski as system dependency # Windows default NetLogo installation path (adjust to your needs!): netlogopath <- file.path ( "C:/Program Files/NetLogo 6.0.3" ) modelpath <- file.path ( netlogopath, "app/models/Sample Models/Biology/Wolf Sheep ogo" ) outpath <- file.path ( "C:/out" ) # Unix default NetLogo installation path (adjust to your needs!): netlogopath <- file.path ( "/home/NetLogo 6.0.3" ) modelpath <- file.path ( netlogopath, "app/models/Sample Models/Biology/Wolf Sheep ogo" ) outpath <- file.path ( "/home/out" ) # Define nl object nl <- nl (nlversion = "6.0.3", nlpath = netlogopath, modelpath = modelpath, jvmmem = 1024 ) # Define experiment nl experiment <- experiment (expname = "nlrx_spatial", outpath = outpath, repetition = 1, tickmetrics = "true", idsetup = "setup", idgo = "go", runtime = 100, metrics = c ( "count sheep", "count wolves" ), metrics.turtles = list ( "turtles" = c ( "who", "pxcor", "pycor" ) ), metrics.patches = c ( "pxcor", "pycor", "pcolor" ), constants = list ( "model-version" = "\"sheep-wolves-grass\"", 'initial-number-sheep' = 100, 'initial-number-wolves' = 50, "grass-regrowth-time" = 30, "sheep-gain-from-food" = 4, "wolf-gain-from-food" = 20, "sheep-reproduce" = 4, "wolf-reproduce" = 5, "show-energy?" = "false" ) ) # Attach simdesign simple using only constants nl simdesign <- simdesign_simple (nl = nl, nseeds = 1 ) # Run simulations and store output in results results <- run_nl_all (nl = nl ) Additional turtle variables will be stored as properties of the spatial points. nl_to_points() - Reports spatial point objects and needs at least turtle coordinates, either pxcor/pycor or xcor/ycor ( metrics.turtles = list("turtles" = c("xcor", "ycor", "who", "color"))).
Netlogo scale color Patch#
If several patch variables are provided, a raster stack is created with rasters for each patch variable.

Thus, different vectors of metrics can be provided for each specific breed (e.g.

If your model has agent variables that only exist for one specific breed (breed-own), measuring those variables for all turtles would result in a runtime error. list("links" = c(" of end1", " of end2")))īasically, you can enter any variable of your model that is listed in turtles-own, patches-own or links-own, however if you add variables that contain strings, these strings must not contain any whitespaces or the output data will not be parsed correctly. metrics.links - a list with named vectors of strings defining valid links-own variables that are taken as output measurements (e.g.metrics.patches - vector of valid patches-own variables that are used to collect patches data (e.g.


Nlrx is able to gather spatial output from your NetLogo simulations. Gathering spatial output from NetLogo model simulations
