예제 #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
예제 #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
예제 #3
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
예제 #4
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
예제 #5
0
    def set_autorun(self, exp_plan):
        def rt(mean):
            add = np.random.normal(mean, scale=.2) / self.rp['autorun']
            return self.trial[0].dur + add

        for trial in exp_plan:
            trial['autort'] = ''
            trial['autoresp'] = ''
            if trial['corr_resp'] == 1:
                acc = [.10, .90]
                resp_ind = exp.weighted_choice(weights=acc)
                if resp_ind == 1:
                    trial['autort'] = rt(.8)
                    trial['autoresp'] = 1
        return exp_plan