class.stimulus: Stimulus Function class

Description Usage Format Details Slots Built-in stimulus functions Make an stimulus object from a stimulus function See Also Examples

Description

Stimulus functions are general functions for representing environmental stimuli.

Usage

1
2
3

Format

The show method prints the function that is contained in the stimulus object as well as the type of object (i.e. "elemental") and the class (i.e. "stimulus" ).

Details

In the CAB package, objects from classes like Stimulus are called 'elemental' objects That is, they comprise a particular element of the simulation without any specified parameter values. 'Control' objects are elemental objects with an associated list of parameter values. Refer to class.DOR for information for putting a Stimulus in a model.

When the stimulus object is used to contain a reinforcement schedule, the entire schedule should be programmed into the Stimulus function that is contained in the stimulus object. Alternatively, one may define different custom classes such as stimulus1 and stimulus2 to manage different parts of the schedule (for example, stimulus1 and stimulus2 may manage reinforcement schedules on two keys on a concurrent schedule). If the user wishes to create separate classes for parts of reinforcement schedules, then it is up to the user to make sure that they interact properly.

The show method for the stimulus class can be removed with the function remove.stimulus.show() and reinstated with stimulus.show.

Slots

stimulus

This will contain a stimulus function. See examples.

name

The name of the stimulus object.

type

This will be elemental because the stimulus is an elemental object.

Built-in stimulus functions

A list of the built-in stimulus functions. The function definitions can be seen by calling the name of the function without brackets. Each of these functions return the next time (or number of responses) when reinforcement is arranged.

true_VI_fx(VI_interval, time)

A variable-interval schedule where the next food is arranged at a time that is sampled from an Exponential distribution. The density is:

f(t; λ) = 1/λ * e^(- 1/λ * t )

where λ is the arranged inter-reinforcement interval. See rexp

FI_fx(FI_interval, time)

A fixed-interval schedule where the next food is arranged at a fixed time since the last food was delivered.

poisson_VR_fx(VR_length, resps)

A variable-ratio schedule where the next food is arranged after a number of responses that is sampled from a Poisson distribution. The density is:

f(t; λ) = λ^t * e^-t / t!

where λ is the arranged ratio requirement. See rpois

FR_fx(FR_length, resps)

A fixed-ratio schedule where the next food is arranged at a fixed number of responses since the last food was delivered.

Make an stimulus object from a stimulus function

Use the make.stimulus function to make a stimulus object.

Usage

make.stimulus( stimulus_fx, name )

Arguments

stimulus_fx

A function that represents the stimulus of interest

name

A character vector specifying the name of your stimulus object

Value

Returns a stimulus object.

See Also

make.control for making DOR_control objects.

set.custom_elemental for setting custom elemental classes.

make.custom_elemental for making custom elemental objects.

e_show for the function that is called by the show method.

accessor_helpers for the helper functions used in the built-in DOR functions.

class.elemental for the parent elemental class.

Examples

1
2
3
4
5
# Make a variable-interval schedule
# Look at the definition of the "true_VI_fx" stimulus function
true_VI_fx
# Make a stimulus object out of the "true_VI_fx" stimulus function
vi_schedule = make.stimulus( stimulus_fx = true_VI_fx, name = "vi_schedule" )

Don-Li/CAB_original documentation built on May 6, 2019, 2:53 p.m.