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/SequenceForTaskDetectionRule.java

    r1356 r1401  
    3838import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession; 
    3939import de.ugoe.cs.autoquest.usageprofiles.SymbolMap; 
     40import de.ugoe.cs.autoquest.usageprofiles.Trie; 
    4041import de.ugoe.cs.autoquest.usageprofiles.TrieProcessor; 
    4142import de.ugoe.cs.util.StopWatch; 
     
    4445/** 
    4546 * <p> 
    46  * TODO comment 
     47 * This class implements the major rule for creating task trees based on a set of recorded 
     48 * user sessions. For this, it first harmonizes all tasks. This eases later comparison. Then it 
     49 * searches the sessions for iterations and replaces them accordingly. Then it searches for sub 
     50 * sequences being the longest and occurring most often. For each found sub sequence, it replaces 
     51 * the occurrences by creating appropriate {@link ISequence}s. Afterwards, again searches for 
     52 * iterations and then again for sub sequences until no more replacements are done. 
     53 * </p> 
     54 * <p> 
     55 * For determining the longest sequence occurring most often, the implementation uses a  
     56 * {@link Trie}. The depth of the tree is initially 3. If the algorithm has a longest sequence 
     57 * occurring most often whose length is equal to the depth of the trie, it recalculates the trie 
     58 * with an increased depth.  
    4759 * </p> 
    4860 *  
     
    5466     * <p> 
    5567     * the task factory to be used for creating substructures for the temporal 
    56      * relationships identified during rule 
     68     * relationships identified during rul application 
    5769     * </p> 
    5870     */ 
     
    6880    /** 
    6981     * <p> 
    70      * the task comparator to be used for comparing tasks for preparation 
     82     * the task handling strategy to be used for comparing tasks for preparation, i.e., before 
     83     * the tasks are harmonized 
    7184     * </p> 
    7285     */ 
     
    7588    /** 
    7689     * <p> 
    77      * the task comparator to be used for comparing tasks during iteration detection an trie 
    78      * generation 
     90     * the task handling strategy to be used for comparing tasks during iteration detection an trie 
     91     * generation, i.e., after the tasks are harmonized  
    7992     * </p> 
    8093     */ 
     
    8396    /** 
    8497     * <p> 
    85      * instantiates the rule and initializes it with a task equality rule manager and the minimal 
    86      * task equality identified sublist must have to consider them as iterated. 
     98     * instantiates the rule and initializes it with a task equality to be considered when 
     99     * comparing tasks as well as a task factory and builder to be used for creating task 
     100     * structures. 
    87101     * </p> 
     102     *  
     103     * @param minimalTaskEquality the task equality to be considered when comparing tasks 
     104     * @param taskFactory         the task factory to be used for creating substructures 
     105     * @param taskBuilder         the task builder to be used for creating substructures 
    88106     */ 
    89107    SequenceForTaskDetectionRule(TaskEquality minimalTaskEquality, 
     
    151169    /** 
    152170     * <p> 
    153      * TODO: comment 
     171     * harmonizes the event task instances by unifying tasks. This is done, as initially the 
     172     * event tasks being equal with respect to the considered task equality are distinct objects. 
     173     * The comparison of these distinct objects is more time consuming than comparing the object 
     174     * references. 
    154175     * </p> 
    155176     * 
    156      * @param appData 
     177     * @param appData the rule application data combining all data used for applying this rule 
    157178     */ 
    158179    private void harmonizeEventTaskInstancesModel(RuleApplicationData appData) { 
     
    194215 
    195216    /** 
    196      * @param appData 
     217     * <p> 
     218     * searches for direct iterations of single tasks in all sequences and replaces them with 
     219     * {@link IIteration}s, respectively appropriate instances. Also all single occurrences of 
     220     * a task that is iterated somewhen are replaced with iterations to have again an efficient 
     221     * way for task comparisons.  
     222     * </p> 
     223     *  
     224     * @param appData the rule application data combining all data used for applying this rule 
    197225     */ 
    198226    private void detectAndReplaceIterations(RuleApplicationData appData) { 
     
    213241 
    214242    /** 
    215      * 
     243     * <p> 
     244     * searches the provided sessions for task iterations. If a task is iterated, it is added 
     245     * to the returned set. 
     246     * </p> 
     247     *  
     248     * @param the session to search for iterations in 
     249     *  
     250     * @return a set of tasks being iterated somewhere 
    216251     */ 
    217252    private Set<ITask> searchIteratedTasks(List<IUserSession> sessions) { 
     
    232267 
    233268    /** 
     269     * <p> 
     270     * replaces all occurrences of all tasks provided in the set with iterations 
     271     * </p> 
    234272     * 
     273     * @param iteratedTasks the tasks to be replaced with iterations 
     274     * @param sessions      the sessions in which the tasks are to be replaced 
     275     * @param appData       the rule application data combining all data used for applying this rule 
    235276     */ 
    236277    private void replaceIterationsOf(Set<ITask>          iteratedTasks, 
     
    288329 
    289330    /** 
    290      * 
     331     * <p> 
     332     * TODO clarify why this is done 
     333     * </p> 
    291334     */ 
    292335    private void harmonizeIterationInstancesModel(IIteration               iteration, 
     
    345388 
    346389    /** 
    347      * @param appData 
     390     * TODO go on commenting 
     391     * @param appData the rule application data combining all data used for applying this rule 
    348392     */ 
    349393    private void detectAndReplaceTasks(RuleApplicationData appData) { 
     
    365409 
    366410    /** 
    367      * @return 
     411     * @param appData the rule application data combining all data used for applying this rule 
    368412     */ 
    369413    private void getSequencesOccuringMostOften(RuleApplicationData appData) { 
     
    462506 
    463507    /** 
    464      * @param parent 
    465      * @return 
     508     * @param appData the rule application data combining all data used for applying this rule 
    466509     */ 
    467510    private void createNewTrie(RuleApplicationData appData) { 
     
    483526 
    484527    /** 
    485      * @param appData 
     528     * @param appData the rule application data combining all data used for applying this rule 
    486529     */ 
    487530    private void replaceSequencesOccurringMostOften(RuleApplicationData appData) { 
Note: See TracChangeset for help on using the changeset viewer.