oTree Forum >

Change how payoffs are calculated in practice rounds.

#1 by PimPim,

Dear all,

I am coding the game which consisted of practice rounds and real rounds. In the practice rounds, participants plays with a computer, so their payoffs are not depended on the others' decision. While in the real rounds, participants plays with each other. The matching processes are different so I have 2 payoffs functions: set_payoffs_prac and set_payoffs. However, I do not know how to switch between functions when using wait page. The following codes do not work:

class ResultsWaitPage(WaitPage):

    @staticmethod
    def payoff_cal(group: Group):
        if group.subsession.is_practice_round:
            after_all_players_arrive = 'set_payoffs_prac'
        else:
            after_all_players_arrive = 'set_payoffs'

Thank you very much in advance.

Kind regards,
Pim

Write a reply

Set forum username