from otree.api import Currency as c, currency_range from . import pages from ._builtin import Bot from .models import Constants import numpy class PlayerBot(Bot): def play_round(self): if(self.round_number == 1): yield (pages.Instructions0) yield (pages.Instructions1) yield (pages.Instructions2) yield (pages.Instructions3) yield (pages.Instructions4) yield (pages.Instructions5) yield (pages.Instructions6, {'agreed': True}) yield (pages.Resume_Eval, {'CV_to_view': 1}) if (self.participant.vars.get('submitted_all', 0) == 0): for i in range(2,7,1): if numpy.random.uniform(0, 1)>0.9: yield (pages.Resume_Eval,{ #'CV_{}'.format(numpy.random.random_integers(1, i)): i-2 #'CV_{}'.format(numpy.random.random_integers(1, i)): round(numpy.random.normal(loc=5, scale=1.23)), }) yield (pages.Resume_Eval, { 'CV_{}'.format(i - 1): i-2, #'CV_{}'.format(i-1): round(numpy.random.normal(loc=5, scale=1.23)), 'Name_{}'.format(i-1): 'washington', 'CV_to_view': i }) yield (pages.Resume_Eval, {'CV_6': 10, #'CV_6': round(numpy.random.normal(loc=5, scale=1.23)), 'Name_6': 'washington', 'subreq': True, }) # elif (self.participant.vars.get('submitted2', 0) == 0): for i in range(2, 7, 1): if numpy.random.uniform(0, 1)>0.9: yield (pages.Resume_Eval,{ 'CV_{}_A'.format(i - 1): i-1, #'CV_{}_A'.format(numpy.random.random_integers(1, i-1)): round(numpy.random.normal(loc=5, scale=1.23)), #'CV_{}_A'.format(i - 1): round(numpy.random.normal(loc=5, scale=1.23)), 'CV_to_view': i }) else: yield (pages.Resume_Eval, { 'CV_{}_A'.format(i - 1): i-1, #'CV_{}_A'.format(i - 1): round(numpy.random.normal(loc=5, scale=1.23)), 'CV_to_view': i }) yield (pages.Resume_Eval, {'CV_6_A': 10, #'CV_6_A': round(numpy.random.normal(loc=5, scale=1.23)), 'subreq': True, }) # elif (self.participant.vars.get('submitted3', 0) == 0): for i in range(2, 7, 1): if numpy.random.uniform(0, 1)>0.9: yield (pages.Resume_Eval,{ 'CV_{}_B'.format(numpy.random.random_integers(1, i-1)): round(numpy.random.normal(loc=5, scale=1.23)), 'CV_{}_B'.format(i - 1): round(numpy.random.normal(loc=5, scale=1.23)), 'CV_to_view': i }) else: yield (pages.Resume_Eval, { 'CV_{}_B'.format(i - 1): round(numpy.random.normal(loc=5, scale=1.23)), 'CV_to_view': i }) yield (pages.Resume_Eval, {'CV_6_B': round(numpy.random.normal(loc=5, scale=1.23)), 'subreq': True, }) # elif (self.participant.vars.get('submitted_all', 0) == 0): for i in range(2, 7, 1): if numpy.random.uniform(0, 1)>0.9: yield (pages.Resume_Eval,{ 'CV_{}_C'.format(numpy.random.random_integers(1, i-1)): round(numpy.random.normal(loc=5, scale=1.23)), 'CV_{}_C'.format(i - 1): round(numpy.random.normal(loc=5, scale=1.23)), 'CV_to_view': i }) else: yield (pages.Resume_Eval, { 'CV_{}_C'.format(i - 1): round(numpy.random.normal(loc=5, scale=1.23)), 'CV_to_view': i }) yield (pages.Resume_Eval, {'CV_6_C': round(numpy.random.normal(loc=5, scale=1.23)), 'subreq': True, }) yield (pages.Resume_Eval, {'subreq': True, })