Skip to content

Giving people the ability to easily simulate their own custom Commons with cadCAD

Notifications You must be signed in to change notification settings

commons-stack/commons-simulator

Repository files navigation

Commons Simulator

Commons Simulator

The Commons Simulator is a community project funded entirely by Gitcoin Grants, and undertaken by the Commons Stack’s dDev team. The Commons Simulator blends art and simulation into a dystopian sci-fi future where you travel back in time with cadCAD, a complex systems simulator that can predict the future.

You use cadCAD to help the fledgling RadicalxChange movement to customize their Cyber-Physical Commons to suit the needs of their community and save the world from ecosystem collapse!

Server status

commons-stack

1. Installation:

sudo apt install nodejs npm
sudo npm install -g yarn
sudo pip3 install -r requirements.txt
./start.sh

2. Running the simulation:

Running the simulation on CLI

To run the simulation on the CLI with the default parameters:

cd simulation
python simrunner.py

Adding a -h shows all the possible input parameters:

python simrunner.py -h
usage: simrunner.py [-h] [--hatchers HATCHERS] [--proposals PROPOSALS]
                    [--hatch_tribute HATCH_TRIBUTE]
                    [--vesting_80p_unlocked VESTING_80P_UNLOCKED]
                    [--exit_tribute EXIT_TRIBUTE] [--kappa KAPPA]
                    [--days_to_80p_of_max_voting_weight DAYS_TO_80P_OF_MAX_VOTING_WEIGHT]
                    [--max_proposal_request MAX_PROPOSAL_REQUEST]
                    [-T TIMESTEPS_DAYS] [--random_seed RANDOM_SEED]

optional arguments:
  -h, --help            show this help message and exit
  --hatchers HATCHERS
  --proposals PROPOSALS
  --hatch_tribute HATCH_TRIBUTE
  --vesting_80p_unlocked VESTING_80P_UNLOCKED
  --exit_tribute EXIT_TRIBUTE
  --kappa KAPPA
  --days_to_80p_of_max_voting_weight DAYS_TO_80P_OF_MAX_VOTING_WEIGHT
  --max_proposal_request MAX_PROPOSAL_REQUEST
  -T TIMESTEPS_DAYS, --timesteps_days TIMESTEPS_DAYS

After running the simulation, the results will be shown in the CLI as a dictionary.

Development mode

To run a development mode server to have React hot reloading, do the same as above and in another terminal:

cd app
yarn start

A hot reloading server will pop up a browser tab on http://localhost:3000/

Docker instructions

To run in a docker container

docker build -t commonssim .
docker run -p 5000:5000 commonssim

Go to http://localhost:5000/

Website Front-End

The website Front-End repository can be found here.

3. Testing

From the main folder:

python -m unittest discover -s simulation -p '*_test.py'

4. Resources

About

Giving people the ability to easily simulate their own custom Commons with cadCAD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published