drbenvincent / darc_toolbox

Run adaptive decision making experiments
MIT License
16 stars 2 forks source link

PsychoPy demo: GUI-based selection of (task, model) combination #17

Closed drbenvincent closed 6 years ago

drbenvincent commented 6 years ago

In order to maximise ease of use and minimise required engagement with Python code snippets, I want to have GUI-based selection of the (task, model) combination.

Then again, if you are just running an experiment, or want to send it to other labs and it just runs as you want, then you'd want to minimise superfluous GUI input because it's just an opportunity for errors to be made.

So maybe the GUI idea is nice for a demo... People will download this and try it out, so it might be nice for them to be able to do that with a low-effort GUI. But when someone wants to run a particular (task, model) combination, they can do that by replacing the GUI call with the few lines of design and model code required.

The best way to do this is perhaps

  1. First ask the user what experimental design they want (ie Delayed, Risky, Risky and Delayed)
  2. Then ask them what model they want, where the list of possible models is dictated by whatever is available for that experiment type.

Idea

expt_type = {'Experiment type': ['delayed', 'risky', 'delayed and risky']}
dlg = gui.DlgFromDict(dictionary=expt_type, title='Choose your experiment type')
if dlg.OK == False:
    core.quit()  # user pressed cancel

# Available models should be decided based on choice for Experiment Type
if expt_type['Experiment type'] is 'delayed':
    models_available = ['Hyperbolic', 'Exponential', 'MyersonHyperboloid',
        'ProportionalDifference']
elif expt_type['Experiment type'] is 'risky':
    models_available = ['Hyperbolic', 'ProportionalDifference', 'ProspectTheory']
elif expt_type['Experiment type'] is 'delayed and risky':
    models_available = ['MultiplicativeHyperbolic']

model_type = {'Model': models_available}

dlg = gui.DlgFromDict(dictionary=model_type, title='Choose your model')
if dlg.OK == False:
    core.quit()  # user pressed cancel

This basically works, although

  1. will crash if using full screen display... the GUI doesn't display and it's difficulty/impossible to escape from the experiment
  2. and needs more code to action the selections made in the GUI