Changeset 1401 for trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrie.java
- Timestamp:
- 02/26/14 17:12:53 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrie.java
r1285 r1401 29 29 /** 30 30 * <p> 31 * TODO comment 31 * This trie implementation is a performance optimization for generating task trees. It does not 32 * create a full trie but adds only those subsequences having a chance of occurring most often. 33 * For this, it initially counts the number of occurrences of each task instance. Then, during 34 * training, it regularly determines the number of the currently most often occurring sequence. If 35 * this number is higher than the count of a task instance to be trained, the task instance is 36 * skipped the not added to the trie. 32 37 * </p> 33 38 * … … 41 46 /** 42 47 * <p> 43 * the task comparatorto be used for comparing tasks48 * the task handling strategy to be used for comparing tasks 44 49 * </p> 45 50 */ … … 48 53 /** 49 54 * <p> 50 * TODO: comment55 * instantiated the trie with the task handling strategy to be used 51 56 * </p> 52 57 * 53 * @param task Comparator258 * @param taskStrategy the task handling strategy to be used for comparing tasks 54 59 */ 55 60 public TaskInstanceTrie(TaskHandlingStrategy taskStrategy) { … … 59 64 60 65 /** 61 * 66 * <p> 67 * trains this trie with the provided user sessions up to the provided maximum depth using 68 * the optimization described in the description of this class. 69 * </p> 70 * 71 * @param userSessions the sessions for which this trie is to be trained 72 * @param maxOrder the depth of the trie 62 73 */ 63 74 public void trainSessions(List<IUserSession> userSessions, int maxOrder) { … … 125 136 126 137 /** 127 * 138 * <p> 139 * internally used convenience method for implementing the training optimization 140 * </p> 128 141 */ 129 142 private void train(IUserSession userSession, … … 133 146 int counterRecheckAt) 134 147 { 135 List<ITaskInstance> executedTasks = userSession.getExecutedTasks();136 137 148 List<ITaskInstance> subsequence = new LinkedList<ITaskInstance>(); 138 149 139 150 int sequenceMaxCount = 0; 140 151 141 for (ITaskInstance currentTaskInstance : executedTasks) {152 for (ITaskInstance currentTaskInstance : userSession) { 142 153 143 154 int occurrenceCount = taskInstanceCountMap.get(currentTaskInstance.getTask()).count; … … 181 192 /** 182 193 * <p> 183 * TODO: comment 194 * determines the current maximum count of sequences of a minimal length of two. Task instances 195 * occuring more seldom do not have to be considered anymore 184 196 * </p> 185 197 * 186 * @return 198 * @return the current maximum count of sequences of a minimal length of two 187 199 */ 188 200 private int getCurrentSequenceMaxCount() { … … 193 205 194 206 /** 207 * <p> 208 * trie processor identifying the current maximum count of sequences of a minimal length of two 209 * </p> 210 * 195 211 * @author Patrick Harms 196 212 */ … … 198 214 199 215 /** 200 * 216 * <p> 217 * the current maximum count 218 * </p> 201 219 */ 202 220 private int currentCount = 0; … … 219 237 220 238 /** 221 * 239 * <p> 240 * returns the current maximum count 241 * </p> 222 242 */ 223 243 private int getMaxCount() { … … 228 248 229 249 /** 250 * <p> 251 * counter object to be able to call something by the counters reference 252 * </p> 253 * 230 254 * @author Patrick Harms 231 255 */
Note: See TracChangeset
for help on using the changeset viewer.