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