|
ADDM.cpp
|
#include <algorithm>#include <fstream>#include <sstream>#include <iostream>#include <stdexcept>#include <cassert>#include <set>#include <cmath>#include <functional>#include <vector>#include "util.h"#include "addm.h"
Functions | |
| std::map< int, std::vector< aDDMTrial > > | loadDataFromSingleCSV (std::string filename) |
| Load experimental data from a single CSV file. Format expected is: | |
| std::map< int, std::vector< aDDMTrial > > | loadDataFromCSV (std::string expDataFilename, std::string fixDataFilename) |
| Load experimental data from two CSV files: an experimental data file and a fixations file. Format expected for experimental data file: | |
| FixationData | getEmpiricalDistributions (std::map< int, std::vector< aDDMTrial > > data, int timeStep, int maxFixTime, int numFixDists, std::vector< float > valueDiffs, std::vector< int > subjectIDs, bool useOddTrials, bool useEvenTrials, bool useCisTrials, bool useTransTrials) |
| Create empirical distributions fro the data ot be used when generating model simulations. | |
Variables | |
| vector< string > | validComputeMethods = {"basic", "thread"} |
| FixationData getEmpiricalDistributions | ( | std::map< int, std::vector< aDDMTrial > > | data, |
| int | timeStep = 10, | ||
| int | maxFixTime = 3000, | ||
| int | numFixDists = 3, | ||
| std::vector< float > | valueDiffs = {-3,-2,-1, 0, 1, 2, 3}, | ||
| std::vector< int > | subjectIDs = {}, | ||
| bool | useOddTrials = true, | ||
| bool | useEvenTrials = true, | ||
| bool | useCisTrials = true, | ||
| bool | useTransTrials = true ) |
Create empirical distributions fro the data ot be used when generating model simulations.
| data | A mapping of subject IDs to vectors of each subject's corresponding aDDMTrials. |
| timeStep | Minimum duration of a fixation to be considered in milliseconds. |
| maxFixTime | Maximum duration of a fixation to be considered, in milliseconds. |
| numFixDists | Integer indicating the number of fixation types to use in the fixation distributions. I.e. if set to 3, then three separate fixation typyes will be used, corresponding to the first, second, and third fixation in each trial. |
| valueDiffs | List of integers corresponding to the available value differences between item. |
| subjectIDs | List of subject IDs to consider in the empirical data. If left empty, all subjectIDs will be used. |
| useOddTrials | Boolean indicating whether or not to use odd trials when creating the distributions. |
| useEvenTrials | Boolean indicating whether or not to use even trials when creating the distributions. |
| useCisTrials | Boolean indiciating whether or not to use cis trials when creating the distributions. Cis trials are defined as trials in which both items have either positive or negative values. |
| useTransTrials | Boolean indicating whether or not to use trans trials when creating the distributions. Trans trials are defined as trials in which one item has a positive value and one item has a negative value. |
| std::map< int, std::vector< aDDMTrial > > loadDataFromCSV | ( | std::string | expDataFilename, |
| std::string | fixDataFilename ) |
Load experimental data from two CSV files: an experimental data file and a fixations file. Format expected for experimental data file:
parcode, trial, rt, choice, valueLeft, valueRight
Format expected for fixations file:
parcode, trial, fixItem, fixTime
| expDataFilename | Name of the experimental data trial. |
| fixDataFilename | Name of the fixations file. |
| std::map< int, std::vector< aDDMTrial > > loadDataFromSingleCSV | ( | std::string | filename | ) |
Load experimental data from a single CSV file. Format expected is:
trial, choice, rt, valueLeft, valueRight, fixItem, fixTime
| filename | Name of the CSV file. |
| vector<string> validComputeMethods = {"basic", "thread"} |