from otree.api import Currency as c, currency_range from . import pages from ._builtin import Bot from .models import Constants from otree.api import expect import random class PlayerBot(Bot): def play_round(self): # Round 1) yield (pages.Introduction) yield (pages.InformationNewRound) yield (pages.Market1, {'choice_1' : random.randint(0, 1)}) yield (pages.Results1) yield (pages.Market2, {'choice_2' : random.randint(0, 1)}) yield (pages.Results2) yield (pages.Market3, {'choice_3' : random.randint(0, 1)}) yield (pages.Results3) yield (pages.Market4, {'choice_4' : random.randint(0, 1)}) yield (pages.Results4) yield (pages.Market5, {'choice_5' : random.randint(0, 1)}) yield (pages.Results5) yield (pages.Reliance, {'q_reliance_1' : random.randint(1, 4)}) yield (pages.Overview) # Round i) yield (pages.InformationNewRound) yield (pages.Market1, {'choice_1' : random.randint(0, 1)}) yield (pages.Results1) yield (pages.Market2, {'choice_2' : random.randint(0, 1)}) yield (pages.Results2) yield (pages.Market3, {'choice_3' : random.randint(0, 1)}) yield (pages.Results3) yield (pages.Market4, {'choice_4' : random.randint(0, 1)}) yield (pages.Results4) yield (pages.Market5, {'choice_5' : random.randint(0, 1)}) yield (pages.Results5) yield (pages.Reliance, {'q_reliance_1' : random.randint(1, 4)}) yield (pages.Overview) # Round i) yield (pages.InformationNewRound) yield (pages.Market1, {'choice_1' : random.randint(0, 1)}) yield (pages.Results1) yield (pages.Market2, {'choice_2' : random.randint(0, 1)}) yield (pages.Results2) yield (pages.Market3, {'choice_3' : random.randint(0, 1)}) yield (pages.Results3) yield (pages.Market4, {'choice_4' : random.randint(0, 1)}) yield (pages.Results4) yield (pages.Market5, {'choice_5' : random.randint(0, 1)}) yield (pages.Results5) yield (pages.Reliance, {'q_reliance_1' : random.randint(1, 4)}) yield (pages.Overview) # Round i) yield (pages.InformationNewRound) yield (pages.Market1, {'choice_1' : random.randint(0, 1)}) yield (pages.Results1) yield (pages.Market2, {'choice_2' : random.randint(0, 1)}) yield (pages.Results2) yield (pages.Market3, {'choice_3' : random.randint(0, 1)}) yield (pages.Results3) yield (pages.Market4, {'choice_4' : random.randint(0, 1)}) yield (pages.Results4) yield (pages.Market5, {'choice_5' : random.randint(0, 1)}) yield (pages.Results5) yield (pages.Reliance, {'q_reliance_1' : random.randint(1, 4)}) yield (pages.Overview) # Round i) yield (pages.InformationNewRound) yield (pages.Market1, {'choice_1' : random.randint(0, 1)}) yield (pages.Results1) yield (pages.Market2, {'choice_2' : random.randint(0, 1)}) yield (pages.Results2) yield (pages.Market3, {'choice_3' : random.randint(0, 1)}) yield (pages.Results3) yield (pages.Market4, {'choice_4' : random.randint(0, 1)}) yield (pages.Results4) yield (pages.Market5, {'choice_5' : random.randint(0, 1)}) yield (pages.Results5) yield (pages.Reliance, {'q_reliance_1' : random.randint(1, 4)}) yield (pages.Overview) # Round i) yield (pages.InformationNewRound) yield (pages.Market1, {'choice_1' : random.randint(0, 1)}) yield (pages.Results1) yield (pages.Market2, {'choice_2' : random.randint(0, 1)}) yield (pages.Results2) yield (pages.Market3, {'choice_3' : random.randint(0, 1)}) yield (pages.Results3) yield (pages.Market4, {'choice_4' : random.randint(0, 1)}) yield (pages.Results4) yield (pages.Market5, {'choice_5' : random.randint(0, 1)}) yield (pages.Results5) yield (pages.Reliance, {'q_reliance_1' : random.randint(1, 4)}) yield (pages.Overview) # Round i) yield (pages.InformationNewRound) yield (pages.Market1, {'choice_1' : random.randint(0, 1)}) yield (pages.Results1) yield (pages.Market2, {'choice_2' : random.randint(0, 1)}) yield (pages.Results2) yield (pages.Market3, {'choice_3' : random.randint(0, 1)}) yield (pages.Results3) yield (pages.Market4, {'choice_4' : random.randint(0, 1)}) yield (pages.Results4) yield (pages.Market5, {'choice_5' : random.randint(0, 1)}) yield (pages.Results5) yield (pages.Reliance, {'q_reliance_1' : random.randint(1, 4)}) #yield (pages.Overview) print('Done') # AssertionError