import itertools import time from datetime import datetime import schedule from otree.api import * c = Currency doc = """ Your app description """ job_idx = itertools.count() jobs = [] class Constants(BaseConstants): name_in_url = 'ContOneRound' # instructions_template = 'livepages/Introduction.html' players_per_group = 2 num_rounds = 1 # Zeitangaben Spiel len_total = 5*60 len_phase_1 = 3*60 time_investment = 60 # Payout Phase 1 Incumbent tolerates payout_entrant_invest_tolerate_1 = -5 payout_entrant_ninvest_tolerate_1 = 0 payout_incumbent_invest_tolerate_1 = 3 payout_incumbent_ninvest_tolerate_1 = 3 # Payout Phase 1 Incumbent fights payout_entrant_invest_fight_1 = -9 payout_entrant_ninvest_fight_1 = 0 payout_incumbent_invest_fight_1 = 1 payout_incumbent_ninvest_fight_1 = 2 # Payout Phase 2 payout_incumbent_invest_2 = 2 payout_incumbent_n_invest_2 = 3 payout_entrant_invest_2 = 2 payout_entrant_n_invest_2 = 0 class Subsession(BaseSubsession): pass # Variables for the whole group # Those variables are transferred into Excel by default class Group(BaseGroup): # Action of the incubent. Either "TOLERATE" or "FIGHT" inc_action = models.StringField(initial="") # Incubent payout in nanos of a monetary unit inc_payout = models.FloatField(initial=0) # Action of the entrant. Either "IN" or "OUT" ent_action = models.StringField(initial="") # Entrant payout in nanos of a monetary unit ent_payout = models.FloatField(initial=0) # Payout definitions which are relevant for the excel final_payout_inc_1 = models.FloatField() final_payout_ent_1 = models.FloatField() final_payout_inc_2 = models.FloatField() final_payout_ent_2 = models.FloatField() final_payout_ent = models.FloatField() final_payout_inc = models.FloatField() # Length of Phase 1 and Phase 2 which are relevant for the excel final_len_1 = models.FloatField() final_len_2 = models.FloatField() # Initial choice of Entrant and Incumbent which are relevant for the excel init_ent_action = models.StringField() init_inc_action = models.StringField() # Mark a flag whether a new action was choosen flag = models.FloatField(initial=1) flag_counter = models.FloatField(initial=0) # Boolen variable for game started and ended game_ended = models.BooleanField(initial=False) game_started = models.BooleanField(initial=False) # Updates the payout last_payout_update = models.StringField(initial="0") game_started_at = models.StringField(initial="0") end_phase_1 = models.StringField(initial="0") # Timer for the chain store game auction_timeout = models.FloatField(initial=0) # Variable specifies how long the entrant invested in the market ent_invest = models.FloatField(initial=0) ent_invest_until_in = models.FloatField(initial=Constants.time_investment) update_job_idx = models.IntegerField(initial=0) final_ent_invest = models.FloatField(initial=0) ent_is_payoff = models.IntegerField(initial=0) inc_is_payoff = models.IntegerField(initial=0) #Help Variable for Custom Export count_inv_tol = models.FloatField(initial=0) count_inv_fight = models.FloatField(initial=0) count_ninv_tol = models.FloatField(initial=0) count_ninv_fight = models.FloatField(initial=0) count_strategycomb = models.FloatField(initial=0) # Variable for customExport export_game = models.StringField(initial="[") export_inv_tol = models.StringField(initial="[") export_inv_fight = models.StringField(initial="[") export_ninv_tol = models.StringField(initial="[") export_ninv_fight = models.StringField(initial="[") export_time_until_entry = models.StringField(initial="[") export_time_counter = models.StringField(initial="[") export_ent_action = models.StringField(initial="[") export_inc_action = models.StringField(initial="[") export_ent_payoff_overall = models.StringField(initial="[") export_inc_payoff_overall = models.StringField(initial="[") export_ent_payoff_current = models.StringField(initial="[") export_inc_payoff_current = models.StringField(initial="[") export_welfare_current = models.StringField(initial="[") export_welfare_overall = models.StringField(initial="[") export_flag = models.StringField(initial="[") current_time = models.FloatField(initial=0) export_phase = models.StringField(initial="[") export_gamenum = models.StringField(initial="[") #Variables for Reputation reputation_proportion_inv = models.IntegerField(initial=0) reputation_proportion_fight = models.IntegerField(initial=0) reputation_marketentry = models.StringField() reputation_len_phase1 = models.StringField() reputation_proportion_fight_60s = models.IntegerField(initial=0) reputation_fight_60s = models.BooleanField(initial=True) # Call all relevant variables from the group def get_state(group: Group): return dict( # Relevant variables for incumbent inc_action=group.inc_action, inc_payout=group.inc_payout, # Relevant variables for entrant ent_action=group.ent_action, ent_payout=group.ent_payout, # Flag flag=group.flag, # Investment of entrant ent_invest=group.ent_invest, ent_invest_until_in=group.ent_invest_until_in, game_started_at=group.game_started_at, end_phase_1=group.end_phase_1, # Variable if game already ends game_ended=group.game_ended ) def get_current_payout(group: Group): # Determines the current payout for the set of selected actions for incubent and entrant if group.inc_action == "TOLERATE": if group.ent_action == "IN": return dict(ent=Constants.payout_entrant_invest_tolerate_1, inc=Constants.payout_incumbent_invest_tolerate_1, time=1) else: return dict(ent=Constants.payout_entrant_ninvest_tolerate_1, inc=Constants.payout_incumbent_ninvest_tolerate_1, time=0) else: if group.ent_action == "IN": return dict(ent=Constants.payout_entrant_invest_fight_1, inc=Constants.payout_incumbent_invest_fight_1, time=1) else: return dict(ent=Constants.payout_entrant_ninvest_fight_1, inc=Constants.payout_incumbent_ninvest_fight_1, time=0) def get_current_strategycomb(group: Group): # Determines the current strategy combination for the set of selected actions for incubent and entrant if group.inc_action == "TOLERATE": if group.ent_action == "IN": return dict(inv_tol=1, inv_fight=0, ninv_tol=0, ninv_fight=0 ) else: return dict(inv_tol=0, inv_fight=0, ninv_tol=1, ninv_fight=0 ) else: if group.ent_action == "IN": return dict(inv_tol=0, inv_fight=1, ninv_tol=0, ninv_fight=0 ) else: return dict(inv_tol=0, inv_fight=0, ninv_tol=0, ninv_fight=1 ) # Group players randomly after every round def creating_session(subsession): subsession.group_randomly(fixed_id_in_group=True) print(subsession.get_group_matrix()) class Player(BasePlayer): # Necessary variables for Questions in Phase 1 payoff_I = models.IntegerField(label="Wie hoch ist deine sekündliche Auszahlung? ") payoff_E = models.IntegerField(label="Wie hoch ist die sekündliche Auszahlung des Entrants? ") payoff_I2 = models.IntegerField(label="Wie hoch ist deine Auszahlung insgesamt nach 40 Sekunden? ") length = models.IntegerField(label="Wie viele Sekunden muss der Entrant die Strategie 'Investieren' wählen, um" " einen Markteintritt zu realisieren? ") # Necessary variables for Questions in Phase 2 length_2 = models.IntegerField(label="Welche Länge hat Phase 2 in Sekunden?") payoff_2_I1 = models.IntegerField(label="Was ist deine sekündliche Auszahlung in Phase 2?") payoff_2_I2 = models.IntegerField(label="Was ist deine gesamte Auszahlung in Phase 2?") # Variable to examine the amount of right answers right_answers = models.IntegerField(initial=0) class InitDecision(Page): # Transfers the player id to javascript @staticmethod def js_vars(player: Player): return dict( my_id=player.id_in_group, ) # Optional to inform the player about the initial decision @staticmethod def vars_for_template(player: Player): group = player.group return dict( round_num=player.round_number, int_action=group.inc_action, ent_action=group.ent_action, GameNumber=player.session.GameNumber ) # Transfers from javascript the initial id @staticmethod def live_method(player: Player, value): group = player.group my_id = player.id_in_group if my_id == 1: group.ent_action = value else: group.inc_action = value return {0: group.ent_action, 0: group.inc_action} class InitDecisionWaitPage(WaitPage): wait_for_all_groups = True class InitDecision_Result(Page): @staticmethod def vars_for_template(player: Player): group = player.group return dict( inc_action=group.inc_action, ent_action=group.ent_action, GameNumber=player.session.GameNumber ) class GameOverview(Page): @staticmethod def is_displayed(player): return player.session.GameNumber == 2 def vars_for_template(player: Player): return dict( GameNumber=player.session.GameNumber ) class WaitToStart(WaitPage): @staticmethod def after_all_players_arrive(group: Group): # Safe Data in init ent acton group.init_ent_action = group.ent_action group.init_inc_action = group.inc_action # Time as a floating point number expressed in nanoseconds since the epoch group.last_payout_update = str(time.time_ns()) # Time as a floating point number expressed in seconds since the epoch group.auction_timeout = time.time() + Constants.len_phase_1 group.game_started = True group.game_started_at = str(time.time_ns()) update_payout(group) #idx = next(job_idx) #jobs.append(0) #jobs[idx] = (schedule.every(1).seconds.do(lambda _: update_payout(group))) #group.update_job_idx = idx # Method is called every 100ms def update_payout(group: Group): if group.game_started == False or group.game_ended == True: return # Time now now = time.time_ns() # Gets the time of the last payout update last_payout_update = group.last_payout_update # Refresh the last payout update group.last_payout_update = str(now) # Get the current payout from the cells of the game in a dictionary (e.g.: inc=5, ent=1) current_payout = get_current_payout(group) # To avoid field size conflicts, we store the timestamp as as string which needs to be converted # to a number first last_payout_update_parsed = int(last_payout_update) # Difference between last payout update and now nanos = now - last_payout_update_parsed seconds = nanos / 1000000000. # Multiply the current payout with the last time the page was refreshed group.inc_payout = group.inc_payout + (current_payout['inc'] * seconds) group.ent_payout = group.ent_payout + (current_payout['ent'] * seconds) group.ent_invest = group.ent_invest + (current_payout['time'] * seconds) group.ent_invest_until_in = Constants.time_investment - group.ent_invest # Count StrategyComb strategy_comb = get_current_strategycomb(group) group.count_inv_tol += strategy_comb['inv_tol'] * seconds group.count_inv_fight += strategy_comb['inv_fight'] * seconds group.count_ninv_tol += strategy_comb['ninv_tol'] * seconds group.count_ninv_fight += strategy_comb['ninv_fight'] * seconds group.count_strategycomb += (strategy_comb['inv_tol'] + strategy_comb['inv_fight'] + strategy_comb['ninv_tol'] + strategy_comb['ninv_fight']) * seconds #New CustomExport # Strategy combination group.export_inv_tol += "'" + str(strategy_comb['inv_tol']) + "'," group.export_inv_fight += "'" + str(strategy_comb['inv_fight']) + "'," group.export_ninv_tol += "'" + str(strategy_comb['ninv_tol']) + "'," group.export_ninv_fight += "'" + str(strategy_comb['ninv_fight']) + "'," # Time until market entry group.export_time_until_entry += "'" + str(int(round(group.ent_invest_until_in, 0))) + "'," # Current strategy of entrant and incumbent group.export_ent_action += "'" + group.ent_action + "'," group.export_inc_action += "'" + group.inc_action + "'," #Overall and Current payoff and welfare of entrant and incumbent group.export_ent_payoff_overall += "'" + str(round(group.ent_payout, 1)) + "'," group.export_inc_payoff_overall += "'" + str(round(group.inc_payout, 1)) + "'," group.export_ent_payoff_current += "'" + str(round(current_payout['ent'] * seconds, 1)) + "'," group.export_inc_payoff_current += "'" + str(round(current_payout['inc'] * seconds, 1)) + "'," group.export_welfare_current += "'" + str(round(current_payout['inc'] * seconds + current_payout['ent'] * seconds, 1)) + "'," group.export_welfare_overall += "'" + str(round(group.inc_payout + group.ent_payout, 1)) + "'," # Store time information in a list group.current_time = round((now - int(group.game_started_at)) / 1000000000, 1) group.export_time_counter += "'" + str(group.current_time) + "'," # Flag and Phase group.export_flag += "'" + str(group.flag) + "'," group.flag_counter += group.flag group.export_phase += "'" + "1" + "'," # store information which game no. and game is played group.export_gamenum += "'" + str(group.session.GameNumber) + "'," group.export_game += "'" + 'Zeitkontinuierlich' + "'," # Calculation after 60s if group.current_time >= 60 and group.reputation_fight_60s is True: group.reputation_fight_60s = False group.reputation_proportion_fight_60s = int((group.count_inv_fight + group.count_ninv_fight)*100 / group.count_strategycomb) # End clock if capacity investment was built if group.ent_invest_until_in <= 0: group.game_ended = True # PAGES class Bid(Page): # Give round number to template @staticmethod def vars_for_template(player: Player): return dict( round_num=player.round_number, GameNumber=player.session.GameNumber ) # Function processes the timer @staticmethod def get_timeout_seconds(player: Player): import time group = player.group if group.game_ended: return 0 return group.auction_timeout - time.time() # Function passes the player-id to javaScript @staticmethod def js_vars(player: Player): return dict(my_id=player.id_in_group) # This function is automatically genereted when there is a liveSend on the bid-Page @staticmethod def live_method(player: Player, bid): group = player.group my_id = player.id_in_group if bid: # if-Sequence to check whether there was only an update if bid == "UPDATE": group.flag = 0 print("Update Periodically") # if-Sequence for Entrant elif bid == "IN": group.ent_action = "IN" group.flag = 1 print("Update Bid") elif bid == "OUT": group.ent_action = "OUT" group.flag = 1 print("Update Bid") # if-Sequence for Incumbent elif bid == "TOLERATE": group.inc_action = "TOLERATE" group.flag = 1 print("Update Bid") elif bid == "FIGHT": group.inc_action = "FIGHT" group.flag = 1 print("Update Bid") # Call the function to update the payout whenever a liveSend was generated update_payout(player.group) return {0: get_state(group)} return {my_id: get_state(group)} class ResultsWaitPage(WaitPage): @staticmethod def after_all_players_arrive(group: Group): # schedule.cancel_job(jobs[group.update_job_idx]) update_payout(group) group.game_ended = True #group.end_phase_1 = str(time.time_ns()) group.ent_is_payoff = 0 group.inc_is_payoff = 0 # Calculations group.final_payout_inc_1 = int(round(group.inc_payout, 0)) group.final_payout_ent_1 = int(round(group.ent_payout, 0)) group.final_ent_invest = round(group.ent_invest, 1) #final_len_phase_1_ns = int(group.end_phase_1) - int(group.game_started_at) group.final_len_1 = group.current_time # Entrant entered the market if group.ent_invest_until_in <= 0.2: # Correction for too long phase 1: overlap_time = group.final_ent_invest - Constants.time_investment current_payout = get_current_payout(group) # Subtract the overlap_time group.final_payout_inc_1 = round(group.final_payout_inc_1 - (current_payout['inc'] * overlap_time), 0) group.final_payout_ent_1 = round(group.final_payout_ent_1 - (current_payout['ent'] * overlap_time), 0) group.final_ent_invest = group.final_ent_invest - (current_payout['time'] * overlap_time) group.ent_invest_until_in = group.ent_invest_until_in + overlap_time group.final_len_1 = round(group.final_len_1 - overlap_time, 0) # Final Payout calculation group.final_len_2 = int(round(Constants.len_total - group.final_len_1, 0)) group.final_payout_ent_2 = int(round((group.final_len_2 * Constants.payout_entrant_invest_2), 0)) group.final_payout_inc_2 = int(round((group.final_len_2 * Constants.payout_incumbent_invest_2), 0)) # Entrant did not enter the market else: # Correction for too long phase 1: overlap_time = group.final_len_1 - Constants.len_phase_1 current_payout = get_current_payout(group) # Subtract the overlap_time group.final_payout_inc_1 = round(group.final_payout_inc_1 - (current_payout['inc'] * overlap_time), 0) group.final_payout_ent_1 = round(group.final_payout_ent_1 - (current_payout['ent'] * overlap_time), 0) group.final_ent_invest = group.final_ent_invest - (current_payout['time'] * overlap_time) group.ent_invest_until_in = group.ent_invest_until_in + overlap_time group.final_len_1 = round(group.final_len_1 - overlap_time, 0) #Final Payout Calculation group.final_len_2 = int(round(Constants.len_total - Constants.len_phase_1, 1)) group.final_payout_ent_2 = int(round((group.final_len_2 * Constants.payout_entrant_n_invest_2), 0)) group.final_payout_inc_2 = int(round((group.final_len_2 * Constants.payout_incumbent_n_invest_2), 0)) group.final_payout_ent = int(group.final_payout_ent_1 + group.final_payout_ent_2) group.final_payout_inc = int(group.final_payout_inc_1 + group.final_payout_inc_2) group.ent_invest = round(group.ent_invest, 1) group.ent_invest_until_in = round(group.ent_invest_until_in, 1) # Last custom Export # Strategy Combination group.export_inv_tol += "'" + str(round(group.count_inv_tol / group.count_strategycomb, 3)) + "'," group.export_inv_fight += "'" + str(round(group.count_inv_fight / group.count_strategycomb, 3)) + "'," group.export_ninv_tol += "'" + str(round(group.count_ninv_tol / group.count_strategycomb, 3)) + "'," group.export_ninv_fight += "'" + str(round(group.count_ninv_fight / group.count_strategycomb, 3)) + "'," # Time Export group.export_time_counter += "'" + str(group.final_len_1) + "'," group.export_time_until_entry += "'" + str(int(round(group.ent_invest_until_in, 0))) + "'," #Result Phase 2 if group.ent_invest_until_in <= 0: # Entrant entered the market group.export_ent_action += "'" + '1' + "'," group.export_inc_action += "'" + 'Marktteilung' + "'," group.reputation_marketentry = "Ja" else: group.export_ent_action += "'" + '0' + "'," group.export_inc_action += "'" + 'Monopolstellung' + "'," group.reputation_marketentry = "Nein" #Overall and current payoff and welfare in phase 2 group.export_ent_payoff_overall += "'" + str(int(round(group.final_payout_ent, 0))) + "'," group.export_inc_payoff_overall += "'" + str(int(round(group.final_payout_inc, 0))) + "'," group.export_ent_payoff_current += "'" + str(int(round(group.final_payout_ent_2, 0))) + "'," group.export_inc_payoff_current += "'" + str(int(round(group.final_payout_inc_2, 0))) + "'," group.export_welfare_current += "'" + str(int(round(group.final_payout_ent_2 + group.final_payout_inc_2, 0))) + "'," group.export_welfare_overall += "'" + str(int(round(group.final_payout_ent + group.final_payout_inc, 0))) + "'," #Flag and Phase group.export_flag += "'" + str(group.flag_counter-1) + "'," group.export_phase += "'" + "2" + "'," # store information which game is played group.export_gamenum += "'" + str(group.session.GameNumber) + "'," group.export_game += "'" + 'Zeitkontinuierlich' + "'," #Close array in CustomExport group.export_inv_tol += "'ENDE']" group.export_inv_fight += "'ENDE']" group.export_ninv_tol += "'ENDE']" group.export_ninv_fight += "'ENDE']" group.export_time_until_entry += "'ENDE']" group.export_time_counter += "'ENDE']" group.export_ent_action += "'ENDE']" group.export_inc_action += "'ENDE']" group.export_ent_payoff_overall += "'ENDE']" group.export_inc_payoff_overall += "'ENDE']" group.export_ent_payoff_current += "'ENDE']" group.export_inc_payoff_current += "'ENDE']" group.export_flag += "'ENDE']" group.export_welfare_current += "'ENDE']" group.export_welfare_overall += "'ENDE']" group.export_phase += "'ENDE']" group.export_gamenum += "'ENDE']" group.export_game += "'ENDE']" class Results(Page): def vars_for_template(player: Player): group = player.group #Store Payout in currency field if group.ent_is_payoff == 0 or group.inc_is_payoff == 0: if player.id_in_group == 1: group.ent_is_payoff = 1 player.participant.payoff += cu(700) + cu(group.final_payout_ent) print("Payoff Entrant ", player.participant.payoff) else: group.inc_is_payoff = 1 player.participant.payoff += cu(group.final_payout_inc) print("Payoff Incumbent ", player.participant.payoff) if group.final_len_1 > 179: group.reputation_len_phase1 = "-" else: group.reputation_len_phase1 = str(group.final_len_1) return dict( display_ent_payoff=group.final_payout_ent, display_inc_payoff=group.final_payout_inc, display_proportion_inv=int(round((group.count_inv_fight + group.count_inv_tol) * 100 / group.count_strategycomb, 0)), display_proportion_ninv=100 - int(round((group.count_inv_fight + group.count_inv_tol) * 100 / group.count_strategycomb, 0)), display_proportion_fight=int(round((group.count_inv_fight + group.count_ninv_fight) * 100 / group.count_strategycomb, 0)), display_proportion_fight_60s=int(round(group.reputation_proportion_fight_60s, 0)), display_proportion_nfight=100 - int(round((group.count_inv_fight + group.count_ninv_fight) * 100 / group.count_strategycomb, 0)), display_proportion_marketentry=group.reputation_marketentry, display_time_until_entry=group.reputation_len_phase1, final_payout_inc_1=int(group.final_payout_inc_1), final_payout_ent_1=int(group.final_payout_ent_1), final_payout_inc_2=int(group.final_payout_inc_2), final_payout_ent_2=int(group.final_payout_ent_2), final_payout_inc=int(group.final_payout_inc), final_payout_ent=int(group.final_payout_ent), ent_invest=group.final_ent_invest, final_payout_ent_bonus=group.final_payout_ent + 700, round_num=player.round_number, round_next=player.round_number+1, final_len_1=group.final_len_1, final_len_2=group.final_len_2, GameNumber=player.session.GameNumber, inMarkt=group.ent_invest_until_in ) page_sequence = [ InitDecision, WaitToStart, Bid, ResultsWaitPage, Results, GameOverview ] def custom_export(players): # header row yield ['session', 'participant_code', 'Treatment', 'id_in_group', 'Gruppe', 'Spieldurchlauf', 'Runde', 'Zeit Phase 1[s]', 'Zeit bis Markteintritt[s]', 'Zustand Inv-Dulden', 'Zustand Inv-Erschweren', 'Zustand Nicht Inv-Dulden', 'Zustand Nicht Inv-Erschweren', 'Aktion Entrant', 'Payoff Entrant current', 'Payoff Entrant overall', 'Aktion Incumbent', 'Payoff Incumbent current', 'Payoff Incumbent overall', 'Wohlfahrt aktuell', 'Wohlfahrt gesamt', 'Flag', 'Phase im Spiel'] # for loop to get a row for each player print(players) #define the list variables global list_export_inv_tol global list_export_inv_fight global list_export_ninv_tol global list_export_ninv_fight global list_export_time_until_entry global list_export_time_counter global list_export_ent_action global list_export_inc_action global list_export_ent_payoff_overall global list_export_inc_payoff_overall global list_export_ent_payoff_current global list_export_inc_payoff_current global list_export_welfare_current global list_export_welfare_overall global list_export_flag global list_export_phase global list_export_gamenum global list_export_game for p in players: #Get id of participant and session participant = p.participant session = p.session if p.group.export_inv_tol[-1] != "]": p.group.export_inv_tol = p.group.export_inv_tol + "]" p.group.export_inv_fight = p.group.export_inv_fight + "]" p.group.export_ninv_tol = p.group.export_ninv_tol + "]" p.group.export_ninv_fight = p.group.export_ninv_fight + "]" p.group.export_time_until_entry = p.group.export_time_until_entry + "]" p.group.export_time_counter = p.group.export_time_counter + "]" p.group.export_ent_action = p.group.export_ent_action + "]" p.group.export_inc_action = p.group.export_inc_action + "]" p.group.export_ent_payoff_overall = p.group.export_ent_payoff_overall + "]" p.group.export_inc_payoff_overall = p.group.export_inc_payoff_overall + "]" p.group.export_ent_payoff_current = p.group.export_ent_payoff_current + "]" p.group.export_inc_payoff_current = p.group.export_inc_payoff_current + "]" p.group.export_welfare_current = p.group.export_welfare_current + "]" p.group.export_welfare_overall = p.group.export_welfare_overall + "]" p.group.export_flag = p.group.export_flag + "]" p.group.export_phase = p.group.export_phase + "]" p.group.export_gamenum = p.group.export_gamenum + "]" p.group.export_game = p.group.export_game + "]" #Save the group_variables in a temporary list list_export_inv_tol = eval(p.group.export_inv_tol) list_export_inv_fight = eval(p.group.export_inv_fight) list_export_ninv_tol = eval(p.group.export_ninv_tol) list_export_ninv_fight = eval(p.group.export_ninv_fight) list_export_time_until_entry = eval(p.group.export_time_until_entry) list_export_time_counter = eval(p.group.export_time_counter) list_export_ent_action = eval(p.group.export_ent_action) list_export_inc_action = eval(p.group.export_inc_action) list_export_ent_payoff_overall = eval(p.group.export_ent_payoff_overall) list_export_inc_payoff_overall = eval(p.group.export_inc_payoff_overall) list_export_ent_payoff_current = eval(p.group.export_ent_payoff_current) list_export_inc_payoff_current = eval(p.group.export_inc_payoff_current) list_export_welfare_current = eval(p.group.export_welfare_current) list_export_welfare_overall = eval(p.group.export_welfare_overall) list_export_flag = eval(p.group.export_flag) list_export_phase = eval(p.group.export_phase) list_export_gamenum = eval(p.group.export_gamenum) list_export_game = eval(p.group.export_game) for t in range(0, len(list_export_time_until_entry)): yield[ session.code, participant.code, list_export_game[t], p.id_in_group, p.group.id_in_subsession, list_export_gamenum[t], p.round_number, list_export_time_counter[t], list_export_time_until_entry[t], list_export_inv_tol[t], list_export_inv_fight[t], list_export_ninv_tol[t], list_export_ninv_fight[t], list_export_ent_action[t], list_export_ent_payoff_current[t], list_export_ent_payoff_overall[t], list_export_inc_action[t], list_export_inc_payoff_current[t], list_export_inc_payoff_overall[t], list_export_welfare_current[t], list_export_welfare_overall[t], list_export_flag[t], list_export_phase[t] ]