Experiments

The experiments can be viewed in highlighted html on this page, and are available as ASCII text files in the experiments directory of the Tscope distribution.

All experiments are split into several sections, within one file. Most have a section responsible for randomizing and writing the data, a section that defines the trial, and one section that controls the whole experiment. All sections have their own main function so they can be tested independently. This makes more critical testing easier: while testing the randomization functions, running the whole experiment would mean losing time: only the output file is of interest here. On the other hand, when testing the trial function, running each possible trial in a fixed order is the best test. Preprocessor definitions near the beginning of the program control which main function is used. By default, the main function that runs the whole experiment is used. Some experiments have more sections than the three mentioned before, for example if a stimulus has to be read from a file, or if bitmaps have to be created for use during the experiment.

In all experiments there are switches that control how the experiment is run: fullscreen or in a window, randomized or fixed-order trials, with a mouse or a response box as input device, etc.

Forward declarations of functions are not used over here. While most think that using forward declarations is good programming practice, I think it is not (at least for programming experiments). When using forward declarations, all functions can be defined anywhere in the program. The programmer can try to put them in a logical order, but what seems logical today can seem random tomorrow. Without forward declarations, the choice where to put the definition of each function is constrained by the compiler: a function can only call functions that are defined earlier in the program. As a consequence, helper functions will be defined early in the source code, the main function will always be the last, intermediate-level functions will be in the middle. Having to comply to this constraint makes the structure of different programs more alike and helps in developing a coding style that does not change with every progam.

On a smaller scale, positioning of spaces, tabs and newlines in all programs complies to the Kernigan and Richie coding style. This is taken care of autmatically by the indent program, which can be run on each program by pressing F8 in the Crimson editor.

Here are the experiments, in order of complexity:


top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information