oTree Perfect Stranger Matching Example
The puropose of this oTree program is to illustrate a simple implementation of perfect stranger matching, or round robin matching.
The code for implementing the perfect stranger matching is located in the Sessions.creating_session function in the models.py file. Comments and links to further resources have been added to clarify any parts of the code that might be opaque to those unfamiliar with python programming.
git clone https://github.com/cesslab/otree-perfect-stranger-matching
See An Introduction to Git and GitHub, by Brian Yu if you are unfamiliar with git or github.
In the project directory run the pipenv install command to install all the project dependencies. Pipenv is used to provide a virtual environment for managing python project dependencies (see this tutorial for more information).
The oTree program can be played by executing the
otree devserver command in the perfect_stranger directory. You can also play through the example game to see a table containing all the pairings across all rounds. Each player will have their group in the current round highlighted in the table, as
See oTree License