from otree.api import Currency as c, currency_range, expect, Bot from main import * from otree.api import Currency as c, currency_range, expect, Bot from . import * # class PlayerBot(Bot): # # cases = [ # 'success', # players agree on an amount under the threshold # 'greedy', # players ask for too much so end up with nothing # ] # # def play_round(self): # # # start # yield Introduction # # if self.case == 'success': # request = cu(10) # yield Request, dict(request=request) # yield Results # expect(self.player.payoff, request) # # if self.case == 'greedy': # yield Request, dict(request=C.AMOUNT_SHARED) # yield Results # expect(self.player.payoff, 0) # class PlayerBot(Bot): def play_round(self): if self.player.round_number == 1: yield Consent, dict(consent=1) yield Introduction yield Summary yield Instructions, dict(test_1=1, test_2=1, test_3=1) yield StartTask if self.player.round_number == 10 and self.participant.vars['role'] == 'A': yield Instructions_beliefs if self.participant.vars['display'][self.round_number - 1] == 1 and self.participant.vars['role'] == 'P': yield BonusDecision, dict(bonus_s=1, bonus_i=0) if self.participant.vars['role'] == 'A' and self.player.participant.vars['round_dict'][self.player.round_number]['page'] == 'C': yield LotteryChoice, dict(choice_s=0) if self.participant.vars['role'] == 'A' and self.player.participant.vars['round_dict'][self.player.round_number]['page'] == 'B': yield Belief, dict(belief_s=60, belief_i=40) # if self.participant.vars['last_age'] == self.player.round_number: # yield test # # end_MR=0 # if end_MR == 0: # if self.round_number == 1: # yield Introduction # yield start_section_1 # yield Instructions1, dict(test_1=1, test_2=1, test_3=1) # yield start_task # yield Task, dict(answer=random.choice(['a', 'b', 'c'])) # elif 40 > self.round_number > 1: # yield Task, dict(answer=random.choice(['a', 'b', 'c'])) # elif self.round_number == 40: # yield Task, dict(answer=random.choice(['a', 'b', 'c'])) # yield Feedback0 # yield Instructions2, dict(belief_50_s=33.5) # # if self.player.participant.vars['belief50_pos'] == self.player.participant.vars['belief50_count']: # yield Belief50, dict(belief_50_s=90, belief_50_o=10) # yield BeliefA, dict(belief_A_s=30, belief_A_o=70) # else: # yield BeliefA, dict(belief_A_s=30, belief_A_o=70) # yield Belief50, dict(belief_50_s=90, belief_50_o=10) # # elif self.round_number == 41: # yield TaskPerception, dict(task_difficulty=1, task_enjoy=2, task_effort=3, task_expectation=4) # yield Instructions3 # if self.player.participant.vars['belief50_pos'] == self.player.participant.vars['belief50_count']: # yield Belief50_third, dict(belief_50_1_third=22, belief_50_2_third=66) # yield BeliefA_third, dict(belief_A_1_third=11, belief_A_2_third=99) # else: # yield BeliefA_third, dict(belief_A_1_third=22, belief_A_2_third=66) # yield Belief50_third, dict(belief_50_1_third=11, belief_50_2_third=99) # yield start_section_2 # yield Instructions1_short # yield start_task # yield Task, dict(answer=random.choice(['a', 'b', 'c'])) # elif 80 > self.round_number > 41: # yield Task, dict(answer=random.choice(['a', 'b', 'c'])) # elif self.round_number == 80: # yield Task, dict(answer=random.choice(['a', 'b', 'c'])) # yield Feedback0 # yield Instructions2_short # # if self.player.participant.vars['belief50_pos'] == self.player.participant.vars['belief50_count']: # yield Belief50, dict(belief_50_s=60, belief_50_o=40) # yield BeliefA, dict(belief_A_s=40, belief_A_o=60) # else: # yield BeliefA, dict(belief_A_s=60, belief_A_o=40) # yield Belief50, dict(belief_50_s=40, belief_50_o=60) # elif self.round_number == 81: # yield TaskPerception, dict(task_difficulty=1, task_enjoy=2, task_effort=3, task_expectation=4) # yield Instructions3_short # if self.player.participant.vars['belief50_pos'] == self.player.participant.vars['belief50_count']: # yield Belief50_third, dict(belief_50_1_third=55, belief_50_2_third=45) # yield BeliefA_third, dict(belief_A_1_third=65, belief_A_2_third=35) # else: # yield BeliefA_third, dict(belief_A_1_third=55, belief_A_2_third=45) # yield Belief50_third, dict(belief_50_1_third=65, belief_50_2_third=35) # end_MR=1 #