Revealed Operant Software
This page contains links to the software needed to run a revealed operant
experiment, and documentation about how to use it.
-
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.
-
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.
-
Download the revealed operant library files and sample session:
-
revop.e: provides the display and control routines
for revealed operant sessions.
-
math.e: Provides a couple of utility routines used
by revop.e.
-
common.e: a sample "common parameter" file, used
by the sample session file.
-
s1.ex: a sample session file
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:
-
Ra (pressing the space bar)
-
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.)
-
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:
-
ops: (an atom) the number of correct operants that must be completed to
finish the block.
-
keys (a sequence) the list of "acceptable" keys for the Rbs. Other keys
are ignored.
-
hfs (a sequence of sequences of strings) See the definition of hfs in common.e
above. Each internal sequence is a pair of strings defining an HF. The
first string of each pair defines the header, the second defines the footer.
If more than one HF is passed in to do_block() any HF will be accepted,
but headers and footers from different HFs may not be mixed.
-
min_length (an atom): the total length (including the header and footer
keys) that the series of Rbs must reach to be complete.
-
rf (a sequence): the schedule for the the amount of reinforcer (money)
to be awarded if the subject completes each operant correctly. This amount
will be presented on the screen and added to the coumulative total after
it is "rung up." If the length of the sequence is less than the number
of operants in the block, the schedule is repeated.
-
helptext (a sequence of strings): between operants, the subject may press
a key on the number pad to be reminded of the header/footer combinations.
This variable describes what string should be presented on the screen for
each of the keys on the number pad.
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.