#
from otree.api import Currency as c
from otree.constants import BaseConstants
# import numpy as np
#
# ******************************************************************************************************************** #
# *** CLASS CONSTANTS *** #
# ******************************************************************************************************************** #
class Constants(BaseConstants):
# prospect (x,px%; y, (100-px)%) vs. sure_payoff
lottery_x = [[100, 100, 100, 100, 100, 100],
[-30, -30, -30, -30, -30, -30]]
lottery_y = [[0, 0, 0, 0, 0, -20],
[0, 0, 0, 0, 0, 30]]
lottery_px = [[50, 30, 70, 10, 90, 50],
[50, 30, 70, 10, 90, 50]]
sure_payoffs = [ # sure payoffs for all sets of lotteries
[[0, 22, 38, 46, 50, 54, 62, 78, 100], # p =50%
[0, 18, 26, 30, 34, 42, 58, 78, 100], # p =30%
[0, 22, 42, 58, 66, 70, 74, 82, 100], # p =70%
[0, 6, 10, 14, 22, 38, 56, 76, 100], # p =10%
[0, 24, 44, 62, 78, 86, 90, 94, 100], # p =90%
# [-30, 0, 8, 16, 20, 24, 32, 50, 100], # p =50%, mixed prospect
[-20, 2, 18, 26, 30, 34, 42, 60, 100]], # p =50%, mixed prospect
[[-30, -23, -19, -17, -15, -13, -11, -7, 0], # p =50%
[-30, -23, -17, -13, -11, -9, -7, -5, 0], # p =30%
[-30, -25, -23, -21, -19, -17, -13, -6, 0], # p =70%
[-30, -22, -15, -11, -7, -5, -3, -2, 0], # p =10%
[-30, -28, -27, -25, -23, -19, -13, -8, 0], #p =90%
[-20, -15, -10, -8, -6, -3, 0, 4, 10]] # p =50%, mixed prospect
]
# determines how many choices between a lottery and a sure payoff shall be implemented
num_choices = len(sure_payoffs[0][0])
num_rounds = len([item for sublist in lottery_px for item in sublist])
num_sets = len(lottery_px)
num_rounds_in_set = len(lottery_px[0])
# number of decision situations in each set that are payoff relevant
num_paying_rounds = 2
# initial endowment (in currency units set in settings.py)
# defines an additional endowment for the task to capture potential losses if
# if no additional endowment should be implemented, set to 0
endowment = 0
# ---------------------------------------------------------------------------------------------------------------- #
# --- Overall Settings and Appearance --- #
# ---------------------------------------------------------------------------------------------------------------- #
# enforce consistency, i.e. only allow for a single switching point
# if , all options "A" above a selected option "A" are automatically selected
# similarly, all options "B" below a selected option "B" are automatically checked, implying consistent choices
# note that is only implemented if and
enforce_consistency = True
# show instructions page
# if , a separate template "Instructions.html" is rendered prior to the task
# if , the task starts immediately (e.g. in case of printed instructions)
instructions = True
# show results page summarizing the task's outcome including payoff information
# if , a separate page containing all relevant information is displayed after finishing the task
# if , the template "Decision.html" will not be rendered
results = True
# ---------------------------------------------------------------------------------------------------------------- #
# --- oTree Settings (Don't Modify) --- #
# ---------------------------------------------------------------------------------------------------------------- #
name_in_url = 'cem'
players_per_group = None