from otree.api import Currency as c, currency_range, expect, Bot from . import * from random import randint class PlayerBot(Bot): def play_round(self): if self.player.round_number <= self.player.participant.num_rounds: if self.player.participant.role == "producer": yield WTS, dict(wts=randint(0, max(400, self.player.participant.tokens))) # yield WTS, dict(wts=1000000) # never sell else: yield WTB, dict(wtb=randint(0, self.player.participant.tokens)) if self.player.round_number < self.player.participant.num_rounds: yield Results