pyoperant.reinf module¶
-
class
pyoperant.reinf.
BaseSchedule
[source]¶ Bases:
object
Maintains logic for deciding whether to consequate trials.
This base class provides the most basic reinforcent schedule: every response is consequated.
Methods: consequate(trial) – returns a boolean value based on whether the trial
should be consequated. Always returns True.
-
class
pyoperant.reinf.
ContinuousReinforcement
[source]¶ Bases:
pyoperant.reinf.BaseSchedule
Maintains logic for deciding whether to consequate trials.
This base class provides the most basic reinforcent schedule: every response is consequated.
Methods: consequate(trial) – returns a boolean value based on whether the trial
should be consequated. Always returns True.
-
class
pyoperant.reinf.
FixedRatioSchedule
(ratio=1)[source]¶ Bases:
pyoperant.reinf.BaseSchedule
Maintains logic for deciding whether to consequate trials.
This class implements a fixed ratio schedule, where a reward reinforcement is provided after every nth correct response, where ‘n’ is the ‘ratio’.
Incorrect trials are always reinforced.
Methods: consequate(trial) – returns a boolean value based on whether the trial
should be consequated.
-
class
pyoperant.reinf.
PercentReinforcement
(prob=1)[source]¶ Bases:
pyoperant.reinf.BaseSchedule
Maintains logic for deciding whether to consequate trials.
This class implements a probabalistic reinforcement, where a reward reinforcement is provided x percent of the time.
Incorrect trials are always reinforced.
Methods: consequate(trial) – returns a boolean value based on whether the trial
should be consequated.
-
class
pyoperant.reinf.
VariableRatioSchedule
(ratio=1)[source]¶ Bases:
pyoperant.reinf.FixedRatioSchedule
Maintains logic for deciding whether to consequate trials.
This class implements a variable ratio schedule, where a reward reinforcement is provided after every a number of consecutive correct responses. On average, the number of consecutive responses necessary is the ‘ratio’. After a reinforcement is provided, the number of consecutive correct trials needed for the next reinforcement is selected by sampling randomly from the interval [1,2*ratio-1]. e.g. a ratio of ‘3’ will require consecutive correct trials of 1, 2, 3, 4, & 5, randomly.
Incorrect trials are always reinforced.
Methods: consequate(trial) – returns a boolean value based on whether the trial
should be consequated.