linerenjoy.blogg.se

Netlogo scale color
Netlogo scale color









  1. Netlogo scale color install#
  2. Netlogo scale color Patch#

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.

  • nl_to_raster() - Reports raster objects and needs patch coordinates and at least one patch variable ( metrics.patches = c("pxcor", "pycor", "pcolor")).
  • Additional turtle and link variables will be stored as properties of the igraph nodes and vertices.
  • nl_to_graph() - Reports igraph objects and needs at least turtle who numbers and who numbers of link ends ( metrics.turtles = list("turtles" = c("who")), metrics.links = list("links" = c(" of end1", " of end2"))).
  • Please note, that these functions have requirements on measured spatial variables:
  • nl_to_graph(), nl_to_raster(), nl_to_points() - These functions create spatial objects from the nested data within the output results tibble.
  • This format is easily subsettable and is suited to produce plots using the ggplot package, or create animations with gganimate. It reports a long tibble containing all parameters, variables and agent metrics.
  • unnest_simoutput() - This function may be used to unnest the data within the output results tibble.
  • nlrx provides two types of postprocessing functions: In order to utilize these data, they need to be postprocessed. If an experiment contains any agent metrics, the results of these metrics will be nested inside the output results tibble.

    netlogo scale color

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

    netlogo scale color

    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.

    netlogo scale color

  • metrics.turtles - a list with named vectors of strings defining valid turtles-own variables that are taken as output measurements (e.g.
  • The experiment class object provides slots for measuring turtles, patches and link variables:

    netlogo scale color

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











    Netlogo scale color