tnt.metrics
Class ModelDefinition

java.lang.Object
  extended by tnt.metrics.ModelDefinition

public class ModelDefinition
extends java.lang.Object

This class encapsulates values similar to those defined in FittsTwoThumb.txt for processing by FittsTwoThumb.java. However, this class represents additional objects definining a model of text entry for processing by TnWPM.java. Values can be loaded from a model definition file or set individually. Comment lines are allowed and begin with '#'

An example model definition file is...

        # word-frequency-keystroke file
        d2-ST_ksfreq.txt
        # keyboard definition file
        7100t_digitization_v2.txt
        # left thumb letter assignments (leave blank if none)
        Q12A45Z78N
        # right thumb letter assignments (leave blank if none)
        23P56L89N
        # prefer left thumb (when both are equally applicable)?
        false
        # Fitts' law coefficients...
        # left thumb intercept
        176
        # left thumb slope
        64.0
        # right thumb intercept
        176
        # right thumb slope
        64.0
        # tMIN (minimum inter-key stroke time using opposite thumbs)
        0.088
        # Space key policy...
        #     'Alternate' = alternate thumb for space at end of word
        #     'Left' = always left thumb
        #     'Right' = always right thumb
        Alternate
        # Values for perceptual, cognitive and motor processes...
        # Eye movement time (t sub E) in seconds
        0.070
        # Perceptual processor cycle time (t sub P) in seconds
        0.050
        # Motor processor cycle time (t sub M) in seconds
        0.030
        # Cognitive processor cycle time (t sub C) in seconds
        0.025
        # Time in seconds to determine if two words are the same
        0.036
        # *** end ***
        
Note: Left thumb preference indicates when both thumbs are equally applicable, the left one should be chosen. The default value is false, indicating that the right thumb is chosen. Each line in the word-frequency-keystroke file should be in the following whitespace-delimited format: word frequency keystrokes

For example (one entry from the file):

        cake    2256    2253NS
        
For formatting of the keybord definition file, see KeyButton.java for details.

Version:
1.0 - 2001 (FittsTwoThumb.java),
1.1 - 10/2005 (Added new fields and renamed ModelDefinition.java.),
1.1.1 - 06/2006 (Fixed bugs when loading files.)
Author:
Scott MacKenzie,
Steven J. Castellucci
See Also:
FittsTwoThumb.java, FittsTwoThumb.txt, KeyButton.java

Field Summary
static java.lang.String ALTERNATE_SPACE
          Indicates the SPACE-key should be pressed by alternating thumbs.
 java.lang.String bothThumbsKeys
          A String composed of all the characters representing KeyButton objects assigned to both thumbs
 java.lang.String kbDefinitionFile
          The name of the keyboard definition file
 KeyButton[] keyButtons
          An array of KeyButton objects representing all the text-entry-related keys/buttons of the model
static java.lang.String LEFT_SPACE
          Indicates the SPACE-key should be pressed by the left thumb.
 double leftIntercept
          The left intercept coefficient for Fitts' Law calculations
 boolean leftOption
          A value of true represents preferrence for the left thumb when both thumbs are equally accessable (false by default).
 double leftSlope
          The left slope coefficient for Fitts' Law calculations
 java.lang.String leftThumbKeys
          A String composed of all the characters representing KeyButton objects assigned to the left thumb (or both thumbs)
static java.lang.String RIGHT_SPACE
          Indicates the SPACE-key should be pressed by the right thumb.
 double rightIntercept
          The right intercept coefficient for Fitts' Law calculations
 double rightSlope
          The right slope coefficient for Fitts' Law calculations
 java.lang.String rightThumbKeys
          A String composed of all the characters representing KeyButton objects assigned to the right thumb (or both thumbs)
 java.lang.String spaceKeyPolicy
          The space key policy.
 double tC
          Cognitive processor cycle time (t sub C) in seconds
 double tE
          Eye movement time (t sub E) in seconds
 double tM
          Motor processor cycle time (t sub M) in seconds
 double tMin
          The minimum inter-key stroke time using opposite thumbs, measured in seconds
 double tP
          Perceptual processor cycle time (t sub P) in seconds
 double tS
          Time in seconds to determine if two words are the same
 WordFreqKs[] wordFreqKs
          An array of WordFreqKs objects representing all the words in the corpus as well as their associated frequency and corresponding keystrokes
 java.lang.String wordFreqKsFile
          The name of the word-frequency-keystrokes file
 
