import JND_Radius from 'VCL-Web-Framework/scripts/experiments/jnd_radius/jnd_radius.js'
JND_Radius
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 |
graph_type: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
subject_id: * |
|
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 |
check_response(data: *): boolean 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 |
get_next_adjusted_statistic(correct: *): * 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:
Name | Type | Attribute | Description |
params | * | {assoc array} Parameters passed from routing. |
Public Members
public PIXELS_PER_CM: * source
public adjusted_quantity_matrix: {} source
public balancing_type: * source
public condition_name: * source
public graph_type: * source
public raw_constants: * source
public sub_condition_order: * source
public sub_conditions_constants: * source
public subject_id: * source
public subject_initials: * 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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
data | * | {JsPsych.data} |
public end_sub_condition(): boolean source
Determines whether the current sub condition can end or not.
public generate_trial(type: *): * source
Generates a JND trial object for use in the JsPsych timeline.
Params:
Name | Type | Attribute | Description |
type | * | {string} "test" or "practice" |
Return:
* | trial {object} |
public get_next_adjusted_statistic(correct: *): * source
Calculates the next adjusted correlation/statistic.
Params:
Name | Type | Attribute | Description |
correct | * | {boolean}
converge_from_above {boolean} |
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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
converge_from_above | * | {boolean} |
Return:
* | adjusted_radius {double} |
public is_converged_in_window(): boolean source
Determines whether current subcondition has converged or not.
public prepare_experiment(balancing_type: *) source
Orders the input data according to balancing type and initializes the JND object's variables.
Params:
Name | Type | Attribute | Description |
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. |