|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttnt.metrics.ModelDefinition
public class ModelDefinition
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 keystrokesFor example (one entry from the file):
cake 2256 2253NSFor formatting of the keybord definition file, see
KeyButton.java
for details.
FittsTwoThumb.java
), ModelDefinition.java
.), 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 |
---|
public WordFreqKs[] wordFreqKs
WordFreqKs
objects representing all the words
in the corpus as well as their associated frequency and corresponding
keystrokes
public java.lang.String wordFreqKsFile
public KeyButton[] keyButtons
KeyButton
objects representing all the
text-entry-related keys/buttons of the model
public java.lang.String kbDefinitionFile
public java.lang.String leftThumbKeys
String
composed of all the characters representing
KeyButton
objects assigned to the left thumb (or both
thumbs)
public java.lang.String rightThumbKeys
String
composed of all the characters representing
KeyButton
objects assigned to the right thumb (or both
thumbs)
public java.lang.String bothThumbsKeys
String
composed of all the characters representing
KeyButton
objects assigned to both thumbs
public boolean leftOption
true
represents preferrence for the left thumb
when both thumbs are equally accessable (false
by
default).
public double leftIntercept
public double leftSlope
public double rightIntercept
public double rightSlope
public double tMin
public java.lang.String spaceKeyPolicy
LEFT_SPACE
,
RIGHT_SPACE
,
ALTERNATE_SPACE
public double tE
public double tP
public double tM
public double tC
public double tS
public static final java.lang.String LEFT_SPACE
public static final java.lang.String RIGHT_SPACE
public static final java.lang.String ALTERNATE_SPACE
Constructor Detail |
---|
public ModelDefinition()
Method Detail |
---|
public void loadFromFile(java.lang.String file) throws FormatException, java.io.FileNotFoundException, java.io.IOException
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.
file
- a String
representing the path of the model
definition file.
FormatException
java.io.FileNotFoundException
java.io.IOException
public java.lang.String toString()
String
that can be written
to a text file. The output is similar to the example in the class
description above.
toString
in class java.lang.Object
String
representation of this model.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |