Home Reference Source
public class | source

JND_Radius

You can directly use an instance of this class. jnd_radius_exp

Constructor Summary

Public Constructor
public

constructor(params: *)

Initializes a JND_Radius experiment object.

Member Summary

Public Members
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public

Method Summary

Public Methods
public

calculate_adjusted_radius(constants: *): *

Calculates the adjusted radius depending on whether this is the first trial of the sub condition or not.

public

Given a JND trial data, determines whether response is correct or not.

public

Determines whether the current sub condition can end or not.

public

When called, will save aggregated trial data into a CSV.

public

When called, will save individual trial data into a CSV.

public

generate_trial(type: *): *

Generates a JND trial object for use in the JsPsych timeline.

public

Calculates the next adjusted correlation/statistic.

public

handle_data_saving(trial: *)

Handles saving the relevant data on a given trial.

public

initialize_adjusted_statistic(converge_from_above: *): *

Initializes the adjusted radius for the first time.

public

Determines whether current subcondition has converged or not.

public

prepare_experiment(balancing_type: *)

Orders the input data according to balancing type and initializes the JND object's variables.

Public Constructors

public constructor(params: *) source

Initializes a JND_Radius experiment object.

Params:

NameTypeAttributeDescription
params *

{assoc array} Parameters passed from routing.

Public Members

public CONVERGENCE_THRESHOLD: number source

public INCORRECT_MULTIPLIER: number source

public MAX_RADIUS: number source

public MAX_TRIALS: number source

public MIN_RADIUS: number source

public MIN_TRIALS: number source

public PIXELS_PER_CM: * source

public WINDOW_INTERVAL: number source

public WINDOW_SIZE: number source

public adjusted_quantity_matrix: {} source

public balancing_type: * source

public condition_name: * source

public current_sub_condition_index: number source

public first_trial_of_sub_condition: boolean source

public graph_type: * source

public left_radius: string source

public raw_constants: * source

public right_radius: string source

public sub_condition_order: * source

public sub_conditions_constants: * source

public subject_id: * source

public subject_initials: * source

public trial_data: string source

public trial_structure: * source

Public Methods

public calculate_adjusted_radius(constants: *): * source

Calculates the adjusted radius depending on whether this is the first trial of the sub condition or not.

Params:

NameTypeAttributeDescription
constants *

{assoc array}

Return:

*

adjusted_radius {double}

public check_response(data: *): boolean source

Given a JND trial data, determines whether response is correct or not.

Params:

NameTypeAttributeDescription
data *

{JsPsych.data}

Return:

boolean

public end_sub_condition(): boolean source

Determines whether the current sub condition can end or not.

Return:

boolean

True if sub condition should end.

public export_summary_data() source

When called, will save aggregated trial data into a CSV.

public export_trial_data() source

When called, will save individual trial data into a CSV.

public generate_trial(type: *): * source

Generates a JND trial object for use in the JsPsych timeline.

Params:

NameTypeAttributeDescription
type *

{string} "test" or "practice"

Return:

*

trial {object}

public get_next_adjusted_statistic(correct: *): * source

Calculates the next adjusted correlation/statistic.

Params:

NameTypeAttributeDescription
correct *

{boolean} converge_from_above {boolean}
adjusted_quantity {double}
base_correlation {double} initial_difference {double}

Return:

*

adjusted_correlation {double}

public handle_data_saving(trial: *) source

Handles saving the relevant data on a given trial.

For reference, these are the helper variables created to assist in trial logic (i.e not present in excel) trial_variables =
{type: 'jnd', run_type: '', left_radius: '', right_radius: '', };

These are variables created WITHIN the trial logic that were not present in excel (but need to be outputted to results).
export_variables = {sub_condition: '', // Chronological ordering of sub_condition [1, 2, 3 ... ] balanced_sub_condition: '', // Index of sub_condition according to balancing order jnd: '', base_radius: '', adjusted_radius: '', correct: '', };

Params:

NameTypeAttributeDescription
trial *

{object} block_type {string} "test" or "practice" constants {assoc array} index {integer} adjusted_correlation {double}

public initialize_adjusted_statistic(converge_from_above: *): * source

Initializes the adjusted radius for the first time.

Params:

NameTypeAttributeDescription
converge_from_above *

{boolean}
base_radius {double}
initial_difference {double}

Return:

*

adjusted_radius {double}

public is_converged_in_window(): boolean source

Determines whether current subcondition has converged or not.

Return:

boolean

True if converged.

public prepare_experiment(balancing_type: *) source

Orders the input data according to balancing type and initializes the JND object's variables.

Params:

NameTypeAttributeDescription
balancing_type *

{string} Type of balancing. Currently only latin_square is supported. data_set {[{assoc array}, {assoc array}, ... ]} The data to be ordered. practice_set {[{assoc array}, {assoc array}, ... ]} The practice data.