https://github.com/dvgodoy/netlogo-role-of-institutions
NetLogo implementation of model proposed in "The Role of Institutions in the Emergence of Cooperation"
https://github.com/dvgodoy/netlogo-role-of-institutions
economics-game economics-models netlogo-behaviorspace-experiments netlogo-model r
Last synced: about 2 months ago
JSON representation
NetLogo implementation of model proposed in "The Role of Institutions in the Emergence of Cooperation"
- Host: GitHub
- URL: https://github.com/dvgodoy/netlogo-role-of-institutions
- Owner: dvgodoy
- License: mit
- Created: 2019-03-08T21:49:40.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-11T21:47:00.000Z (about 6 years ago)
- Last Synced: 2025-01-22T12:13:15.537Z (3 months ago)
- Topics: economics-game, economics-models, netlogo-behaviorspace-experiments, netlogo-model, r
- Language: NetLogo
- Size: 143 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 1. Install R
After installing R, run the following command on the terminal:
`$sudo R CMD javareconf`
### 1.1 Install R packages
install.packages("rJava")
install.packages("igraph")
### 1.2 In R, run these two commands:
`R.home(component = "home")`
[1] "/usr/lib/R"
`system.file("jri", package = "rJava")`
[1] "/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.5/rJava/jri"
### 1.3 Use the returned folders to set these two environment variables
export R_HOME=/usr/lib/R
export JRI_HOME=/home/dvgodoy/R/x86_64-pc-linux-gnu-library/3.5/rJava/jri
## 2. Download and Unzip NetLogo 5.0.5
https://ccl.northwestern.edu/netlogo/5.0.5/netlogo-5.0.5.tar.gz
tar -xvzf netlogo-5.0.5.tar.gz
### 2.1 Download and Unzip R-Extension for NetLogo (v1.4)
https://sourceforge.net/projects/r-ext/files/
Unzip into your NetLogo folder, subfolder extensions
### 2.2 Test your installation
Run NetLogo with `netlogo.sh`.
In the code tab, type:
`extensions [r]`
And click the "check" button. It shouldn't raise any errors.
## 3. Clone this repository
### 3.1 Load RoleOfInstitutions.nlogo model in NetLogo
Open `r_functions.nls`.
On `r-load` procedure, edit `source('functions.R')` to `source('/path/to/folder/functions.R')`
### 3.2 Click on SETUP button, it should initialize the simulation. Click GO and watch it run!
