ADDM.cpp
Loading...
Searching...
No Matches
aDDMTrial Class Reference

Implementation of a single aDDMTrial object. More...

#include <addm.h>

Public Member Functions

 aDDMTrial (unsigned int RT, int choice, float valueLeft, float valueRight, vector< int > fixItem={}, vector< int > fixTime={}, vector< float > fixRDV={}, float uninterruptedLastFixTime=0)
 Construct a new aDDM Trial object.
 
 aDDMTrial ()
 Construct an empty aDDMTrial object.
 
- Public Member Functions inherited from DDMTrial
 DDMTrial (unsigned int RT, int choice, float valueLeft, float valueRight)
 Construct a new DDMTrial object.
 
 DDMTrial ()
 Construct an empty DDMTrial object.
 

Static Public Member Functions

static void writeTrialsToCSV (vector< aDDMTrial > trials, string filename)
 Write a vector of aDDMTrials to a CSV file.
 
static vector< aDDMTrial > loadTrialsFromCSV (string filename)
 Load a dataset of aDDMTrials into program memory.
 
- Static Public Member Functions inherited from DDMTrial
static void writeTrialsToCSV (vector< DDMTrial > trials, string filename)
 Write a vector of DDMTrials to a CSV file.
 
static vector< DDMTrial > loadTrialsFromCSV (string filename)
 Load a dataset of DDMTrials into program memory.
 

Public Attributes

vector< int > fixItem
 
vector< int > fixTime
 
vector< float > fixRDV
 
float uninterruptedLastFixTime
 
- Public Attributes inherited from DDMTrial
unsigned int RT
 
int choice
 
float valueLeft
 
float valueRight
 
vector< float > RDVs
 
int timeStep
 

Detailed Description

Implementation of a single aDDMTrial object.

An aDDMTrial can either be generated by simulating data trials or loading from a CSV. A single trial represents an individual binary perceptual choice made by one subject. These trials can be aggregated together for model fitting and likelihood computations.

Constructor & Destructor Documentation

◆ aDDMTrial() [1/2]

aDDMTrial::aDDMTrial ( unsigned int RT,
int choice,
float valueLeft,
float valueRight,
vector< int > fixItem = {},
vector< int > fixTime = {},
vector< float > fixRDV = {},
float uninterruptedLastFixTime = 0 )

Construct a new aDDM Trial object.

Parameters
RTResponse time in milliseconds.
choiceEither -1 for the left item or +1 for the right item.
valueLeftValue of the left item.
valueRightValue of the right item.
fixItemVector of integers representing the items fixated on during the trial in chronological order. 1 corresponds to left, 2 corresponds to right, and any other value is considered a transition or blank fixation.
fixTimeVector of integers corresponding to the duration of each fixation. Must be equal in size to fixItem.
fixRDVVector of floats corresopnding to the RDV values at the end of each fixation.
uninterruptedLastFixTimeInteger corresponding to the duration (milliseconds) that the last fixation in the trial would have if it had not been terminated when a decision had been made.

◆ aDDMTrial() [2/2]

aDDMTrial::aDDMTrial ( )
inline

Construct an empty aDDMTrial object.

Member Function Documentation

◆ loadTrialsFromCSV()

vector< aDDMTrial > aDDMTrial::loadTrialsFromCSV ( string filename)
static

Load a dataset of aDDMTrials into program memory.

Parameters
filenameLocation of the data trials.
Returns
vector<aDDMTrial> containing the stored trials.

◆ writeTrialsToCSV()

void aDDMTrial::writeTrialsToCSV ( vector< aDDMTrial > trials,
string filename )
static

Write a vector of aDDMTrials to a CSV file.

Parameters
trialsVector of trials to be saved.
filenameFile to store the trials in.

Member Data Documentation

◆ fixItem

vector<int> aDDMTrial::fixItem

Vector of integers representing the items fixated on during the trial in chronological order. 1 corresponds to left, 2 corresponds to right, and any other value is considered a fixation or blank fixation.

◆ fixRDV

vector<float> aDDMTrial::fixRDV

Vector of floats corresponding to the RDV values at the end of each fixation.

◆ fixTime

vector<int> aDDMTrial::fixTime

Vector of integers corresponding to the duration of each fixation.

◆ uninterruptedLastFixTime

float aDDMTrial::uninterruptedLastFixTime

Integer corresponding to the duration (milliseconds) that the last fixation in the trial would have if it had not been terminated when a decision had been made.


The documentation for this class was generated from the following files: