/// <summary> /// Gets the average error rate across all conditions for which there were any completed test trials. /// </summary> /// <param name="ex">Determines which outlier types to exclude, if any.</param> /// <returns>The average error rate for executed conditions in this session.</returns> public double GetErrorRate(ExcludeOutliersType ex) { double rate = 0.0; int conditions = 0; foreach (ConditionData fc in _conditions) { if (fc.NumCompletedTestTrials > 0) { rate += fc.GetErrorRate(ex); conditions++; } } return((conditions > 0) ? rate / conditions : 0.0); }
/// <summary> /// Gets the average movement time in milliseconds of completed trials in this condition. /// </summary> /// <param name="ex">Indicates which types of outliers, spatial or temporal (or both) are excluded.</param> /// <returns>The effective movement time in milliseconds.</returns> public long GetMTe(ExcludeOutliersType ex) { int trials = 0; long mte = 0L; for (int i = 1; i < _trials.Count; i++) // start beyond the special start-area trial { if (!_trials[i].IsPractice && _trials[i].IsComplete && ((ex & ExcludeOutliersType.Spatial) == 0 || !_trials[i].IsSpatialOutlier) && ((ex & ExcludeOutliersType.Temporal) == 0 || !_trials[i].IsTemporalOutlier)) { mte += _trials[i].MTe; trials++; } } return((trials > 0) ? mte / trials : 0L); }
/// <summary> /// Gets the number of completed error trials in this condition. /// </summary> /// <param name="ex">Indicates which types of outliers, spatial or temporal (or both) are excluded.</param> /// <returns>The number of error trials in this condition.</returns> public int GetNumErrors(ExcludeOutliersType ex) { int errors = 0; for (int i = 1; i < _trials.Count; i++) // start beyond the special start area trial { if (!_trials[i].IsPractice && _trials[i].IsComplete && ((ex & ExcludeOutliersType.Spatial) == 0 || !_trials[i].IsSpatialOutlier) && ((ex & ExcludeOutliersType.Temporal) == 0 || !_trials[i].IsTemporalOutlier)) { if (_trials[i].IsError) { errors++; } } } return(errors); }
/// <summary> /// Gets the rate of errors among completed trials in this condition. The range is 0.0 to 1.00. If /// outliers are excluded, this is the rate of errors among only those trials that are not outliers. /// </summary> /// <param name="ex">Indicates which types of outliers, spatial or temporal (or both) are excluded.</param> /// <returns>The error rate for trials in this condition.</returns> public double GetErrorRate(ExcludeOutliersType ex) { int errors = 0; int trials = 0; for (int i = 1; i < _trials.Count; i++) // start beyond the special start area trial { if (!_trials[i].IsPractice && _trials[i].IsComplete && ((ex & ExcludeOutliersType.Spatial) == 0 || !_trials[i].IsSpatialOutlier) && ((ex & ExcludeOutliersType.Temporal) == 0 || !_trials[i].IsTemporalOutlier)) { if (_trials[i].IsError) { errors++; } trials++; } } return((trials > 0) ? (double)errors / trials : 0.0); }