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!
sudo apt install nodejs npm
sudo npm install -g yarn
sudo pip3 install -r requirements.txt
./start.sh
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.
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/
To run in a docker container
docker build -t commonssim .
docker run -p 5000:5000 commonssim
Go to http://localhost:5000/
The website Front-End repository can be found here.
From the main folder:
python -m unittest discover -s simulation -p '*_test.py'