Welcome! Log In Create A New Profile

Advanced

Access "data file" name, and having error in block change function

Posted by Jhilik Das 
Access "data file" name, and having error in block change function
August 22, 2019 04:35PM
Hi,
I have a function for changing block which works perfectly if "first block to run" is predecided.

I want to use TBD option, for which I need to access "Subject name" or "data file" name.

If I am putting "data file" name manually (see pic attached), I am able to run the first trial successfully (the desired block), but can't access "TrialRecord.User.data", even though it is not empty.

Thanks in advance for helping,
Jhilik.
Attachments:
open | download - block_change_function.png (44.5 KB)
Re: Access "data file" name, and having error in block change function
August 22, 2019 05:40PM
How sure are you that TrialRecord is not empty? Try printing out TrialRecord before Line 15. I can easily tell that TrialRecord is empty, even though I don't have your task files.

I don't see how the "First block to run" option being "TBD" or not is related to the access to "Subject name" or "Data file". You can copy the subject name from MLConfig to TrialRecord.User in your timing file. The data filename is stored in TrialRecord.DataFile.

I don't know what performance measure you calculate in the block change function, but reading the whole data file in the function is a terrible idea, so try to avoid it.
Re: Access "data file" name, and having error in block change function
August 22, 2019 11:31PM
Hello Sir,
We want to train monkey in an automated way. There are several blocks in the condition file, and monkey will reach the next block if his performance in the current block is more than 80%. Or will level down to the previous level, if performance is poor. That's how "performance_based_block_change" works.

I am writing a log of last completed level of the monkey as "monkeyName_Log.mat" (say test_Log.mat) in the timing file which keeps updated each day. there are three different logs for three monkeys and their progress is different. (I am attaching a test log file screenshot).

So in "first block to run TBD" case, I want to read the log file of respective monkey (so I need to access Subject name) and choose the block next to last completed block.

Also,
we are running a Same different task. There are almost 1000 same, 1000 different condition in a given block. Frequency of each condition is 1.
While running the block, we randomly choose conditions, without replacement. In a block, let's say, we want to run 100 trials.
Is there any way to ensure that there is an equal number of Same/Different trials, in the chosen100 trials?

Let me know if you need other information.
With thanks and regards
Jhilik.
Attachments:
open | download - test_log.png (28.5 KB)
Re: Access "data file" name, and having error in block change function
August 23, 2019 04:34AM
The block change function is called "after" each trial, so, to determine the very first block, you should use the block selection function.
https://monkeylogic.nimh.nih.gov/docs_TaskflowControl.html

If I were you, I would use a userloop function.
https://monkeylogic.nimh.nih.gov/docs_CreatingTask.html#Userloop

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.