wolf-sheep

example reproducible ABM + RMarkdown analysis pipeline based on the NetLogo wolf-sheep predation model

https://github.com/comses-education/wolf-sheep

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary

Keywords

fair-research-software netlogo netlogo-behaviorspace open-science r reproducible-research
Last synced: 6 months ago · JSON representation ·

Repository

example reproducible ABM + RMarkdown analysis pipeline based on the NetLogo wolf-sheep predation model

Basic Info
  • Host: GitHub
  • Owner: comses-education
  • License: gpl-3.0
  • Language: NetLogo
  • Default Branch: main
  • Homepage:
  • Size: 2.19 MB
Statistics
  • Stars: 3
  • Watchers: 5
  • Forks: 2
  • Open Issues: 1
  • Releases: 1
Topics
fair-research-software netlogo netlogo-behaviorspace open-science r reproducible-research
Created almost 9 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

wolf-sheep

fair-software.eu Docker Image CI

ASU ABM club adaptation of the NetLogo wolf sheep predation model with added kill tracking from @mmannin5

Preparation

Software Requirements: docker, make and bash

  1. Install docker
  2. Clone this repository
  3. Build the Docker images by running % make build on the command line in the root of the project.
  4. Prebuilt images can be pulled from Docker Hub (docker pull comses/resbaz-analysis:3.3.3 and docker pull comses/resbaz-netlogo:5.3.1)

Run the workflow

Executing% ./run.sh run on the command line (caveat: only tested on Linux and Mac, it may run on Windows 10 bash) will execute the entire pipeline which currently consists of (1) a NetLogo behavior space experiment that generates a single CSV file, and (2) a RMarkdown file that loads the generated CSV file and generates a RMarkdown HTML report.

The NetLogo data can be found at data/vary_food_gains.csv and the resulting RMarkdown report will be produced at results/wolf_sheep_AB.html, relative to the root directory.

Interact with the workflow

  1. Run make interact
  2. NetLogo GUI should have popped up on your desktop
    • If it hasn't check the logs (docker-compose logs -f netlogo). If there is an error about not being able to connect to the X11 server window you need to give docker permission to talk to the X11 socket. This can be done with xhost +local:docker.
  3. RStudio GUI available at localhost:8787

Interact with NetLogo

The root project directory is mounted at /code so the NetLogo model used to generate this model is at /code/src/wolf-sheep-predation.nlogo. Open /code/src/wolf-sheep-predation.nlogo in NetLogo to view the model. The Behaviour Space settings used the vary_food_gains experiment. Parameters for the experiment can be seen by going into Tools > BehaviourSpace and opening vary_food_gains

Interact with RStudio

At localhost:8787 login as rstudio with a password of rstudio. The root project directory (the directory this is in) is mounted into RStudio at /home/rstudio/code. It should be visible in the explorer pane in RStudio.

  1. Open the wolf-sheep.Rproj project file in RStudio (File > Open Project... and select wolf-sheep.Rproj it will at the path /home/rstudio/code/wolf-sheep.Rproj). This will load the Packrat repository used for this project.
  2. Open src/wolf_sheep_AB.Rmd
  3. Run the knit command

Location of Knit button on RStudio

Notes

This workflow has hard coded the output file generated from NetLogo into a path made accessible to the RMarkdown container. This example uses the hard coded data set name vary_food_gains.csv. A more robust workflow would define this type of data in a single place and referencing it in dependent computations so that changing the filename of a dataset does not require manually editing multiple files.

Packrat Resources

References

Wilensky, U. (1997). NetLogo Wolf Sheep Predation model. http://ccl.northwestern.edu/netlogo/models/WolfSheepPredation. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Owner

  • Name: CoMSES Net: Education
  • Login: comses-education
  • Kind: organization
  • Email: education@comses.net

CoMSES Net Educational Initiatives

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: NetLogo Wolf Sheep Analysis
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Andres
    family-names: Baeza-Castro
  - given-names: Felix
    family-names: John
  - given-names: Allen
    family-names: Lee
  - given-names: Miles
    family-names: Manning
  - given-names: Calvin
    orcid: 'https://orcid.org/0000-0002-4557-8602'
    family-names: Pritchard
identifiers:
  - type: url
    value: 'https://github.com/comses-education/wolf-sheep'
    description: GitHub Repository
url: >-
  http://ccl.northwestern.edu/netlogo/models/WolfSheepPredation
abstract: >-
  An adapted version of the wolf sheep predation
  model bundled with NetLogo with additional kill
  tracking and R analysis pipeline that results in a
  RMarkdown report.
license: GPL-3.0-or-later

GitHub Events

Total
Last Year

Dependencies

.github/workflows/docker-image.yml actions
  • actions/checkout v3 composite
.github/workflows/fair-software.yml actions
  • fair-software/howfairis-github-action 0.2.1 composite
docker-compose.yml docker
  • comses/wolf-sheep-analysis latest
  • comses/wolf-sheep-netlogo latest
netlogo/Dockerfile docker
  • comses/netlogo 6.2.2 build
rstudio/Dockerfile docker
  • rocker/rstudio 3.3.3 build