BroderClocks

broderclocks. BroderClocks

Manages the ClockInferenceEngine and ClockUtil classes and communicates with the keyboard application. Handles switch-press events and makes selection decisions based on the clock probabilities.

Constructor

new BroderClocks(parent)

Source:
Properties:
Name Type Description
clock_inf ClockInference

The instance of the ClockInference class.

abs_click_times Array.<number>

An array of the 'absolute' click times from the user leading up to the next selection. Absolute click times are UNIX timestamps (ms since Epoch). abs_click_times are added as the user clicks.

rel_click_times Array.<number>

An array of the 'relative' click times from the user leading up to the next selection. Relative click times are the time in ms that the user clicked relative to when the clock they selected was at noon. rel_click_times are added in ClockInferenceEngine.learn_scores() following config.learn_delay rounds after a selection is made.

latest_time number

The last time that the screen was updated as a UNIX timestamps (ms since Epoch). Updated in ClockUtil.increment(). Used to account for the framerate when the user clicks.

Parameters:
Name Type Description
parent Keyboard

the parent class, usually an instance of the Keyboard class

Methods

continue_select(results)

Description:
  • Continues the select process after the word cache promise has loaded

Source:
Parameters:
Name Type Description
results Object

Object with 5 parameters specifying the setup for the new round:

Properties
Name Type Description
words_on Array.<number>

the clocks turned on given the new word predictions

words_off Array.<number>

the clocks turned off given the new word predictions

word_score_prior Array.<number>

the prior distribution for the clocks_on given the new lm results

is_undo Boolean

whether the undo clock was selected in the last selection round

is_equalize Boolean

? holdover from an obsolete corrective character

skip_hist Boolean

? need to figure this out

init_bits()

Description:
  • re-initializes variables at the beginning of a new selection round

Source:

init_follow_up(clock_score_prior)

Description:
  • re-initializes variables at the beginning of a new selection round.

Source:
Parameters:
Name Type Description
clock_score_prior Array.<number>

the prior probabilities from the language model of the clocks currently on.

init_round(is_win, is_start, clock_score_prior)

Description:
  • Sets up the inference aspects for a new round following a switch event

Source:
Parameters:
Name Type Description
is_win Boolean

Whether a clock is selected after the switch event.

is_start Boolean

Whether this is the first round after a switch event.

clock_score_prior Array.<number>

The prior probabilities over the active clocks before the switch event.

select(time_in)

Description:
  • triggered by a switch-press event in the main keyboard class. Updates the clock posteriors and the histogram given the information in the new click.

Source:
Parameters:
Name Type Description
time_in float

The epoch-timestamp in ms that the user clicked their switch.