from otree.api import Currency as cu, currency_range from . import pages from ._builtin import Bot from .models import Constants import numpy import random class PlayerBot(Bot): def play_round(self): yield (pages.Intro, { 'feedback': "this was a really great experiment", }) yield (pages.Demographics, { 'age': numpy.random.randint(18, 55), 'gender':random.choice(['Male', 'Female', 'Other']), 'ethnicity':random.choice(['White', 'Black or African American', 'American Indian or Alaska Native', 'Asian', 'Native Hawaiian or Other Pacific Islander']), 'highest_education':random.choice(['Some high school, no diploma', 'High school graduate, diploma or the equivalent (for example: GED)', 'Some college credit, no degree', 'Trade/technical/vocational training', 'Associate degree', 'Bachelor’s degree', 'Master’s degree', 'Professional degree', 'Doctorate degree']), 'marital_status':random.choice(['Not Married', 'Married or Domestic Partnership', 'Widowed', 'Divorced']), 'employment_status':random.choice(['Employed for wages', 'Self-employed', 'Out of work and looking for work', 'Out of work but not currently looking for work', 'A homemaker', 'A student', 'Military', 'Retired', 'Unable to work', 'Other']), 'state':random.choice(['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Puerto Rico', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'Washington, D.C.', 'West Virginia', 'Wisconsin', 'Wyoming']), }) yield (pages.Inconsistencies, { 'workExperienceInc': numpy.random.randint(0, 2), 'educationInc': numpy.random.randint(0, 2), 'health': numpy.random.randint(0, 2), 'crime': numpy.random.randint(0, 2), 'discrimination': numpy.random.randint(0, 2) }) yield (pages.ImportantFactors, { 'teams': numpy.random.randint(1, 11), 'communicate': numpy.random.randint(1, 11), 'administration': numpy.random.randint(1, 11), 'customerService': numpy.random.randint(1, 11), 'ITskills': numpy.random.randint(1, 11), 'experience': numpy.random.randint(1, 11), 'education': numpy.random.randint(1, 11), 'hobbies': numpy.random.randint(1, 11), 'CVcontents': numpy.random.randint(1, 11), 'SMcontents': numpy.random.randint(1, 11) }) yield (pages.PoliticsGSS, { 'lib_con': numpy.random.randint(1, 8), }) yield (pages.SocialMedia1, { 'Twitter': numpy.random.randint(1, 8), 'Instagram': numpy.random.randint(1, 8), 'Facebook': numpy.random.randint(1, 8), 'Snapchat': numpy.random.randint(1, 8), 'LinkedIn': numpy.random.randint(1, 8), 'TikTok': numpy.random.randint(1, 8) }) yield (pages.SocialMedia2, { 'stayintouch': numpy.random.randint(1, 8), 'toomuchtime': numpy.random.randint(1, 8), 'potentialemployers': numpy.random.randint(1, 8), 'professional': numpy.random.randint(1, 8) }) yield (pages.Privacy, { 'lostControl': numpy.random.randint(1, 8), 'advertisers': numpy.random.randint(1, 8), 'employers': numpy.random.randint(1, 8) })