tasks.beads module¶
| Author: | Dominic Hunt |
|---|---|
| Reference: | Jumping to conclusions: a network model predicts schizophrenic patients’ performance on a probabilistic reasoning task. Moore, S. C., & Sellen, J. L. (2006). Cognitive, Affective & Behavioral Neuroscience, 6(4), 261–9. Retrieved from http://www.ncbi.nlm.nih.gov/pubmed/17458441 |
-
class
tasks.beads.Beads(N=None, beadSequence=[1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0])[source]¶ Bases:
tasks.taskTemplate.TaskBased on the Moore & Sellen Beads task
Many methods are inherited from the tasks.taskTemplate.Task class. Refer to its documentation for missing methods.
-
Name¶ The name of the class used when recording what has been used.
Type: string
Parameters: -
next()[source]¶ Produces the next bead for the iterator
Returns: - bead ({0,1})
- nextValidActions (Tuple of ints or
None) – The list of valid actions that the model can respond with. Set to (0,1), as they never vary.
Raises: StopIteration
-
receiveAction(action)[source]¶ Receives the next action from the participant
Parameters: action (int or string) – The action taken by the model
-
-
class
tasks.beads.RewardBeadDirect(**kwargs)[source]¶ Bases:
model.modelTemplate.RewardsProcesses the beads reward for models expecting just the reward
-
class
tasks.beads.StimulusBeadDirect(**kwargs)[source]¶ Bases:
model.modelTemplate.StimulusProcesses the beads stimuli for models expecting just the event
-
class
tasks.beads.StimulusBeadDualDirect(**kwargs)[source]¶ Bases:
model.modelTemplate.StimulusProcesses the beads stimuli for models expecting a tuple of
[event,1-event]
-
class
tasks.beads.StimulusBeadDualInfo(**kwargs)[source]¶ Bases:
model.modelTemplate.StimulusProcesses the beads stimuli for models expecting the reward information from two possible actions
Parameters: oneProb (float in [0,1]) – The probability of a 1 from the first jar. This is also the probability of a 0 from the second jar.event_infois calculated asoneProb*event + (1-oneProb)*(1-event)-
oneProb= [0, 1]¶
-
-
tasks.beads.generateSequence(numBeads, oneProb, switchProb)[source]¶ Designed to generate a sequence of beads with a probability of switching jar at any time.
Parameters: - numBeads (int) – The number of beads in the sequence
- oneProb (float in
[0,1]) – The probability of a 1 from the first jar. This is also the probability of a 0 from the second jar. - switchProb (float in
[0,1]) – The probability that the drawn beads change the jar they are being drawn from
Returns: sequence – The generated sequence of beads
Return type: list of
{0,1}