from otree.api import Currency as c, currency_range, expect, Bot from End import * from otree.api import Currency as c, currency_range, expect, Bot from . import * class PlayerBot(Bot): def play_round(self): if self.player.session.vars['part_payoff'] == 2 and self.player.participant.vars['role'] == 'P': yield PayoffsOtherP if self.player.session.vars['part_payoff'] == 2 and self.player.participant.vars['role'] == 'A': yield PayoffsOtherA if self.player.session.vars['part_payoff'] == 1: yield PayoffsPA # class PlayerBot(Bot): # # cases = [ # 'success', # players agree on an amount under the threshold # 'greedy', # players ask for too much so end up with nothing # ] # # def play_round(self): # # # start # yield Introduction # # if self.case == 'success': # request = cu(10) # yield Request, dict(request=request) # yield Results # expect(self.player.payoff, request) # # if self.case == 'greedy': # yield Request, dict(request=C.AMOUNT_SHARED) # yield Results # expect(self.player.payoff, 0) #