Barramundi

Table of Contents

About Barramundi

Barramundi is a computer simulator that applies procedures to determine psychophysical thresholds in patients whose behaviour is determined by a set of input thresholds and various modifiers. It reports the differences between measured thresholds and input thresholds, and tracks the number of presentations of each stimuli required by each test procedure on each patient set. It is intended as a tool for analyzing new test procedures against existing techniques for both efficiency (number of presentations), and effectiveness (accurate thresholds).

General Overview

Barramundi was designed with the following objectives in mind:

Schemeatic structure of Barramundi

Barramundi is driven by three text files: TestProcedures.bar, PatientSets.bar, and Stimuli.bar as shown in Figure 1. In turn the patient sets in PatientSets.bar read from files of thresholds, and the test procedures described in TestProcedures.bar are contained in Java class files.

The three main files and the threshold files are treated as a Databases according to the definition of the Database class. They each have a record description that conforms to the DatabaseRecord interface.

The Java Code

The interface was originally designed to allow multiple simulators and multiple analysis windows. The Interface class implements the basic starting window, which has only one button in this version (ie the "new Simulation" button).

The Simulation class constructs the GUI for the simulator, which consists of a tabbed pane for each of the three databases (Stimulus, Patient Sets, and Test Procedures) , and a fourth "Control" tabbed pane which contains:

When the user clicks "Go" on the control pane, the Control thread is initialised and started. The Control thread also updates the progress bars on the control tabbed pane.

How to...

Create a new Patient Set

A patient set consists of name, a description of a set of threshold records to read from a file, the name of the seen class that will determine how the thresholds are used to answer the "did you see this" question, and false positive/negative rates. All of these attributes of the patient set can be added by selecting the "New" button on the "Patients" tab window.

The file of thresholds that is specified as the "Patient data filename" is a simple tab/space delimited text file that is in the format specified by the PatientDataRecord class. Each line consists of

The thresholds are assumed to be in some order as determined by you. Barramundi numbers the thresholds in the order that they appear in the file, and uses this numbering consistantly throughout simulation.

There is also the ability to add Static Modifiers to a Patient Set, which alter the input thresholds once before they are run through the simulator. For example, if you want to randomly alter the input thresholds by adding Gaussian noise. Note that this is different from modifing the threshold upon each presentation of the stimulus, which occurs in the Seen Class.

Static Modifier objects should conform to the StaticModifier interface. There is currently no facility for adding a Static Modifier using the "Edit" button on the "Patients" tab window. To add a static patient modifier, edit the text file PatientSets.bar with any text editor and add the class name of the modifier, and any parameters required by the constructor of the class, at the end of the line describing the patient set. Note that the PatientSets.bar file is delimited by ~, not by spaces or tabs.

Create a Seen Class

A Seen Class implements the boolean function "seen" which takes the input threshold (as read from the patient data file) and a stimulus value and returns TRUE (the stimulus was seen) or FALSE (the stimulus was not seen). If you want variation based upon stimulus number (as defined by the order that thresholds are read from the patient data file), number of presentations, Gaussian noise, etc, then the seen function is the place to do it. And to create a seen function, you need a seen class (good old object oriented programming). The seen class also contains the false positive and negative rates so that they can be accessed by the seen function.

A seen class must

The easiest way to construct a new seen class is to copy an existing class (eg Seen_G_0) in the SeenFactory, change its name and function, and then add the get method at the beginning of SeenFactory.

The get method is used to return an instance of the seen class before simulation begins, and is called by the name of the seen class with "get" prepended. For example, if the name of a seen class (as appearing in the Patient Set description) is MySeenClass, then the following is the get method:

 
    public static MySeenClass getMySeenClass(Double fPosRate, Double fNegRate) { 
        return new MySeenClass(fPosRate.doubleValue(), fNegRate.doubleValue());
    }

Don't forget to re-compile the SeenFactory class after your changes are complete.

Create a Test Procedure Class

An instance of a Test Procedure Object is used to determine the order and value with which stimuli are presented. It is also responsible for writing any trace information to the trace file, and recording patient thresholds. A test procedure class must:

The best way to write a new test procedure is to copy the file Skeleton.java and edit where appropriate (as in the comments in the code). Don't forget to compile your code and put it where it can be found by the Java interpretter (ie in the CLASSPATH).

Add a Test Procedure Class to the test procedures database

Use the "New" button on the Test procedures tab window.

Format of the output file

The output file consists of a header, followed by a detailed section, followed by a summary. If the summary only check box on the Control tabbed pane is selected then the detailed section will be omitted and only the header and summary sections will be present. The output file is space and tab delimited. The PatientResults class is responsible for determining the format of the output file, and the PatientResult class determines the format of the lines in the detailed section. To add a new statistic, change the Summary class, which is an inner class of PatientResults.

The header section

The header lists the test procedures and patient sets run through the simulator. They are numbered in the order that they will appear in the detailed and summary part of the output file.

The detailed section

A line is printed on the detailed section for each patient. Each line has the following format:

where s is the number of stimulus locations (eg 17 for FDT).

The summary section

The summary section contains data in two formats.

The following statistics are printed: