def runblock(task,block): if block=="try": # A short try-out block that contains only 4 trials, # two at the smallest stimulus, two at the biggest one. # We also give feedback. runtest(task,["min","max","min","max"]) if block=="train": # A short try-out block that contains 10 trials, but # follows the MLP procedure (i.e. dynamic selection # of the stimuli). We don't give feedback. # Make sure that we have only 10 trials in total task.NTRIALS_A = 4 task.N_CATCH_TRIALS_A = 1 task.NTRIALS_B = 4 task.N_CATCH_TRIALS_B = 1 # Then start the MLP mlp = MLP() mlp.run( task, participant="%s-anisochrony-%s"%(participant, block), evaluate=evaluateGUI, preKeypress=False, ) if block in ["1","2","3"]: # The "real" experimental blocks # Then start the MLP mlp = MLP() mlp.run( task, participant="%s-anisochrony-%s"%(participant, block), evaluate=evaluateGUI, preKeypress=False, )
""" This is an example script that shows how to run the python implementation of MLP. First you have to create a task (here just a null task that asks you for a response). You then feed this to the run() method of an MLP object, and it will run the given task. """ from mlpcore.task import * from mlpcore.mlp import MLP task = Task() mlp = MLP() mlp.run(task)