Adding threshold in Public good games

62 views
Skip to first unread message

King Hei YIP

unread,
Dec 30, 2021, 11:40:24 PM12/30/21
to oTree help & discussion
Hi,

I am new to python and otree and I am working on a threshold public good game.
I have some troubles in setting up a threshold of the game, in which if the total contribution of players is lower than a certain amount, they will receive zero.
May I know the exact procedure? Thank you!

Alex Caceres-Wright

unread,
Jan 2, 2022, 3:04:30 PM1/2/22
to oTree help & discussion
Hi,

just use an if-statement to check that if the sum of all player contributions in the group is less than the threshold then set the individual share is 0. Alternatively if the sum of contributions is less than the threshold. use a for loop over the list of players to set each player's payoff to 0
Reply all
Reply to author
Forward
0 new messages