Ignore:
Timestamp:
08/07/13 09:09:03 (11 years ago)
Author:
pharms
Message:
  • added counting of task occurrences
Location:
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees
Files:
4 edited

Legend:

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

    r1285 r1287  
    353353        Console.traceln(Level.INFO, "detected and replaced " + appData.getLastFoundTasks().size() + 
    354354                        " tasks occuring " + appData.getLastFoundTasks().getOccurrenceCount() + 
    355                         "times"); 
     355                        " times"); 
    356356    } 
    357357 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/ITaskInfo.java

    r1191 r1287  
    1919/** 
    2020 * <p> 
    21  * yet more or less unused, this class will in the future provided extended information about a 
     21 * yet more or less unused, this class will in the future provide extended information about a 
    2222 * specific task, such as statistics about task occurrences, etc. 
    2323 * </p> 
     
    3636    public ITask getTask(); 
    3737 
     38    /** 
     39     * <p> 
     40     * returns the number of times a task occurred 
     41     * </p> 
     42     *  
     43     * @return as described 
     44     */ 
     45    public int getCount(); 
     46 
    3847} 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskInfo.java

    r1216 r1287  
    4444    /** 
    4545     * <p> 
     46     * the number of occurrences of this task 
     47     * </p> 
     48     */ 
     49    private int count; 
     50 
     51    /** 
     52     * <p> 
    4653     * initialized the task infos with the task to which they belong. 
    4754     * </p> 
     
    6269 
    6370    /* (non-Javadoc) 
     71     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInfo#getCount() 
     72     */ 
     73    @Override 
     74    public int getCount() { 
     75        return count; 
     76    } 
     77 
     78    /* (non-Javadoc) 
    6479     * @see java.lang.Object#toString() 
    6580     */ 
    6681    @Override 
    6782    public synchronized String toString() { 
    68         return "NodeInfo(" + task + ")"; 
     83        return "TaskInfo(" + task + ")"; 
    6984    } 
    7085 
     86    /** 
     87     * <p> 
     88     * used to increase the counter of occurrences of this task by one 
     89     * </p> 
     90     */ 
     91    void increaseCount() { 
     92        count++; 
     93    } 
    7194} 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModel.java

    r1216 r1287  
    2121import java.util.Map; 
    2222 
    23 import de.ugoe.cs.autoquest.tasktrees.treeifc.IMarkingTemporalRelationship; 
    24 import de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship; 
    2523import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    2624import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 
     25import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstanceList; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
    2827import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInfo; 
     
    7776        for (IUserSession session : this.userSessions) { 
    7877            for (ITaskInstance taskInstance : session) { 
    79                 addTaskToMap(taskInstance.getTask()); 
     78                addTasksToMap(taskInstance); 
    8079            } 
    8180        } 
    8281    } 
    8382 
    84  
     83     
    8584    /* (non-Javadoc) 
    8685     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel#getUserSessions() 
     
    117116    } 
    118117 
     118 
     119    /** 
     120     * <p> 
     121     * internal convenience method to recursively add the tasks of a task instance and its 
     122     * children to the task model 
     123     * </p> 
     124     * 
     125     * @param taskInstance the task instance of which the tasks shall be added 
     126     */ 
     127    private void addTasksToMap(ITaskInstance taskInstance) { 
     128        addTaskToMap(taskInstance.getTask()); 
     129         
     130        if (taskInstance instanceof ITaskInstanceList) { 
     131            for (ITaskInstance child : (ITaskInstanceList) taskInstance) { 
     132                addTasksToMap(child); 
     133            } 
     134        } 
     135    } 
     136 
     137     
    119138    /** 
    120139     * <p> 
     
    130149        } 
    131150 
    132         if (task instanceof IStructuringTemporalRelationship) { 
     151        taskInfo.increaseCount(); 
     152 
     153        /*if (task instanceof IStructuringTemporalRelationship) { 
    133154            for (ITask child : ((IStructuringTemporalRelationship) task).getChildren()) { 
    134155                addTaskToMap(child); 
     
    137158        else if (task instanceof IMarkingTemporalRelationship) { 
    138159            addTaskToMap(((IMarkingTemporalRelationship) task).getMarkedTask()); 
    139         } 
     160        }*/ 
    140161    } 
    141162 
Note: See TracChangeset for help on using the changeset viewer.