Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
test111

Junior Member
Registered:
Posts: 5
Reply with quote  #1 
Hello,all

I was wondering how to realize
1. "repeat immediately" until a response is made nomatter it's a correct or false response, that is, both trialerror 0 and 6 can make a termination of this repeat, instead of a termination only until a correct response.

2. under the new defined "repeat immediatly" condition, a session can stop automaticly once the monkey responds to all conditions, that is, if a condition is responded (TrialError 0 or 6), it will not appear again in this session.

Thanks in advance!
0
Jaewon

Administrator
Registered:
Posts: 971
Reply with quote  #2 
You need to make your own script to do it. You can use either a userloop function or a condition-selection function. Please see the manuals under the doc directory.

ftp://helix.nih.gov/lsn/monkeylogic/ML2_doc/taskflowcontrol.html

ftp://helix.nih.gov/lsn/monkeylogic/ML2_doc/NIMH%20MonkeyLogic%20Manual.pdf#%5B%7B%22num%22%3A78%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C70%2C360%2C0%5D
0
test111

Junior Member
Registered:
Posts: 5
Reply with quote  #3 
I was trying to terminate the block automaticly when 20 conditions were finished, I used ‘break’ initially, but it popped up an error and suggested to changed 'break' to 'return'. After the change, it still terminated weirdly, without a final result graph (which showes correct rate ...). A part of code in my userloop is showed as following:

if ~isempty(TrialRecord.TrialErrors)
if 0==TrialRecord.TrialErrors(end)|| 6==TrialRecord.TrialErrors(end)
response_count = sum(0==TrialRecord.TrialErrors || 6==TrialRecord.TrialErrors);


if response_count < 20 % 20 conditions
condition = response_count + 1; % Select the next condition in creasing
else
break
end
end

else
condition = 1;
end

How should I edit it?
0
Jaewon

Administrator
Registered:
Posts: 971
Reply with quote  #4 
Okay. I am updating the documents, so hopefully this will be explained better in the future. Please bear with me until then.

The userloop function is basically a replacement of the conditions file. It is called at the beginning of each trial and has to return normally. Stopping tasks should be done in the timing files or in the alert_function.m

----- Beginning of the userloop example -----
function [C,timingfile,userdefined_trialholder] = myuserloop(MLConfig,TrialRecord)

C = [];
timingfile = 'mytimingfile.m';
userdefined_trialholder = '';

persistent condition;
if isempty(TrialRecord.TrialErrors)
    condition = 1;
elseif 0==TrialRecord.TrialErrors(end)|| 6==TrialRecord.TrialErrors(end)
        response_count = sum(0==TrialRecord.TrialErrors || 6==TrialRecord.TrialErrors);
        if response_count < 20
            condition = response_count + 1; % Select the next condition in creasing
        end
    end
end

switch condition  % define stimuli according to the condition
    case 1, C = { 'fix(0,0)' };
    case 2,
        ...
end
-----End of the userloop example -----

Since you don't know whether the subject will succeed the current trial or not, you should set the stop condition at the end of the timing file.

----- Beginning of the timing file example -----
error_type = 0;
...
...
...
trialerror(error_type);

if 20==sum(0==[TrialRecord.TrialErrors error_type])
    TrialRecord.Pause = true;  % equivalent to escape_screen(); Or TrialRecord.Quit = true;
end
----- End of the timing file example -----

Also see the following post for how to use alert_function.m
http://forums.monkeylogic.org/post/trial-selection-9495147
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.