Considering only trials on which you gave the correct response, calculate median RT in…
- User
Considering only trials on which you gave the correct response, calculate median RT in all 4 conditions : # like zombie1, but with classes and response
import math, time import pygame from OpenGL.GL import * from pygame.locals import * import numpy as np
screen_dist = 30 def DVA2CM(dva): return screen_dist/(180/math.pi)*dva
class P: n_cols = 30 n_rows = 22 cell_size = DVA2CM(1.6) jitter_max = DVA2CM(0.24) target_shifts = { 4 : 8, 5 : 8, 6 : 9, 7 : 9, 8 : 10, 9 : 10, 10: 10, 11: 10, 12: 10, 13: 10, 14: 9, 15: 9, 16: 8, 17: 8} bar_length = DVA2CM(1.1) bar_width = DVA2CM(0.12) target_angle = {'A': 45, 'B': 20} distractor_angle = 45 res_x, res_y = 2880, 1800 screen_width = 30 full_screen = True clear_color = 0 kinds = ['A', 'B'] simples = [True, False] n_repetitions = 25
class SearchArray: def init(self, kind, simple): # list of 30x22 = 660 positions, indexed by row, col, each as (x, y) self.positions = [] for row in range(P.n_rows): my_row = [] for col in range(P.n_cols): p0 = np.array([(-(P.n_cols - 1)/2 + col)P.cell_size, (-(P.n_rows - 1)/2 + row)P.cell_size]) jitter = np.random.uniform(low = -P.jitter_max, high = +P.jitter_max, size = 2) p = p0 + jitter my_row.append(p) self.positions.append(my_row) # pick target row, column, and side self.target_row = np.random.choice(list(P.target_shifts.keys())) target_shift = P.target_shifts[self.target_row] self.target_side = np.random.choice([-1, +1]) if self.target_side == -1: self.target_col = round(np.floor((P.n_cols - 1)/2) - target_shift) else: self.target_col = round(np.ceil( (P.n_cols - 1)/2) + target_shift) # whether target is CW (-1) or CCW (+1) of nearest horizontal or vertical self.target_sign = np.random.choice([-1, +1]) # whether to start the first row with a horizontal (0) or vertical (1) line cross_initial = np.random.choice([0, 1]) target_angle = P.target_angle[kind] self.angles = [] # orientations of diagonals self.cross_angles = [] # orientations of horizontal/vertical lines (or None) for row in range(P.n_rows): my_angles = [] my_cross_angles = [] # whether to start the row with horizontal (0) or vertical (1) cross-bar start_row_with = (cross_initial + row%2)%2 for col in range(P.n_cols): cross_angle = 0 if (start_row_with + col)%2 == 0 else 90 if row == self.target_row and col == self.target_col: if cross_angle == 0: angle = self.target_signtarget_angle else: angle = 90 - self.target_signtarget_angle else: angle = -self.target_sign*P.distractor_angle my_angles.append(angle) if simple: my_cross_angles.append(None) else: my_cross_angles.append(cross_angle) self.angles.append(my_angles) self.cross_angles.append(my_cross_angles) def draw(self): for row in range(P.n_rows): for col in range(P.n_cols): glPushMatrix() glTranslated(self.positions[row][col][0], self.positions[row][col][1], 0) for a in [self.angles[row][col], self.cross_angles[row][col]]: if a is not None: glPushMatrix() glRotated(a, 0, 0, 1) glRectd(-P.bar_width/2, -P.bar_length/2, +P.bar_width/2, +P.bar_length/2) glPopMatrix() glPopMatrix()
Assistant
To calculate the median RT for correct responses in each of the four conditions, we need to process the experiment's data file. The conditions are combinations of
KIND(A or B) andSIMPLE(True or False). Below is the Python code to achieve this:python- User
Assistant
python
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.