-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_settings.py
157 lines (127 loc) · 8.75 KB
/
user_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# coding=utf-8
from otree.api import (
models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer,
)
import pandas as pd
import csv
class Constants(BaseConstants):
# ============================================================================================================= #
# #
# DESIGN SETUP #
# #
# ============================================================================================================= #
# NUMBER OF PLAYERS =========================================================================== #
# Please specify how many players per market will participate. #
players_per_group = 4
# VALUATION VECTORS =========================================================================== #
# Different player types can have different valuation vectors for resources. Set the #
# valuation vectors for each type and resource (Please keep in mind that the number of value #
# vectors has to be a number that is completely divisible by the variable #
# "players_per_group"). E.g., if the market has three types and six resources, set the first #
# six values within the list for a type to a number. Please stick to the scheme below. #
# This app supports up to 10 types and 10 resources. Types are generated by id_in_group. #
# This means that if you have 4 players and 2 types, players 1 and 2 are Type1, and #
# players 3 and 4 are Type2. #
val8_t1 = [18, 13, 8, 3]
val8_t2 = [13, 18, 3, 8]
val8_t3 = [8, 18, 13, 3]
val8_t4 = [13, 18, 3, 8]
# Set vectors for multiple types in the following way:
# valuations_t2 = [85, 2, 2, 80, 50, 80, 80, 30, 80, 80]
# valuations_t3 = [85, 2, 2, 80, 50, 80, 80, 30, 80, 80]
# valuations_t4 = [85, 2, 2, 80, 50, 80, 80, 30, 80, 80]
# ...
# PRIORITIES OF RESOURCES OVER PARTICIPANTS =================================================== #
# Since this app models only the proposing side as active players, the priorities of the #
# resources over the players have to be specified. Please assign a priority vector for every #
# resource. The length of each vector has to be equal to the number of players specified #
# above. The structure is [<Player with Priority 1>, <Player with Priority 2>, ...] #
#prio8_r1 = [1, 2, 3, 4]
#prio8_r2 = [1, 2, 3, 4]
#prio8_r3 = [1, 2, 3, 4]
#prio8_r4 = [1, 2, 3, 4]
prio8_r1 = [4, 1, 3, 2]
prio8_r2 = [1, 3, 2, 4]
prio8_r3 = [2, 1, 3, 4]
prio8_r4 = [3, 1, 2, 4]
# Set vectors for multiple resources in the following way:
# priorities_r2 = [1, 2]
# priorities_r3 = [1, 2]
# ...
# RESOURCE CAPACITIES ========================================================================= #
# Set the quota of players that each resource can carry. Fill in as many number as in the #
# valuation vectors. #
capacities = [1, 1, 1, 1]
# ============================================================================================================= #
# #
# APPEARANCE SETTINGS #
# #
# ============================================================================================================= #
# FRAMING ===================================================================================== #
# Here you can choose between a neutral framing (participants/resources) and a application #
# framing (participants/schools). #
application_framing = True
# SHOW INSTRUCTIONS =========================================================================== #
# Should the instructions for the mechanism be included? #
instructions = False
# SHOW EXAMPLE IN INSTRUCTIONS ================================================================ #
# If "instructions = True", should the instructions also include a minimal example of the #
# mechanism in place? #
instructions_example = False
# SHOW CONFIRM BUTTON ========================================================================= #
# If "confirm_button" is set to "True", players will have to confirm their inputs made on #
# Decision.html to. This can be used to avoid accidental submission of the page. #
confirm_button = False
# SHOW RESULTS ================================================================================ #
# Should a results screen be included? The results screen shows a summary of results of the #
# market (i.e., preferences submitted, bids made, clearing bids, allotted resources), and the #
# final payoff for the player. #
results = True
# ============================================================================================================= #
# #
# INFORMATION SETTINGS #
# #
# ============================================================================================================= #
# SHOW CAPACITIES ============================================================================= #
# If set to "True", the quota specified in "capacities" above will be shown to players on the #
# decision screen and in the instructions. #
show_capacities = False
# SHOW TYPES ================================================================================== #
# If "show_types" is set to "True", players will have a hint on the decision page and in the #
# instructions that there are different types of players in the market. Only works if #
# multiple type vectors have been specified above. #
show_types = True
# SHOW OTHERS' VALUATIONS ===================================================================== #
# Should players see the other players' valuation profiles and on the decision page? Only #
# works if "show_types" has been set to "True" above. #
show_val8 = True
# SHOW RESOURCES' PRIORITIES ================================================================== #
# Should a player see the resources' priorities for her in the instructions and on the #
# decision page? #
show_prio8 = False
####################################################################################################################
####################################################################################################################
# ------------------------------ DO NOT MODIFY BELOW HERE ------------------------------ #
####################################################################################################################
####################################################################################################################
capacities = [i for i in capacities if i is not None]
nr_courses = len(capacities)
val8_list = ["val8_t" + str(i) for i in range(1, 11)]
val8_raw = []
for i in val8_list:
if i in locals():
val8_raw.append(locals()[i])
val8 = []
for i in val8_raw:
val8.append([j for j in i if j is not None])
prio8_list = ["prio8_r" + str(i) for i in range(1, 11)]
prio8_raw = []
for i in prio8_list:
if i in locals():
prio8_raw.append(locals()[i])
prio8 = []
for i in prio8_raw:
prio8.append([j for j in i if j is not None])
nr_types = len(val8)
name_in_url = "SHttc8"
num_rounds = 1