Home Reference Source
public class | source

Estimation

You can directly use an instance of this class. estimation_exp

Constructor Summary

Public Constructor
public

constructor(params: *)

Initializes a Estimation 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
public
public

results: *[]

public
public
public
public
public

Method Summary

Public Methods
public

Computes attributes for the modifiable shape for multi interference conditions.

public

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

Calculates the y value of the position where the shape should be plotted

public

Computes attributes for bisection conditions (AKA has "bisection" in condition name).

public

Computes attributes for single-interference conditions (AKA no "multi" in condition name).

public

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

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

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

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:

NameTypeAttributeDescription
params *

{object} Parameters passed in from routing

Public Members

public MARGIN: number source

public MAX_STEP_INTERVAL: number source

public MAX_STEP_SIZE: number source

public MAX_Y_POS_JITTER: number source

public PIXEL_TO_CM: * source

public ROUNDS_PER_COND: number source

public X_DISTANCE_BETWEEN_SHAPES: number source

public Y_DIVIATION_FROM_X_AXIS: number source

public adjusted_midpoint_matrix: {} source

public balancing_type: * source

public condition_name: * source

public curr_condition_index: number source

public curr_conditions_constants: *[] source

public curr_round_num: number source

public curr_trial_data: {} source

public current_practice_condition_index: number source

public experiment_conditions_constants: *[] source

public graph_type: * source

public input_count_array: number[] source

public interf_shape_variables: {} source

public is_practice: boolean source

public practice_conditions_constants: *[] source

public practice_end: boolean source

public practice_trial_data: *[] source

public raw_sub_conds: * source

public results: *[] source

public round_end: boolean 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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
S1_shape_type string

{double} S1_length (in pixels) {double} S1_S2_area_ratio (S1 area / S2 area)
{string} S2_shape_type

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

Params:

NameTypeAttributeDescription
radius number

the radius of the shape

whether boolean

to jitter the y pos or not

Return:

number

public compute_bisection_attributes(sub_cond: object): * source

Computes attributes for bisection conditions (AKA has "bisection" in condition name).

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
sub_cond object

{object} attributes

Return:

*

public compute_fan_area(angle: double): double source

Computes the area for a fan.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
experiment object

Return:

*

public compute_shape_area(shape: string): double source

Computes the area for a given shape and the size.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
adjustment double

public save_estimated_area(area: double) source

Saves the estimated area to the curr_trial_data.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
trial_data *

{object} the trail.data object from jsPsych

public update_curr_round_number(trial_data: *) source

Update the current round number

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
data *

{object} the trial.data object from jsPsych