# -*- coding: utf-8 -*- # from __future__ import division from otree.db import models from otree.constants import BaseConstants from otree.models import BaseSubsession, BaseGroup, BasePlayer from otree import widgets from otree.common import Currency as c, currency_range # import random doc = """ Each player decides if to free ride or to volunteer from which all will benefit. """ bibliography = ( ( "Diekmann, A. (1985). Volunteer's dilemma. Journal of Conflict " "Resolution, 605-610." ), ) class Constants(BaseConstants): name_in_url = 'travel_warning' players_per_group = 10 num_rounds = 20 instructions_file = 'travel_warning/Instructions.html' num_other_players = players_per_group - 1 # """Payoff for each player if they stay home""" home = c(100) # """Player types""" a_1 = c(4.0) a_2 = c(4.4) a_3 = c(4.8) a_4 = c(5.2) a_5 = c(5.6) a_6 = c(6.0) a_7 = c(6.4) a_8 = c(6.8) a_9 = c(7.2) a_10 = c(7.6) # """Risk-level variable""" t1 = c(30) t2 = c(15) t3 = c(25) t4 = c(16) t5 = c(1) t6 = c(20) t7 = c(17) t8 = c(35) t9 = c(22) t10 = c(2) t11 = c(18) t12 = c(23) t13 = c(40) t14 = c(18) t15 = c(10) t16 = c(19) t17 = c(24) t18 = c(12) t19 = c(21) t20 = c(32) e = c(1) gamma=c(2) class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): go = models.BooleanField( doc="""Whether player goes on the trip""", ) others_go = models.CurrencyField() go_payoff = models.CurrencyField() signal = models.CurrencyField() type = models.CurrencyField() def set_types(self): if self.id_in_group == 1: self.type = Constants.a_1 if self.id_in_group == 2: self.type = Constants.a_2 if self.id_in_group == 3: self.type = Constants.a_3 if self.id_in_group == 4: self.type = Constants.a_4 if self.id_in_group == 5: self.type = Constants.a_5 if self.id_in_group == 6: self.type = Constants.a_6 if self.id_in_group == 7: self.type = Constants.a_7 if self.id_in_group == 8: self.type = Constants.a_8 if self.id_in_group == 9: self.type = Constants.a_9 if self.id_in_group == 10: self.type = Constants.a_10 def set_signals(self): #if self.id_in_group == 1: if self.subsession.round_number == 1: self.signal = random.randint(Constants.t1-Constants.e,Constants.t1+Constants.e) if self.subsession.round_number == 2: self.signal = random.randint(Constants.t2 - Constants.e, Constants.t2 + Constants.e) if self.subsession.round_number == 3: self.signal = random.randint(Constants.t3 - Constants.e, Constants.t3 + Constants.e) if self.subsession.round_number == 4: self.signal = random.randint(Constants.t4 - Constants.e, Constants.t4 + Constants.e) if self.subsession.round_number == 5: self.signal = random.randint(Constants.t5 - Constants.e, Constants.t5 + Constants.e) if self.subsession.round_number == 6: self.signal = random.randint(Constants.t6 - Constants.e, Constants.t6 + Constants.e) if self.subsession.round_number == 7: self.signal = random.randint(Constants.t7 - Constants.e, Constants.t7 + Constants.e) if self.subsession.round_number == 8: self.signal = random.randint(Constants.t8 - Constants.e, Constants.t8 + Constants.e) if self.subsession.round_number == 9: self.signal = random.randint(Constants.t9 - Constants.e, Constants.t9 + Constants.e) if self.subsession.round_number == 10: self.signal = random.randint(Constants.t10 - Constants.e, Constants.t10 + Constants.e) if self.subsession.round_number == 11: self.signal = random.randint(Constants.t11 - Constants.e, Constants.t11 + Constants.e) if self.subsession.round_number == 12: self.signal = random.randint(Constants.t12 - Constants.e, Constants.t12 + Constants.e) if self.subsession.round_number == 13: self.signal = random.randint(Constants.t13 - Constants.e, Constants.t13 + Constants.e) if self.subsession.round_number == 14: self.signal = random.randint(Constants.t14 - Constants.e, Constants.t14 + Constants.e) if self.subsession.round_number == 15: self.signal = random.randint(Constants.t15 - Constants.e, Constants.t15 + Constants.e) if self.subsession.round_number == 16: self.signal = random.randint(Constants.t16 - Constants.e, Constants.t16 + Constants.e) if self.subsession.round_number == 17: self.signal = random.randint(Constants.t17 - Constants.e, Constants.t17 + Constants.e) if self.subsession.round_number == 18: self.signal = random.randint(Constants.t18 - Constants.e, Constants.t18 + Constants.e) if self.subsession.round_number == 19: self.signal = random.randint(Constants.t19 - Constants.e, Constants.t19 + Constants.e) if self.subsession.round_number == 20: self.signal = random.randint(Constants.t20 - Constants.e, Constants.t20 + Constants.e) def set_payoffs(self): self.others_go = len([p.go for p in self.get_others_in_group() if p.go]) if self.id_in_group == 1: if self.subsession.round_number == 1: self.go_payoff = (Constants.a_1*Constants.t1)-Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_1*Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_1*Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_1*Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_1*Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_1*Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_1*Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_1*Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_1*Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_1*Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_1*Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_1*Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_1*Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_1*Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_1*Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_1*Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_1*Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_1*Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_1*Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_1*Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 2: if self.subsession.round_number == 1: self.go_payoff = Constants.a_2*Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_2*Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_2*Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_2*Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_2*Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_2*Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_2*Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_2*Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_2*Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_2*Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_2*Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_2*Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_2*Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_2*Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_2*Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_2*Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_2*Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_2*Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_2*Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_2*Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 3: if self.subsession.round_number == 1: self.go_payoff = Constants.a_3*Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_3*Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_3*Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_3*Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_3*Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_3*Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_3*Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_3*Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_3*Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_3*Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_3*Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_3*Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_3*Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_3*Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_3*Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_3*Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_3*Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_3*Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_3*Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_3*Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 4: if self.subsession.round_number == 1: self.go_payoff = Constants.a_4*Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_4*Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_4*Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_4*Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_4*Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_4*Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_4*Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_4*Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_4*Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_4*Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_4*Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_4*Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_4*Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_4*Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_4*Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_4*Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_4*Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_4*Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_4*Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_4*Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 5: if self.subsession.round_number == 1: self.go_payoff = Constants.a_5*Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_5*Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_5*Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_5*Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_5*Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_5*Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_5*Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_5*Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_5*Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_5*Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_5*Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_5*Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_5*Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_5*Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_5*Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_5*Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_5*Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_5*Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_5*Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_5*Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 6: if self.subsession.round_number == 1: self.go_payoff = Constants.a_6*Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_6*Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_6*Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_6*Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_6*Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_6*Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_6*Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_6*Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_6*Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_6*Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_6*Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_6*Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_6*Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_6*Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_6*Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_6*Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_6*Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_6*Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_6*Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_6*Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 7: if self.subsession.round_number == 1: self.go_payoff = Constants.a_7*Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_7*Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_7*Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_7*Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_7*Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_7*Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_7*Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_7*Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_7*Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_7*Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_7*Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_7*Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_7*Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_7*Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_7*Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_7*Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_7*Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_7*Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_7*Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_7*Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 8: if self.subsession.round_number == 1: self.go_payoff = Constants.a_8 * Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_8 * Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_8 * Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_8 * Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_8 * Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_8 * Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_8 * Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_8 * Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_8 * Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_8 * Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_8 * Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_8 * Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_8 * Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_8 * Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_8 * Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_8 * Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_8 * Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_8 * Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_8 * Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_8 * Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 9: if self.subsession.round_number == 1: self.go_payoff = Constants.a_9 * Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_9 * Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_9 * Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_9 * Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_9 * Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_9 * Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_9 * Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_9 * Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_9 * Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_9 * Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_9 * Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_9 * Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_9 * Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_9 * Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_9 * Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_9 * Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_9 * Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_9 * Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_9 * Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_9 * Constants.t20 - Constants.gamma*self.others_go if self.id_in_group == 10: if self.subsession.round_number == 1: self.go_payoff = Constants.a_10 * Constants.t1 - Constants.gamma*self.others_go if self.subsession.round_number == 2: self.go_payoff = Constants.a_10 * Constants.t2 - Constants.gamma*self.others_go if self.subsession.round_number == 3: self.go_payoff = Constants.a_10 * Constants.t3 - Constants.gamma*self.others_go if self.subsession.round_number == 4: self.go_payoff = Constants.a_10* Constants.t4 - Constants.gamma*self.others_go if self.subsession.round_number == 5: self.go_payoff = Constants.a_10* Constants.t5 - Constants.gamma*self.others_go if self.subsession.round_number == 6: self.go_payoff = Constants.a_10* Constants.t6 - Constants.gamma*self.others_go if self.subsession.round_number == 7: self.go_payoff = Constants.a_10 * Constants.t7 - Constants.gamma*self.others_go if self.subsession.round_number == 8: self.go_payoff = Constants.a_10 * Constants.t8 - Constants.gamma*self.others_go if self.subsession.round_number == 9: self.go_payoff = Constants.a_10 * Constants.t9 - Constants.gamma*self.others_go if self.subsession.round_number == 10: self.go_payoff = Constants.a_10 * Constants.t10 - Constants.gamma*self.others_go if self.subsession.round_number == 11: self.go_payoff = Constants.a_10 * Constants.t11 - Constants.gamma*self.others_go if self.subsession.round_number == 12: self.go_payoff = Constants.a_10 * Constants.t12 - Constants.gamma*self.others_go if self.subsession.round_number == 13: self.go_payoff = Constants.a_10 * Constants.t13 - Constants.gamma*self.others_go if self.subsession.round_number == 14: self.go_payoff = Constants.a_10 * Constants.t14 - Constants.gamma*self.others_go if self.subsession.round_number == 15: self.go_payoff = Constants.a_10 * Constants.t15 - Constants.gamma*self.others_go if self.subsession.round_number == 16: self.go_payoff = Constants.a_10 * Constants.t16 - Constants.gamma*self.others_go if self.subsession.round_number == 17: self.go_payoff = Constants.a_10 * Constants.t17 - Constants.gamma*self.others_go if self.subsession.round_number == 18: self.go_payoff = Constants.a_10 * Constants.t18 - Constants.gamma*self.others_go if self.subsession.round_number == 19: self.go_payoff = Constants.a_10 * Constants.t19 - Constants.gamma*self.others_go if self.subsession.round_number == 20: self.go_payoff = Constants.a_10 * Constants.t20 - Constants.gamma*self.others_go #Define 3 random paying rounds if self.subsession.round_number == 1: if self.go: self.payoff = self.go_payoff else: self.payoff = Constants.home elif self.subsession.round_number == 4: if self.go: self.payoff = self.go_payoff else: self.payoff = Constants.home elif self.subsession.round_number == 5: if self.go: self.payoff = self.go_payoff else: self.payoff = Constants.home else: self.payoff = c(0)