Matching random players in the room in each round

180 views
Skip to first unread message

Federico Christmann

unread,
Aug 17, 2021, 3:58:08 PM8/17/21
to oTree help & discussion
Hi all,

I am actually running a second price auction experiment with multiple rounds. I am willing to know whether it is feasible to match a random player from the room in each round of the auction game. This means that in each round,  two players are matched, they make their bids, payoffs of the round are realized, and then both players will be matched randomly with another player of the room that is waiting to play again.

Thank you in advance,

Federico

Chris @ oTree

unread,
Aug 17, 2021, 8:54:37 PM8/17/21
to oTree help & discussion
See the app gbat_new_partners here: https://www.otreehub.com/projects/otree-snippets/

Federico Christmann

unread,
Aug 18, 2021, 2:17:58 PM8/18/21
to oTree help & discussion
Thanks for this info, however when I try to use the attached "code" line in my app, I have the following "issue". Also, I am using the "code" in the file "models.py" of my app. 
issue.png
code.png

Chris @ oTree

unread,
Aug 18, 2021, 2:22:00 PM8/18/21
to oTree help & discussion
the code example was written for the no-self format, not the "self" format that uses models.py...

Chris @ oTree

unread,
Aug 18, 2021, 2:22:25 PM8/18/21
to oTree help & discussion
see an explanation of the differences here: https://www.otree.org/newformat.html

Federico Christmann

unread,
Aug 18, 2021, 2:29:04 PM8/18/21
to oTree help & discussion
Sorry, but I've forgot to mention that I have used that codelines with the "self" format. Here you have my code. Notice that PyCharm gives the following warning: "Instance attribute past_groups defined outside __init__", but it is not clear for me what it means.

Thanks.

mycode.png

Chris @ oTree

unread,
Aug 18, 2021, 2:32:17 PM8/18/21
to oTree help & discussion
you can ignore that, it's one of the various style warnings that pycharm gives.

Federico Christmann

unread,
Aug 18, 2021, 2:44:24 PM8/18/21
to oTree help & discussion
Yes, actually I've previously moved "past_groups" in __init__.py and it didn't worked (I have the same error when I run my devserver). What is __init__.py actually doing? It is not clear for me the reason of this problem.
Reply all
Reply to author
Forward
0 new messages