src/java/isac/util/usersettings/UserModel.java
author wneuper
Wed, 15 Jun 2005 18:31:02 +0200
branchjava_rename_format
changeset 3922 fcd5648113ca
permissions -rw-r--r--
java: isac.util.tactics .. end renamed, formatted, inst_var_, import cleaned
wneuper@3922
     1
/*
wneuper@3922
     2
 * Created on Feb 22, 2005
wneuper@3922
     3
 *
wneuper@3922
     4
 * To change the template for this generated file go to
wneuper@3922
     5
 * Window>Preferences>Java>Code Generation>Code and Comments
wneuper@3922
     6
 */
wneuper@3922
     7
package isac.util.usersettings;
wneuper@3922
     8
wneuper@3922
     9
/**
wneuper@3922
    10
 * @author Alan Krempler
wneuper@3922
    11
 * 
wneuper@3922
    12
 * The UserModel is a class to gather statistics about one user's interaction
wneuper@3922
    13
 * with the system. Statistis are gathered per user and per interactional
wneuper@3922
    14
 * context.
wneuper@3922
    15
 */
wneuper@3922
    16
public class UserModel {
wneuper@3922
    17
wneuper@3922
    18
    //	special value for retrieving the statistics regardless of the dialog atom
wneuper@3922
    19
    // used in the interaction
wneuper@3922
    20
    public static final int DIALOG_ATOM_ANY = 0;
wneuper@3922
    21
wneuper@3922
    22
    // counter for identifying pending interactions
wneuper@3922
    23
    private static int interaction_nr_ = 1;
wneuper@3922
    24
wneuper@3922
    25
    /**
wneuper@3922
    26
     * @param item_id
wneuper@3922
    27
     *            ID of the item being queried, a tactic for example
wneuper@3922
    28
     * @param dialog_atom
wneuper@3922
    29
     *            ID of the interactional context use DIALOG_ATOM_ANY if asking
wneuper@3922
    30
     *            for statistics for all dialog atoms
wneuper@3922
    31
     * @return count of previously recorded interactions with this item
wneuper@3922
    32
     */
wneuper@3922
    33
    public int getTouchedCount(int item_id, int dialog_atom) {
wneuper@3922
    34
        // FIXME: returning dummy value in absence of valid statistics
wneuper@3922
    35
        return 0;
wneuper@3922
    36
    }
wneuper@3922
    37
wneuper@3922
    38
    /**
wneuper@3922
    39
     * @param item_id
wneuper@3922
    40
     *            ID of the item being queried, a tactic for example
wneuper@3922
    41
     * @param dialog_atom
wneuper@3922
    42
     *            ID of the interactional context use DIALOG_ATOM_ANY if asking
wneuper@3922
    43
     *            for statistics for all dialog atoms
wneuper@3922
    44
     * @return count of previously recorded successful interactions with this
wneuper@3922
    45
     *         item
wneuper@3922
    46
     */
wneuper@3922
    47
    public int getSuccessCount(int item_id, int dialog_atom) {
wneuper@3922
    48
        // FIXME: returning dummy value in absence of valid statistics
wneuper@3922
    49
        return 0;
wneuper@3922
    50
    }
wneuper@3922
    51
wneuper@3922
    52
    /**
wneuper@3922
    53
     * @param item_id
wneuper@3922
    54
     *            ID of the item being queried, a tactic for example
wneuper@3922
    55
     * @param dialog_atom
wneuper@3922
    56
     *            ID of the interactional context use DIALOG_ATOM_ANY if asking
wneuper@3922
    57
     *            for statistics for all dialog atoms
wneuper@3922
    58
     * @return time of last recorded interaction with this item
wneuper@3922
    59
     */
wneuper@3922
    60
    public java.util.Date getTouchedLast(int item_id, int dialog_atom) {
wneuper@3922
    61
        // FIXME: returning dummy value in absence of valid statistics
wneuper@3922
    62
        return new java.util.Date();
wneuper@3922
    63
    }
wneuper@3922
    64
wneuper@3922
    65
    /**
wneuper@3922
    66
     * @param item_id
wneuper@3922
    67
     *            ID of the item being queried, a tactic for example
wneuper@3922
    68
     * @param dialog_atom
wneuper@3922
    69
     *            ID of the interactional context use DIALOG_ATOM_ANY if asking
wneuper@3922
    70
     *            for statistics for all dialog atoms
wneuper@3922
    71
     * @return time of last recorded successful interaction with this item
wneuper@3922
    72
     */
wneuper@3922
    73
    public java.util.Date getSuccessLast(int item_id, int dialog_atom) {
wneuper@3922
    74
        // FIXME: returning dummy value in absence of valid statistics
wneuper@3922
    75
        return new java.util.Date();
wneuper@3922
    76
    }
wneuper@3922
    77
wneuper@3922
    78
    /**
wneuper@3922
    79
     * @param item_id
wneuper@3922
    80
     *            ID of the item being queried, a tactic for example
wneuper@3922
    81
     * @param dialog_atom
wneuper@3922
    82
     *            ID of the interactional context use DIALOG_ATOM_ANY if asking
wneuper@3922
    83
     *            for statistics for all dialog atoms
wneuper@3922
    84
     * @return average time (seconds) spent in interactions with this item
wneuper@3922
    85
     */
wneuper@3922
    86
    public int getTimeSpentAvg(int item_id, int dialog_atom) {
wneuper@3922
    87
        // FIXME: returning dummy value in absence of valid statistics
wneuper@3922
    88
        return 0;
wneuper@3922
    89
    }
wneuper@3922
    90
wneuper@3922
    91
    /**
wneuper@3922
    92
     * @param item_id
wneuper@3922
    93
     *            ID of the item being queried, a tactic for example
wneuper@3922
    94
     * @param dialog_atom
wneuper@3922
    95
     *            ID of the interactional context use DIALOG_ATOM_ANY if asking
wneuper@3922
    96
     *            for statistics for all dialog atoms
wneuper@3922
    97
     * @return maximum time (seconds) spent in interactions with this item
wneuper@3922
    98
     */
wneuper@3922
    99
    public int getTimeSpentMax(int item_id, int dialog_atom) {
wneuper@3922
   100
        // FIXME: returning dummy value in absence of valid statistics
wneuper@3922
   101
        return 0;
wneuper@3922
   102
    }
wneuper@3922
   103
wneuper@3922
   104
    /**
wneuper@3922
   105
     * @param item_id
wneuper@3922
   106
     *            ID of the item being queried, a tactic for example
wneuper@3922
   107
     * @param dialog_atom
wneuper@3922
   108
     *            ID of the interactional context use DIALOG_ATOM_ANY if asking
wneuper@3922
   109
     *            for statistics for all dialog atoms
wneuper@3922
   110
     * @return standard deviation of time spent in interactions with this item
wneuper@3922
   111
     */
wneuper@3922
   112
    public float getTimeSpentStddev(int item_id, int dialog_atom) {
wneuper@3922
   113
        // FIXME: returning dummy value in absence of valid statistics
wneuper@3922
   114
        return 0;
wneuper@3922
   115
    }
wneuper@3922
   116
wneuper@3922
   117
    /**
wneuper@3922
   118
     * Mark the beginning of an interaction with an item.
wneuper@3922
   119
     * 
wneuper@3922
   120
     * @param item_id
wneuper@3922
   121
     *            ID of the item being acted upon, a tactic for example
wneuper@3922
   122
     * @param dialog_atom
wneuper@3922
   123
     *            ID of the interactional context
wneuper@3922
   124
     * @return unique number to indentify the end of the transaction
wneuper@3922
   125
     */
wneuper@3922
   126
    public int startInteraction(int item_id, int dialog_atom) {
wneuper@3922
   127
        // FIXME: insert code to record statistics
wneuper@3922
   128
wneuper@3922
   129
        // record timestamp
wneuper@3922
   130
        // new java.util.Date(); ...
wneuper@3922
   131
wneuper@3922
   132
        // save in static vector of currently open interactions
wneuper@3922
   133
        // ...
wneuper@3922
   134
wneuper@3922
   135
        return interaction_nr_++;
wneuper@3922
   136
    }
wneuper@3922
   137
wneuper@3922
   138
    /**
wneuper@3922
   139
     * Mark the end of an interaction with an item.
wneuper@3922
   140
     * 
wneuper@3922
   141
     * @param interaction_id
wneuper@3922
   142
     *            ID of the interaction returned from the call to
wneuper@3922
   143
     *            {@link # startInteraction() }
wneuper@3922
   144
     * @param success
wneuper@3922
   145
     *            information about the success of the interaction
wneuper@3922
   146
     * @return false in case of failure - no matching start could be found, true
wneuper@3922
   147
     *         in case of success
wneuper@3922
   148
     */
wneuper@3922
   149
    public boolean endInteraction(int interaction_id, int success) {
wneuper@3922
   150
        // FIXME: insert code to record statistics
wneuper@3922
   151
wneuper@3922
   152
        // record end timestamp
wneuper@3922
   153
        // new java.util.Date(); ...
wneuper@3922
   154
wneuper@3922
   155
        // add to statistics
wneuper@3922
   156
wneuper@3922
   157
        // delete from static vector of currently open interactions
wneuper@3922
   158
        // ...
wneuper@3922
   159
wneuper@3922
   160
        return true;
wneuper@3922
   161
    }
wneuper@3922
   162
wneuper@3922
   163
}