Generating program code for psychological experiments from high-level descriptions

Igor Dejanović1, Mirjana Dejanović2

University of Novi Sad1, University of Priština2

September, 2019 @ ERK Portorož Slovenia

Created 2019-09-23 Mon 00:12, press ESC for overview

Introduction

Experiments in Psychology

An example – the Simon effect test

simon_experiment.png

Motivation

Domain-Specific Languages

SQL

SELECT player, stadium
    FROM game JOIN goal ON (id=matchid)

Business processes - BPMN

BPMN.png

But also…

MusicNotation-External.png

Or…

ChessNotation.png

textX

textX.png

https://github.com/textX/textX

I. Dejanović, R. Vaderna, G. Milosavljević, Ž. Vuković, TextX: A Python tool for Domain-Specific Languages implementation, Knowledge-Based Systems 115, 1-4, 2017.

pyFlies

pyFlies - DSL for psychological RT experiments

pyFliesGUI.png

pyFlies code for the Simon effect test

test Simon {
  conditions {
    position  color  congruency   response

    left      green  congruent    left
    left      red    incongruent  right
    right     green  incongruent  left
    right     red    congruent    right
  }

  stimuli{
    all: shape(rectangle, position position,
               color color)
    error: sound(1000)
    fixation: shape(cross)
  }
}

Connecting stimuli and conditions

position=left and color=red

stimuli-conditions.png

Target code generators

architecture.png

Template engines

template_engine.png

Conclusion

Thanks! Q&A?