Home | About the Mechner Foundation | Interests and Activities | Publications
Potential Areas for Collaboration | About Francis Mechner | Contact Information
Links to Other Web Sites of Interest

Revealed Operant Software

This page contains links to the software needed to run a revealed operant experiment, and documentation about how to use it.

 

  1. To use the software for the revealed operant experiment, you must have a PC-compatible computer, with a 386 processor or better, and with DOS or Windows installed.

  2.  
  3. The software is written in a programming language called Euphoria. To use the software, you must download and install Euphoria on the computer that will be used to administer the experiment.

  4.  
  5. Download the revealed operant library files and sample session:
  6. Below is a short tutorial on the use of this RO software. One file, revop.e, provides most of the control and functionality routines for the experiment. For each session, a file must be created that defines the parameters of the experiment, and executes the blocks by calling routines in revop.e.
The revealed operant software is free for use and/or modification. The software is provided "as-is," without warranty of any kind.

 Please address your questions and comments about the software and documentation to Lauri Jones at ldj@mechnerfoundation.org

 


The RO Software

Basic structure:

An operant consists of a series of keystrokes:
  1. Ra (pressing the space bar)
  2. Rbs (from any of a set of allowed keys. For a correct operant they must include a mandated header followed by some unmandated body keys, followed by a mandated footer.)
  3. Rc (pressing the return key)
The mandated keystrokes at the beginning and end of the operant are called the header and footer. A particular set of mandated keystrokes (for example, "abc" as a header and "def" for a footer) is referred to below as an HF.

 If two few Rbs occur before the Rc, the operant is "incomplete." If enough Rbs occur but the header of footer were incorrect, the operant is "incorrect." If an operant is complete and correct, a reinforcer of money is given, the subject is made to "ring up" that amount, and the cumulative total updated appropriately.

 A block is a set of consecutive operants with the same HFs allowed.

A session is made up of a series of blocks. A session file is a euphoria program in which a number of blocks are executed by calls to the do_block() function (see below). There may or may not be feedback between blocks, depending on the experiment. 


Example Session Files

Below are the example files that define a session. The details are made up - this is not a real experiment. In the example experiment, information common to all sessions is factored out into the file common.e:
--
-- common parameters for rO experiment
--
global integer min_length, ops_per_block
min_length = 12
ops_per_block = 30
global constant keys = "qweasdzxc" -- acceptable keys

-- header/footer pairs
global constant hfs = { {"qwe", "asd"},
                        {"zxc", "dsa"} }

-- text for help keys
global constant helptext = { "",        -- 0
                             "qwe-asd", -- 1
                             "zxc-dsa", -- 2 
                           }

-- schedule of reinforcement
global constant rf = { 5, 0, 10, 0, 0, 15, 5, 0, 10, 15, 0 }
Then, for each session, a file includes this common information, and invokes the main routines according to the schedules set out above:
--
-- revealed operant program
-- session 1
--

include revop.e
include common.e

-- Session-Specific parameters

-- h/f schedule
constant hfsched = {1,2,2,1,1,1,2,2}

--
-- do the session
--
init()

instruct("Use 1.")
do_reinforced_block(ops_per_block, keys, {hfs[1]}, min_length, rf, helptext)

instruct("Switch to 2.")
do_reinforced_block(ops_per_block, keys, {hfs[2]}, min_length, rf, helptext)

for i=1 to 8 do
  instruct("Switch.")
  do_block(ops_per_block, keys, {hfs[hfsched[i]]}, min_length, rf, helptext)
end for

finish()
If you're familiar with Basic or C, this should appear pretty straightforward. To completely understand this code, you'll first have to read through the Euphoria documentation and become familiar with the Euphoria data types: atoms and sequences.


Basic Functions

The functions used in the example session file are described below.

 

instruct(string)

instruct(stringlist)
In the first form, causes the argument string to be displayed on the screen (without the quotation marks). In the second form, causes each string in the argument list to be displayed on a line by itself. Used for prompting the subject. The subject must press the F1 key to continue.

 

do_block(ops, keys, hfs, min_length, rf, helptext)
This function is the meat of the software. It performs a block of operants, the parameters of which are specified in the arguments to the function:

 

The following special versions of do_block() are available as well; they all take the same arguments as do_block() and perform some variation of do_block()'s behavior.
do_reinforced_block(...)
Gives a reinforcer (a flashed green square) after every correct operant (as well as monetary reinforcement according to the rf schedule). Useful for initial introductory blocks.

 

do_diverse_block(...)
Disallows reuse of a HF that's been used within the past 3 trials. Useful as a "momentum breaker" forcing the subject to use a variety of HFs. Implies that hfs contains more than one HF (more than one pair of strings).

 

do_rf_by_hf_block(..., amtsched)
Gives reinforcement according to which HF is used. One extra argument, amtsched, gives the money amounts associated with each HF. Each element in the amtsched sequence gives the reinforcer amount for the corresponding HF in hfs. In this function, the reinforcement schedule argument rf should be 0s and 1s rather than money amounts. Each correct operant will be reinforced if the corresponding entry in rf is 1, and the rf amount will be determined by amtsched and the identity of the HF used. A 0 in rf will mean no reinforcer is given no matter what the HF used was.

 

do_diverse_rf_by_hf_block(..., amtsched)
Reinforcer by HF identity as do_rf_by_hf_block() (above) but also disallows reuse of a HF that's been used within the past 3 trials.