I assume you already have python3 installed.
- Install otree:
pip3 install -U otree
- Create a project:
otree startproject candicitizen
- Navigate into the project directory:
cd candicitizen
- Clone this repo:
git clone https://github.com/kmlv/citizen.git
- Edit SESSION_CONFIGS in the settings.py file to look like this:
SESSION_CONFIGS = [
dict(
name='citizen',
num_demo_participants=5,
app_sequence=['citizen'],
endowment=10.0,
B=3.0,
C=1.5,
D=0.75,
),
]
Or change endowment
, B
, C
, and D
as you wish.
- There will always be 10 rounds. By default, there are 5 rounds of runoff then 5 rounds of non-runoff. To change these numbers, edit models.py, in class Constants, and change num_rounds_runoff to a different number. If you change it to 1, there will be 1 round of runoff then 9 rounds of non-runoff.
- Start the server:
otree devserver
- Navigate to
localhost:8000
in your browser. - Play the experiment.
- Navigate in your browser to
leeps-otree.ucsc.edu:8000
- To use the default config values shown above, simply click 'Candidate Citizen' and play the game.
- To configure your own config values and play a real session, click the 'Sessions' link at the top left.
- Username: admin. Password: slugtree. Then click 'Create new session'
- Select 'Candidate Citizen' as the session config. Enter your number of participants.
- Click 'Configure session'. Fill in the values you want for endowment, B, C, and D.
- Click 'Create'
- Play the game.
If you edit anything, and want to make sure you didn't break something
accidentally, run otree test citizen
from the candicitizen
directory.
It should not fail. Warnings are fine.
Git is a way for multiple people to collaborate on a project simultaneously. You need to know how to do 3 things: clone, push, and pull.
git clone https://github.com/kmlv/citizen.git
will create a copy of this
repository, including the directory structure and all files, into a directory
that gets automatically created and is called citizen
. You should only need
to do this once on your local machine.
This is how you take work you have done in the citizen
repo on your local
computer, and upload it to github.
- Change some files in the
citizen
repo. - Into your terminal, type the command
git status
. It should show a list of files that have been edited. If there is any file on there that you did not edit, something is wrong. - Into your terminal, type the command
git add -A
. - Into your terminal, type the command `git commit -m "", replacing with a short message about what you changed.
- Into your terminal, type the command
git push origin master
This is how you take work that exists on github, and merge it into your copy of the repository on your local computer.
Into your terminal, from inside the citizen
directory,
type git pull origin master
. If you get any merge conflicts, talk to Eli.