import random from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'Jorge Castro' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'Cartasdemo' players_per_group = None num_rounds = 1 A = [["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","d2"],["d1","a2"],["b1","c2"],["c1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","d2"],["d1","a2"],["b1","c2"],["c1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","d2"],["d1","a2"],["b1","c2"],["c1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","d2"],["d1","a2"],["b1","c2"],["c1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","c2"],["c1","a2"],["b1","d2"],["d1","b2"],["a1","d2"],["d1","a2"],["b1","c2"],["c1","b2"]] O = list(range(0, 100)) B = [["T1","T2", "T3", "T4"],["T1", "T3", "T2", "T4"],["T2", "T3", "T1", "T4"],["T1", "T4", "T2", "T3"],["T2", "T4", "T1", "T3"],["T3", "T4", "T1", "T2"]] Bbc = [["b1","d2", "c2", "a1"],["b1", "c2", "d2", "a1"],["d2", "c2", "b1", "a1"],["b1", "a1", "d2", "c2"],["d2", "a1", "b1", "c2"],["c2", "a1", "b1", "d2"]] Bbd = [["b1", "c2", "d2", "a1"],["b1", "d2", "c2", "a1"],["c2", "d2", "b1", "a1"],["b1", "a1", "c2", "d2"],["c2", "a1", "b1", "d2"],["d2", "a1", "b1", "c2"]] Bac = [["a1", "d2", "c2", "b1"],["a1", "c2", "d2", "b1"],["d2", "c2", "a1", "b1"],["a1", "b1", "d2", "c2"],["d2", "b1", "a1", "c2"],["c2", "b1", "a1", "d2"]] Bad = [["a1", "c2", "d2", "b1"],["a1", "d2", "c2", "b1"],["c2", "d2", "a1", "b1"],["a1", "b1", "c2", "d2"],["c2", "b1", "a1", "d2"],["d2", "b1", "a1", "c2"]] Bcb = [["c1", "a2", "b2", "d1"],["c1", "b2", "a2", "d1"],["a2", "b2", "c1", "d1"],["c1", "d1", "a2", "b2"],["a2", "d1", "c1", "b2"],["b2", "d1", "c1", "a2"]] Bca = [["c1", "b2", "a2", "d1"],["c1", "a2", "b2", "d1"],["b2", "a2", "c1", "d1"],["c1", "d1", "b2", "a2"],["b2", "d1", "c1", "a2"],["a2", "d1", "c1", "b2"]] Bdb = [["d1", "a2", "b2", "c1"],["d1", "b2", "a2", "c1"],["a2", "b2", "d1", "c1"],["d1", "c1", "a2", "b2"],["a2", "c1", "d1", "b2"],["b2", "c1", "d1", "a2"]] Bda = [["d1", "b2", "a2", "c1"],["d1", "a2", "b2", "c1"],["b2", "a2", "d1", "c1"],["d1", "c1", "b2", "a2"],["b2", "c1", "d1", "a2"],["a2", "c1", "d1", "b2"]] random.shuffle(O) pass class Subsession(BaseSubsession): def creating_session(self): self.session.vars['c1'] = [random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1)] self.session.vars['c2'] = [random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1)] self.session.vars['c3'] = [random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1)] self.session.vars['c4'] = [random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1),random.uniform(0, 1)] for p in self.get_players(): p.payoff = c(10) if self.round_number == 1: self.session.vars['ronda'] = random.randint(1, 6) p.participant.vars['loteria'] = random.uniform(0, 1) p.loteria = p.participant.vars['loteria'] p.participant.vars['orden'] = list(range(0, 6)) random.shuffle(p.participant.vars['orden']) def final_payoffs(self): if self.round_number == self.session.vars['ronda']: self.session.vars['votosKa'] = 0 self.session.vars['votosKe'] = 0 for p in self.get_players(): self.session.vars['votosKa'] = p.in_round(self.round_number).Decision_carta1 + p.in_round( self.round_number).Decision_carta2 + self.session.vars['votosKa'] self.session.vars['votosKe'] = p.in_round(self.round_number).Decision_carta3 + p.in_round( self.round_number).Decision_carta4 + self.session.vars[ 'votosKe'] p.participant.vars['votosKa'] = p.in_round(self.round_number).Decision_carta1 + p.in_round( self.round_number).Decision_carta2 p.participant.vars['votosKe'] = p.in_round(self.round_number).Decision_carta3 + p.in_round( self.round_number).Decision_carta4 for p in self.get_players(): p.participant.vars['pago'] = p.payoff if p.participant.vars['grupo'] == "Kandisky": p.bonus = (p.session.vars['votosKa'] - p.participant.vars['votosKa']) / 8 elif p.participant.vars['grupo'] == "Klee": p.bonus = (p.session.vars['votosKe'] - p.participant.vars['votosKe']) / 8 if p.bonus > p.participant.vars['loteria']: p.participant.vars['bonus'] = 1 else: p.participant.vars['bonus'] = 0 pass class Group(BaseGroup): pass class Player(BasePlayer): Decision_carta1 = models.BooleanField( choices=[ [False, 'No voltear'], [True, 'Voltear'], ] ) Decision_carta2 = models.BooleanField( choices=[ [False, 'No voltear'], [True, 'Voltear'], ] ) Decision_carta3 = models.BooleanField( choices=[ [False, 'No voltear'], [True, 'Voltear'], ] ) Decision_carta4 = models.BooleanField( choices=[ [False, 'No Voltear'], [True, 'Voltear'], ] ) Encuestado = models.StringField( choices=[ ['a1', 'Bogotá'], ['b1', 'Cartagena'], ['c1', 'Miami'], ['d1', 'Nueva York'], ] ) familia = models.StringField( choices=[ ['a2', 'Bogotá'], ['b2', 'Cartagena'], ['c2', 'Miami'], ['d2', 'Nueva York'], ] ) procedencia2 = models.StringField() familia2 = models.StringField() Tipo_carta1 = models.StringField() Tipo_carta2 = models.StringField() Tipo_carta3 = models.StringField() Tipo_carta4 = models.StringField() Decision_final = models.BooleanField( choices=[ [False, 'Falso'], [True, 'Verdadero'], ] ) p1 = models.IntegerField(min=2, max=18) p2 = models.StringField( choices=[ ['a2', 'Bogotá y Cartagena'], ['b2', 'Cartagena y Miami'], ['c2', 'Miami y Nueva York'], ['d2', 'Nueva York y Bogotá'], ] ) p3 = models.BooleanField( choices=[ [False, 'Falso'], [True, 'Verdadero'], ] ) Orden = models.IntegerField() confianza = models.IntegerField(min=1, max=10) loteria = models.FloatField() bonus = models.FloatField() Ct1 = models.FloatField() Ct2 = models.FloatField() Ct3 = models.FloatField() Ct4 = models.FloatField() def set_payoffs(self): self.Ct1 = self.session.vars['c1'][self.round_number - 1] self.Ct2 = self.session.vars['c2'][self.round_number - 1] self.Ct3 = self.session.vars['c3'][self.round_number - 1] self.Ct4 = self.session.vars['c4'][self.round_number - 1] self.Orden = self.participant.vars['orden'][self.round_number - 1] if self.Decision_carta1 == True: self.payoff = self.payoff - 2 else: self.payoff = self.payoff if self.Decision_carta2 == True: self.payoff = self.payoff - 2 else: self.payoff = self.payoff if self.Decision_carta3 == True: self.payoff = self.payoff - 2 else: self.payoff = self.payoff if self.Decision_carta4 == True: self.payoff = self.payoff - 2 else: self.payoff = self.payoff if self.participant.vars['orden'][self.round_number - 1] == 0: if self.Decision_final == True: if ((self.Encuestado == "a1" and self.familia == "c2" and self.session.vars['c1'][self.round_number - 1] < 0.8 and self.session.vars['c2'][self.round_number - 1] < 0.8) or (self.Encuestado == "a1" and self.familia == "d2" and self.session.vars['c1'][self.round_number - 1] >= 0.8 and self.session.vars['c2'][self.round_number - 1] >= 0.8) or (self.Encuestado == "b1" and self.familia == "d2" and self.session.vars['c1'][self.round_number - 1] < 0.8 and self.session.vars['c2'][self.round_number - 1] < 0.8) or (self.Encuestado == "b1" and self.familia == "c2" and self.session.vars['c1'][self.round_number - 1] >= 0.8 and self.session.vars['c2'][self.round_number - 1] >= 0.8) or (self.Encuestado == "c1" and self.familia == "a2" and self.session.vars['c1'][self.round_number - 1] < 0.8 and self.session.vars['c2'][self.round_number - 1] < 0.8) or (self.Encuestado == "c1" and self.familia == "b2" and self.session.vars['c1'][self.round_number - 1] >= 0.8 and self.session.vars['c2'][self.round_number - 1] >= 0.8) or (self.Encuestado == "d1" and self.familia == "b2" and self.session.vars['c1'][self.round_number - 1] < 0.8 and self.session.vars['c2'][self.round_number - 1] < 0.8) or (self.Encuestado == "d1" and self.familia == "a2" and self.session.vars['c1'][self.round_number - 1] >= 0.8 and self.session.vars['c2'][self.round_number - 1] >= 0.8)): self.payoff = self.payoff + 8 else: self.payoff = self.payoff if self.Decision_final == False: if ((self.Encuestado == "a1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c2'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "a1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c2'][self.round_number - 1] < 0.8)) or (self.Encuestado == "b1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c2'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "b1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c2'][self.round_number - 1] < 0.8)) or (self.Encuestado == "c1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c2'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "c1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c2'][self.round_number - 1] < 0.8)) or (self.Encuestado == "d1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c2'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "d1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c2'][self.round_number - 1] < 0.8))): self.payoff = self.payoff + 8 else: self.payoff = self.payoff elif self.participant.vars['orden'][self.round_number - 1] == 1: if self.Decision_final == True: if ((self.Encuestado == "a1" and self.familia == "c2" and self.session.vars['c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "a1" and self.familia == "d2" and self.session.vars['c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "b1" and self.familia == "d2" and self.session.vars['c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "b1" and self.familia == "c2" and self.session.vars['c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "c1" and self.familia == "a2" and self.session.vars['c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "c1" and self.familia == "b2" and self.session.vars['c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "d1" and self.familia == "b2" and self.session.vars['c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "d1" and self.familia == "a2" and self.session.vars['c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8)): self.payoff = self.payoff + 8 else: self.payoff = self.payoff if self.Decision_final == False: if ((self.Encuestado == "a1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "a1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8)) or (self.Encuestado == "b1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "b1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8) )or (self.Encuestado == "c1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "c1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8)) or (self.Encuestado == "d1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "d1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8))): self.payoff = self.payoff + 8 else: self.payoff = self.payoff elif self.participant.vars['orden'][self.round_number - 1] == 2: if self.Decision_final == True: if ((self.Encuestado == "a1" and self.familia == "c2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "a1" and self.familia == "d2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "b1" and self.familia == "d2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "b1" and self.familia == "c2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "c1" and self.familia == "a2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "c1" and self.familia == "b2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "d1" and self.familia == "b2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "d1" and self.familia == "a2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8)): self.payoff = self.payoff + 8 else: self.payoff = self.payoff if self.Decision_final == False: if ((self.Encuestado == "a1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "a1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8)) or (self.Encuestado == "b1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "b1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8) )or (self.Encuestado == "c1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "c1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8)) or (self.Encuestado == "d1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "d1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8))): self.payoff = self.payoff + 8 else: self.payoff = self.payoff elif self.participant.vars['orden'][self.round_number - 1] == 3: if self.Decision_final == True: if ((self.Encuestado == "a1" and self.familia == "c2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "a1" and self.familia == "d2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "b1" and self.familia == "d2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "b1" and self.familia == "c2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "c1" and self.familia == "a2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "c1" and self.familia == "b2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "d1" and self.familia == "b2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "d1" and self.familia == "a2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8)): self.payoff = self.payoff + 8 else: self.payoff = self.payoff if self.Decision_final == False: if ((self.Encuestado == "a1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "a1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8)) or (self.Encuestado == "b1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "b1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8) )or (self.Encuestado == "c1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "c1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8)) or (self.Encuestado == "d1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "d1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8))): self.payoff = self.payoff + 8 else: self.payoff = self.payoff elif self.participant.vars['orden'][self.round_number - 1] == 4: if self.Decision_final == True: if ((self.Encuestado == "a1" and self.familia == "c2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "a1" and self.familia == "d2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "b1" and self.familia == "d2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "b1" and self.familia == "c2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "c1" and self.familia == "a2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "c1" and self.familia == "b2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8) or (self.Encuestado == "d1" and self.familia == "b2" and self.session.vars[ 'c1'][self.round_number - 1] < 0.8 and self.session.vars['c3'][self.round_number - 1] < 0.8) or (self.Encuestado == "d1" and self.familia == "a2" and self.session.vars[ 'c1'][self.round_number - 1] >= 0.8 and self.session.vars['c3'][self.round_number - 1] >= 0.8)): self.payoff = self.payoff + 8 else: self.payoff = self.payoff if self.Decision_final == False: if ((self.Encuestado == "a1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "a1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8)) or (self.Encuestado == "b1" and self.familia == "d2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "b1" and self.familia == "c2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8) )or (self.Encuestado == "c1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "c1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8)) or (self.Encuestado == "d1" and self.familia == "b2" and (self.session.vars['c1'][self.round_number - 1] >= 0.8 or self.session.vars['c3'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "d1" and self.familia == "a2" and (self.session.vars['c1'][self.round_number - 1] < 0.8 or self.session.vars['c3'][self.round_number - 1] < 0.8))): self.payoff = self.payoff + 8 else: self.payoff = self.payoff elif self.participant.vars['orden'][self.round_number - 1] == 5: if self.Decision_final == True: if ((self.Encuestado == "a1" and self.familia == "c2" and self.session.vars[ 'c3'][self.round_number - 1] < 0.8 and self.session.vars['c4'][self.round_number - 1] < 0.8) or (self.Encuestado == "a1" and self.familia == "d2" and self.session.vars[ 'c3'][self.round_number - 1] >= 0.8 and self.session.vars['c4'][self.round_number - 1] >= 0.8) or (self.Encuestado == "b1" and self.familia == "d2" and self.session.vars[ 'c3'][self.round_number - 1] < 0.8 and self.session.vars['c4'][self.round_number - 1] < 0.8) or (self.Encuestado == "b1" and self.familia == "c2" and self.session.vars[ 'c3'][self.round_number - 1] >= 0.8 and self.session.vars['c4'][self.round_number - 1] >= 0.8) or (self.Encuestado == "c1" and self.familia == "a2" and self.session.vars[ 'c3'][self.round_number - 1] < 0.8 and self.session.vars['c4'][self.round_number - 1] < 0.8) or (self.Encuestado == "c1" and self.familia == "b2" and self.session.vars[ 'c3'][self.round_number - 1] >= 0.8 and self.session.vars['c4'][self.round_number - 1] >= 0.8) or (self.Encuestado == "d1" and self.familia == "b2" and self.session.vars[ 'c3'][self.round_number - 1] < 0.8 and self.session.vars['c4'][self.round_number - 1] < 0.8) or (self.Encuestado == "d1" and self.familia == "a2" and self.session.vars[ 'c3'][self.round_number - 1] >= 0.8 and self.session.vars['c4'][self.round_number - 1] >= 0.8)): self.payoff = self.payoff + 8 else: self.payoff = self.payoff if self.Decision_final == False: if ((self.Encuestado == "a1" and self.familia == "c2" and (self.session.vars['c3'][self.round_number - 1] >= 0.8 or self.session.vars['c4'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "a1" and self.familia == "d2" and (self.session.vars['c3'][self.round_number - 1] < 0.8 or self.session.vars['c4'][self.round_number - 1] < 0.8)) or (self.Encuestado == "b1" and self.familia == "d2" and (self.session.vars['c3'][self.round_number - 1] >= 0.8 or self.session.vars['c4'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "b1" and self.familia == "c2" and (self.session.vars['c3'][self.round_number - 1] < 0.8 or self.session.vars['c4'][self.round_number - 1] < 0.8) )or (self.Encuestado == "c1" and self.familia == "a2" and (self.session.vars['c3'][self.round_number - 1] >= 0.8 or self.session.vars['c4'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "c1" and self.familia == "b2" and (self.session.vars['c3'][self.round_number - 1] < 0.8 or self.session.vars['c4'][self.round_number - 1] < 0.8)) or (self.Encuestado == "d1" and self.familia == "b2" and (self.session.vars['c3'][self.round_number - 1] >= 0.8 or self.session.vars['c4'][self.round_number - 1] >= 0.8)) or (self.Encuestado == "d1" and self.familia == "a2" and (self.session.vars['c3'][self.round_number - 1] < 0.8 or self.session.vars['c4'][self.round_number - 1] < 0.8))): self.payoff = self.payoff + 8 else: self.payoff = self.payoff pass