Constructor Summary
ModelDefinition()
           
 
Method Summary
 void loadFromFile(java.lang.String file)
          Loads values from a model definition file.
 java.lang.String toString()
          Saves all values as a single String that can be written to a text file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wordFreqKs

public WordFreqKs[] wordFreqKs
An array of WordFreqKs objects representing all the words in the corpus as well as their associated frequency and corresponding keystrokes


wordFreqKsFile

public java.lang.String wordFreqKsFile
The name of the word-frequency-keystrokes file


keyButtons

public KeyButton[] keyButtons
An array of KeyButton objects representing all the text-entry-related keys/buttons of the model


kbDefinitionFile

public java.lang.String kbDefinitionFile
The name of the keyboard definition file


leftThumbKeys

public java.lang.String leftThumbKeys
A String composed of all the characters representing KeyButton objects assigned to the left thumb (or both thumbs)


rightThumbKeys

public java.lang.String rightThumbKeys
A String composed of all the characters representing KeyButton objects assigned to the right thumb (or both thumbs)


bothThumbsKeys

public java.lang.String bothThumbsKeys
A String composed of all the characters representing KeyButton objects assigned to both thumbs


leftOption

public boolean leftOption
A value of true represents preferrence for the left thumb when both thumbs are equally accessable (false by default).


leftIntercept

public double leftIntercept
The left intercept coefficient for Fitts' Law calculations


leftSlope

public double leftSlope
The left slope coefficient for Fitts' Law calculations


rightIntercept

public double rightIntercept
The right intercept coefficient for Fitts' Law calculations


rightSlope

public double rightSlope
The right slope coefficient for Fitts' Law calculations


tMin

public double tMin
The minimum inter-key stroke time using opposite thumbs, measured in seconds


spaceKeyPolicy

public java.lang.String spaceKeyPolicy
The space key policy.

See Also:
LEFT_SPACE, RIGHT_SPACE, ALTERNATE_SPACE

tE

public double tE
Eye movement time (t sub E) in seconds


tP

public double tP
Perceptual processor cycle time (t sub P) in seconds


tM

public double tM
Motor processor cycle time (t sub M) in seconds


tC

public double tC
Cognitive processor cycle time (t sub C) in seconds


tS

public double tS
Time in seconds to determine if two words are the same


LEFT_SPACE

public static final java.lang.String LEFT_SPACE
Indicates the SPACE-key should be pressed by the left thumb.

See Also:
Constant Field Values

RIGHT_SPACE

public static final java.lang.String RIGHT_SPACE
Indicates the SPACE-key should be pressed by the right thumb.

See Also:
Constant Field Values

ALTERNATE_SPACE

public static final java.lang.String ALTERNATE_SPACE
Indicates the SPACE-key should be pressed by alternating thumbs.

See Also:
Constant Field Values
Constructor Detail

ModelDefinition

public ModelDefinition()
Method Detail

loadFromFile

public void loadFromFile(java.lang.String file)
                  throws FormatException,
                         java.io.FileNotFoundException,
                         java.io.IOException
Loads values from a model definition file.

Note: For efficiency, data file are not opened/loaded if the arrays that represent them are non-empty. Instead, clients should create a new object and load from it.

Parameters:
file - a String representing the path of the model definition file.
Throws:
FormatException
java.io.FileNotFoundException
java.io.IOException

toString

public java.lang.String toString()
Saves all values as a single String that can be written to a text file. The output is similar to the example in the class description above.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this model.


Copyright © 2006 Steven Castellucci and Scott MacKenzie. All Rights Reserved.