Ejemplo n.º 1
0
    def set_autorun(self, exp_plan):
        def rt(mean, trialno):
            add = np.random.normal(mean,scale=.2) / self.rp['autorun']
            return self.trial[0].dur + add

        invert_resp = exp.invert_dict(self.computer.valid_responses)

        for trialno, trial in enumerate(exp_plan):
            if trial['context'] == 'parts':
                acc = [.1,.1,.1,.1]
                acc[trial['pos']] = .7
                resp = exp.weighted_choice(choices=invert_resp, weights=acc)
                trial['autoresp'] = resp  # poor accuracy
                trial['autort'] = rt(1., trialno)  # slow responses
            elif trial['context'] == 'whole':  # lower accuracy for morphed
                acc = [.05,.05,.05,.05]
                acc[trial['pos']] = .85
                resp = exp.weighted_choice(choices=invert_resp, weights=acc)
                trial['autoresp'] = resp  # good accuracy
                trial['autort'] = rt(.8, trialno)  # fast responses
        return exp_plan
Ejemplo n.º 2
0
    def set_autorun(self, exp_plan):
        def rt(mean, trialno):
            add = np.random.normal(mean, scale=.2) / self.rp['autorun']
            return self.trial[0].dur + add

        invert_resp = exp.invert_dict(self.computer.valid_responses)

        for trialno, trial in enumerate(exp_plan):
            if trial['context'] == 'parts':
                acc = [.1, .1, .1, .1]
                acc[trial['pos']] = .7
                resp = exp.weighted_choice(choices=invert_resp, weights=acc)
                trial['autoresp'] = resp  # poor accuracy
                trial['autort'] = rt(1., trialno)  # slow responses
            elif trial['context'] == 'whole':  # lower accuracy for morphed
                acc = [.05, .05, .05, .05]
                acc[trial['pos']] = .85
                resp = exp.weighted_choice(choices=invert_resp, weights=acc)
                trial['autoresp'] = resp  # good accuracy
                trial['autort'] = rt(.8, trialno)  # fast responses
        return exp_plan
Ejemplo n.º 3
0
    def get_autorun_vals(self, pos, this_intensity, corr_resp):
        """If autorun, simulate user responses
        """
        def rt(mean):
            add = np.random.normal(mean,scale=.2)/self.rp['autorun']
            return trial_dur + add

        invert_resp = exp.invert_dict(self.computer.valid_responses)
        trial_dur = sum([ev.dur for ev in self.trial])

        thres = np.random.normal(self.convergeto[pos], scale=1)
        thres = max(0, thres)
        invert= {'right': 'left', 'left': 'right'}
        if this_intensity < thres:
            fake_resp = invert[corr_resp]  # wrong response
        else:
            fake_resp = corr_resp  # correct response

        auto = [('autoresp', invert_resp[fake_resp]),
                ('autort', rt(0.500))]
        return auto
Ejemplo n.º 4
0
    def get_autorun_vals(self, posno, this_intensity, corr_resp):
        """If autorun, simulate user responses
        """
        def rt(mean):
            add = np.random.normal(mean, scale=.2) / self.rp['autorun']
            return trial_dur + add

        invert_resp = exp.invert_dict(self.computer.valid_responses)
        trial_dur = sum([ev.dur for ev in self.trial])

        if corr_resp == 'same':
            fake_resp = 'same'  # participants should be perfect here
        else:
            thres = np.random.normal(self.convergeto[posno], scale=1)
            thres = max(0, thres)
            if this_intensity < thres:
                fake_resp = 'same'
            else:
                fake_resp = 'diff'

        auto = [('autoresp', invert_resp[fake_resp]), ('autort', rt(0.500))]
        return auto
Ejemplo n.º 5
0
    def set_autorun(self, exp_plan):
        def rt(mean):
            add = np.random.normal(mean,scale=.2) / self.rp['autorun']
            return trial_dur + add

        invert_resp = exp.invert_dict(self.computer.valid_responses)
        trial_dur = sum([ev.dur for ev in self.trial])

        for trial in exp_plan:
            if trial['pos'] == 'attended':
                acc = .9
            elif trial['pos'] == 'unattended':
                acc = .6

            if trial['corr_resp'] == 'same':
                resp_ind = exp.weighted_choice(choices=invert_resp.keys(),
                                                weights=[1-acc, acc])
            else:
                resp_ind = exp.weighted_choice(choices=invert_resp.keys(),
                                                weights=[acc, 1-acc])
            trial['autoresp'] = invert_resp[resp_ind]
            trial['autort'] = rt(.8)
        return exp_plan
Ejemplo n.º 6
0
    def set_autorun(self, exp_plan):
        def rt(mean):
            add = np.random.normal(mean, scale=.2) / self.rp['autorun']
            return trial_dur + add

        invert_resp = exp.invert_dict(self.computer.valid_responses)
        trial_dur = sum([ev.dur for ev in self.trial])

        for trial in exp_plan:
            if trial['pos'] == 'attended':
                acc = .9
            elif trial['pos'] == 'unattended':
                acc = .6

            if trial['corr_resp'] == 'same':
                resp_ind = exp.weighted_choice(choices=invert_resp.keys(),
                                               weights=[1 - acc, acc])
            else:
                resp_ind = exp.weighted_choice(choices=invert_resp.keys(),
                                               weights=[acc, 1 - acc])
            trial['autoresp'] = invert_resp[resp_ind]
            trial['autort'] = rt(.8)
        return exp_plan