Ignore:
Timestamp:
02/26/14 17:12:53 (10 years ago)
Author:
pharms
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrie.java

    r1285 r1401  
    2929/** 
    3030 * <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. 
    3237 * </p> 
    3338 *  
     
    4146    /** 
    4247     * <p> 
    43      * the task comparator to be used for comparing tasks 
     48     * the task handling strategy to be used for comparing tasks 
    4449     * </p> 
    4550     */ 
     
    4853    /** 
    4954     * <p> 
    50      * TODO: comment 
     55     * instantiated the trie with the task handling strategy to be used 
    5156     * </p> 
    5257     * 
    53      * @param taskComparator2 
     58     * @param taskStrategy the task handling strategy to be used for comparing tasks 
    5459     */ 
    5560    public TaskInstanceTrie(TaskHandlingStrategy taskStrategy) { 
     
    5964 
    6065    /** 
    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 
    6273     */ 
    6374    public void trainSessions(List<IUserSession> userSessions, int maxOrder) { 
     
    125136 
    126137    /** 
    127      *  
     138     * <p> 
     139     * internally used convenience method for implementing the training optimization 
     140     * </p> 
    128141     */ 
    129142    private void train(IUserSession        userSession, 
     
    133146                       int                 counterRecheckAt) 
    134147    { 
    135         List<ITaskInstance> executedTasks = userSession.getExecutedTasks(); 
    136          
    137148        List<ITaskInstance> subsequence = new LinkedList<ITaskInstance>(); 
    138149         
    139150        int sequenceMaxCount = 0; 
    140151         
    141         for (ITaskInstance currentTaskInstance : executedTasks) { 
     152        for (ITaskInstance currentTaskInstance : userSession) { 
    142153             
    143154            int occurrenceCount = taskInstanceCountMap.get(currentTaskInstance.getTask()).count; 
     
    181192    /** 
    182193     * <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 
    184196     * </p> 
    185197     * 
    186      * @return 
     198     * @return the current maximum count of sequences of a minimal length of two 
    187199     */ 
    188200    private int getCurrentSequenceMaxCount() { 
     
    193205 
    194206    /** 
     207     * <p> 
     208     * trie processor identifying the current maximum count of sequences of a minimal length of two 
     209     * </p> 
     210     *  
    195211     * @author Patrick Harms 
    196212     */ 
     
    198214         
    199215        /** 
    200          *  
     216         * <p> 
     217         * the current maximum count 
     218         * </p> 
    201219         */ 
    202220        private int currentCount = 0; 
     
    219237 
    220238        /** 
    221          *  
     239         * <p> 
     240         * returns the current maximum count 
     241         * </p> 
    222242         */ 
    223243        private int getMaxCount() { 
     
    228248     
    229249    /** 
     250     * <p> 
     251     * counter object to be able to call something by the counters reference 
     252     * </p> 
     253     *  
    230254     * @author Patrick Harms 
    231255     */ 
Note: See TracChangeset for help on using the changeset viewer.