<<<<<<< HEAD from otree.api import Currency as c, currency_range, expect ======= from otree.api import Currency as c, currency_range >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3 from . import pages from ._builtin import Bot from .models import Constants class PlayerBot(Bot): cases = [ <<<<<<< HEAD 'success', # players agree on an amount under the threshold 'greedy', # players ask for too much so end up with nothing ======= 'success', # players agree on an amount under the threshold 'greedy', # players ask for too much so end up with nothing >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3 ] def play_round(self): # start <<<<<<< HEAD yield pages.Introduction if self.case == 'success': request = c(10) yield pages.Request, dict(request=request) yield pages.Results expect(self.player.payoff, request) if self.case == 'greedy': yield pages.Request, dict(request=Constants.amount_shared) yield pages.Results expect(self.player.payoff, 0) ======= yield (pages.Introduction) if self.case == 'success': request = c(10) yield (pages.Request, {"request": request}) yield (pages.Results) assert self.player.payoff == request if self.case == 'greedy': yield (pages.Request, {"request": Constants.amount_shared}) yield (pages.Results) assert self.player.payoff == 0 >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3