oTree Forum >

Problem for setting payoffs

#1 by ckuzlukluoglu

Dear all,

I'm currently working on a Collective Risk Social Dilemma(CRSD) game with 6 players, and I have a problem with setting payoffs. The game will consist of 10 rounds. Players can contribute to the common pool throughout these 10 rounds. There is of course predefined threshold. At the end of 10 rounds, payoffs will be decided based on the comparison between the common pool and threshold. Whatever the comparison, I need to subtract all contributions of a player from his endowment to calculate payoffs. So, I have a set_payoff function to do that. Since I need to use the player's contributions throughout the game, I wrote the set_payoff function as a player class [set_payoffs(player)]. (See attachment)

I used this function on the result page(I mean #PAGES), and it gives the true number. However, the payoff is not correct when I check "monitor" on devserver at the end of the game. 

I tried to use this function by using resultswaitpage, then it gives both zero on "monitor" and on result page.

I tried to rewrite set_payoff function as a group class [set_payoff(group)], but I couldn't find a method for getting a player's all contribution for 10 rounds. So, I gave up this method. 

I couldn't find a solution to how to deal with this. Do you have any idea on why this might be happening? I can share more screenshots or details if you need.

Thanks in advance for your help!

Write a reply

Set forum username