import Estimation from 'VCL-Web-Framework/scripts/experiments/estimation/estimation.js'
Estimation
Constructor Summary
Public Constructor | ||
public |
constructor(params: *) Initializes a Estimation experiment object. |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
PIXEL_TO_CM: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
curr_trial_data: {} |
|
public |
|
|
public |
|
|
public |
graph_type: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
practice_trial_data: *[] |
|
public |
|
|
public |
results: *[] |
|
public |
|
|
public |
|
|
public |
subject_id: * |
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
append_mod_attributes(sub_cond: object) Computes attributes for the modifiable shape for multi interference conditions. |
|
public |
append_ref_sub_attributes(sub_cond: object) Computes attributes for the sub shape on the ref side for multi interference conditions. |
|
public |
calculate_length_from_area_ratio(S1_shape_type: string): double For 2 shapes S1 and S2, with an area ratio of S1:S2, computes the length for S2 to maintain this area ratio. |
|
public |
calculate_y_position(radius: number, whether: boolean): number Calculates the y value of the position where the shape should be plotted |
|
public |
compute_bisection_attributes(sub_cond: object): * Computes attributes for bisection conditions (AKA has "bisection" in condition name). |
|
public |
compute_estimation_interference_attributes(sub_cond: object): * Computes attributes for single-interference conditions (AKA no "multi" in condition name). |
|
public |
compute_estimation_multi_interference_attributes(sub_cond: object): * Computes attributes for multi-interference conditions (AKA has "multi" in condition name). |
|
public |
compute_fan_area(angle: double): double Computes the area for a fan. |
|
public |
compute_plot_attributes(experiment: object): * Computes attributes for all estimation plots. |
|
public |
compute_shape_area(shape: string): double Computes the area for a given shape and the size. |
|
public |
compute_shape_length(shape_type: string): double Computes the shape length with the specified area. |
|
public |
|
|
public |
generate_trial(block_type: *): * Generates a Estimation object for use in the JsPsych timeline. |
|
public |
Orders the input data according to balancing type and initializes the Estimation object's variables. |
|
public |
Creates the practice dataset by taking the first FOUR subconditions. |
|
public |
save_adjustment(adjustment: double) Appends the adjustment to the curr_trial_data.adjustments. |
|
public |
save_estimated_area(area: double) Saves the estimated area to the curr_trial_data. |
|
public |
save_estimated_size(estimated_size: double) Saves the estimated size to the curr_trial_data. |
|
public |
save_reference_shape_area(attributes: object) Saves and computes the ref shape area to the curr_trial_data. |
|
public |
Resets all relevant variables to use that of the experiment. |
|
public |
update_curr_cond_idx(trial_data: *) Update the index of the condition that is being referred to |
|
public |
update_curr_round_number(trial_data: *) Update the current round number |
|
public |
update_input_array(data: *) Set the current trial's number of inputs in the input_count_array |
Public Constructors
public constructor(params: *) source
Initializes a Estimation experiment object.
Params:
Name | Type | Attribute | Description |
params | * | {object} Parameters passed in from routing |
Public Members
public PIXEL_TO_CM: * source
public adjusted_midpoint_matrix: {} source
public balancing_type: * source
public condition_name: * source
public curr_conditions_constants: *[] source
public curr_trial_data: {} source
public experiment_conditions_constants: *[] source
public graph_type: * source
public interf_shape_variables: {} source
public practice_conditions_constants: *[] source
public practice_trial_data: *[] source
public raw_sub_conds: * source
public results: *[] source
public sub_condition_order: * source
public subject_id: * source
public subject_initials: * source
public trial_structure: * source
Public Methods
public append_mod_attributes(sub_cond: object) source
Computes attributes for the modifiable shape for multi interference conditions. Additionally adjusts the main shape on the mod side depending on the alignment.
Params:
Name | Type | Attribute | Description |
sub_cond | object | {object} attributes {boolean} is_ref_left |
public append_ref_sub_attributes(sub_cond: object) source
Computes attributes for the sub shape on the ref side for multi interference conditions. Additionally adjusts the main shape on the ref side depending on the alignment.
Params:
Name | Type | Attribute | Description |
sub_cond | object | {object} attributes {boolean} is_ref_left |
public calculate_length_from_area_ratio(S1_shape_type: string): double source
For 2 shapes S1 and S2, with an area ratio of S1:S2, computes the length for S2 to maintain this area ratio.
Params:
Name | Type | Attribute | Description |
S1_shape_type | string | {double} S1_length (in pixels)
{double} S1_S2_area_ratio (S1 area / S2 area) |
Return:
double | S2_length (in pixels) |
public calculate_y_position(radius: number, whether: boolean): number source
Calculates the y value of the position where the shape should be plotted
public compute_bisection_attributes(sub_cond: object): * source
Computes attributes for bisection conditions (AKA has "bisection" in condition name).
Params:
Name | Type | Attribute | Description |
sub_cond | object | {object} attributes |
Return:
* |
public compute_estimation_interference_attributes(sub_cond: object): * source
Computes attributes for single-interference conditions (AKA no "multi" in condition name).
Params:
Name | Type | Attribute | Description |
sub_cond | object | {object} attributes |
Return:
* |
public compute_estimation_multi_interference_attributes(sub_cond: object): * source
Computes attributes for multi-interference conditions (AKA has "multi" in condition name).
Params:
Name | Type | Attribute | Description |
sub_cond | object | {object} attributes |
Return:
* |
public compute_fan_area(angle: double): double source
Computes the area for a fan.
Params:
Name | Type | Attribute | Description |
angle | double | (in degrees) {double} radius (in pixels) |
Return:
double | area (in CM^2) |
public compute_plot_attributes(experiment: object): * source
Computes attributes for all estimation plots.
Params:
Name | Type | Attribute | Description |
experiment | object |
Return:
* |
public compute_shape_area(shape: string): double source
Computes the area for a given shape and the size.
Params:
Name | Type | Attribute | Description |
shape | string | {string} size (in pixels) |
Return:
double | area (in CM^2) |
public compute_shape_length(shape_type: string): double source
Computes the shape length with the specified area.
Params:
Name | Type | Attribute | Description |
shape_type | string | {double} target area |
Return:
double | length |
public export_trial_data() source
public generate_trial(block_type: *): * source
Generates a Estimation object for use in the JsPsych timeline.
Params:
Name | Type | Attribute | Description |
block_type | * | {string} "test" or "practice" |
Return:
* | trial {object} |
public prepare_experiment() source
Orders the input data according to balancing type and initializes the Estimation object's variables.
public prepare_practice() source
Creates the practice dataset by taking the first FOUR subconditions.
public save_adjustment(adjustment: double) source
Appends the adjustment to the curr_trial_data.adjustments.
Params:
Name | Type | Attribute | Description |
adjustment | double |
public save_estimated_area(area: double) source
Saves the estimated area to the curr_trial_data.
Params:
Name | Type | Attribute | Description |
area | double | {string} unit of the estimated_area |
public save_estimated_size(estimated_size: double) source
Saves the estimated size to the curr_trial_data.
Params:
Name | Type | Attribute | Description |
estimated_size | double | {string} unit of the estimated_size |
public save_reference_shape_area(attributes: object) source
Saves and computes the ref shape area to the curr_trial_data.
- For normal estimation conditions (AKA one shape on mod and one shape on ref side), will use the single shape on the ref side
- For multi interference conditions, is using the main shape on the mod side
- For interference conditions, is using the single shape on ref side
- For bisection conditions, it is taking the midpoint between the left and right reference shape areas
Params:
Name | Type | Attribute | Description |
attributes | object |
public set_variables_to_experiment() source
Resets all relevant variables to use that of the experiment. (input_count_array, curr_conditions_constants, and curr_condition_index are shared variables between the practice and test trials).
This function is called once all the practice trials have run.
public update_curr_cond_idx(trial_data: *) source
Update the index of the condition that is being referred to
Params:
Name | Type | Attribute | Description |
trial_data | * | {object} the trail.data object from jsPsych |
public update_curr_round_number(trial_data: *) source
Update the current round number
Params:
Name | Type | Attribute | Description |
trial_data | * | {object} the trial.data object from jsPsych |
public update_input_array(data: *) source
Set the current trial's number of inputs in the input_count_array
Params:
Name | Type | Attribute | Description |
data | * | {object} the trial.data object from jsPsych |