Sunday, August 29, 2010

Different ways to run a PEBL experiment

I'm going to focus on running a PEBL experiment in Windows here, as that is what most users who would need this advice are using.

First, most people who use PEBL are aware of the launcher.  This is a little front-end that assembles the right command-line arguments.  It looks something like this:

The launcher defaults to running in the pebl-exp.XX directory, and will be default have some options filled in.  By default, this leaves a lot of room for error, especially if your experiment is run by volunteer undergraduates who may not be aware of everything they should.  Also, many of the PEBL test battery experiments override settings in the launcher, like subject code and screen resolution.  I think of the launcher as sort of an easy way to navigate PEBL programs, but I actually never use to to run studies themselves.

Tweaking the Launcher
Before telling you how I do it, let me first mention that some of the initial settings of the launcher can be specified in a config file, taking away some of the guesswork.  The file pebl-init.txt contains

C:\Program Files\PEBL\bin\pebl.exe
C:\Documents and Settings\username\My Documents\pebl-exp.0.09
The first line specifies where it should look for the PEBL executable.  The second specifies which directory it should start in.  If you have a particular experiment you are running, you can make a copy of the pebl-init.txt file, change line 2, and copy it to the directory of your script.  Then make a windows shortcut to launch in that directory, and you can reduce some of the guesswork.  Also, specifying further lines like Condition|0 can feed different command-line arguments into PEBL, in case you want to specify a condition at the outset.

Running when not installed

Sometimes experimenters have access to computer labs to run subjects, but cannot actually install software.  Luckily, PEBL does not actually need to be 'installed' to run--you can create a .zip archive that gets copied to the desktop (or stays on a flash drive) and runs from there.  Right now, I don't offer a stand-alone .zip of PEBL that can do this, so you would first need to install PEBL with the normal installation program.  Here are the steps to make a stand-alone:
  1. Install PEBL
  2. Create a folder somewhere, called something like "runexp"
  3. Copy (don't move--copy it) the folder c:\Program Files\pebl into runexp
  4. Move your experiment file into the runexp folder
  5. Create a launcher shortcut and pebl-init.txt (as above) or a run.bat file (as below) to launch your program.
  6. (optional) Right-click on the runexp folder and choose Send To > Compressed (zipped) Folder
  7. Now, you can move the folder to any other computer, unzip it, and it should run just fine.

Avoiding the Launcher
When running PEBL for actual experiments, I almost never use the launcher.  Instead, I run directly from a .bat file, and make sure any condition/subject information is entered at the beginning of the experiment using things like GetSubNum() and GetEasyInput().  Creating a .bat file is really easy.  First, right click in the folder and choose New>Text Document, then rename it to something like run.bat.  It will ask you if you are sure you want to rename the file.  Say yes.  If you have file extensions turned off, you probably won't see the .bat, but the icon will change to the type seen in the window above.
Next, edit the .bat file using wordpad (right-click > edit).  Copy the following into the file:

"c:\Program Files\pebl\pebl.exe" experiment.pbl

Then save, and you are ready to roll.  Once you are happy with the experiment, you can change this to:
"c:\Program Files\pebl\pebl.exe" experiment.pbl --fullscreen

Which will run the experiment fullscreen. Remember that ctrl-alt-shift-\ is the secret key combo to abort a PEBL experiment in fullscreen mode.  If you are creating a specific folder on the desktop to run PEBL from, you can do:

"PEBL\pebl.exe" experiment.pbl

Also, for the scripts that allow you to specify a user translation, you can do something like:

"c:\Program Files\pebl\pebl.exe" experiment.pbl  --language "ES"

So that you don't have to enter this in each time.

Finally, you can use this trick to run multiple experiments in sequence, or make backups of data to a server or archive directory, and so on. Just copy multiple lines into the file

"c:\Program Files\pebl\pebl.exe" experiment1.pbl
"c:\Program Files\pebl\pebl.exe" experiment2.pbl
copy exp-out*.txt archive\

So, these are just a few ways of using PEBL in a lab situation that offer better control over the results.

Post a Comment