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

Implementation of a single DDMTrial object. More...

#include <ddm.h>

Public Member Functions

 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< 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

unsigned int RT
 
int choice
 
float valueLeft
 
float valueRight
 
vector< float > RDVs
 
int timeStep
 

Detailed Description

Implementation of a single DDMTrial object.

A DDMTrial 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 be aggregated together for model fitting and likelihood computations.

Constructor & Destructor Documentation

◆ DDMTrial() [1/2]

DDMTrial::DDMTrial ( unsigned int RT,
int choice,
float valueLeft,
float valueRight )

Construct a new DDMTrial 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.

◆ DDMTrial() [2/2]

DDMTrial::DDMTrial ( )
inline

Construct an empty DDMTrial object.

Member Function Documentation

◆ loadTrialsFromCSV()

std::vector< DDMTrial > DDMTrial::loadTrialsFromCSV ( string filename)
static

Load a dataset of DDMTrials into program memory.

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

◆ writeTrialsToCSV()

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

Write a vector of DDMTrials to a CSV file.

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

Member Data Documentation

◆ choice

int DDMTrial::choice

Either -1 for the left item or +1 for the right item.

◆ RDVs

vector<float> DDMTrial::RDVs

The RDV signal recorded at each timestep.

◆ RT

unsigned int DDMTrial::RT

Response time in milliseconds.

◆ timeStep

int DDMTrial::timeStep

The length of each timestep in milliseconds.

◆ valueLeft

float DDMTrial::valueLeft

Value of the left item.

◆ valueRight

float DDMTrial::valueRight

Value of the right items.


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