<<<<<<< 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 <<<<<<< HEAD ======= >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3 class PlayerBot(Bot): cases = ['min', 'max'] def play_round(self): <<<<<<< HEAD yield pages.Introduction if self.case == 'min': yield pages.Decide, dict(units=0) # if player produces 0, nothing is sold and they make 0 expect(self.player.payoff, c(0)) if self.case == 'max': yield pages.Decide, dict(units=Constants.max_units_per_player) # if everyone produces max, price is driven to 0 expect(self.player.payoff, c(0)) yield pages.Results ======= yield (pages.Introduction) if self.case == 'min': yield (pages.Decide, {'units': 0}) # if player produces 0, nothing is sold and they make 0 assert self.player.payoff == c(0) if self.case == 'max': yield (pages.Decide, {'units': Constants.max_units_per_player}) # if everyone produces max, price is driven to 0 assert self.player.payoff == c(0) yield (pages.Results) >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3