from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, # Currency as c, currency_range Currency as c, ) import random doc = """ This is an iterated Prisoner's Dilemma where players play against a computer player that executes a particular strategy. """ class Constants(BaseConstants): name_in_url = 'name' players_per_group = None # players_per_group = 1 num_rounds = 1 rounds_per_session = 15 instructions_template = 'name/instructions.html' # payoff if 1 player defects and the other cooperates""", betray_payoff = c(300) betrayed_payoff = c(0) # payoff if both players cooperate or both defect both_cooperate_payoff = c(200) both_defect_payoff = c(50) class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): name = models.StringField( label='What is your fictitious name?' )