Changeset 1749 for branches


Ignore:
Timestamp:
09/16/14 18:31:46 (10 years ago)
Author:
rkrimmel
Message:

Code cleanup, removed dublicate storage of task items

Location:
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java

    r1748 r1749  
    77import java.util.Collection; 
    88import java.util.HashMap; 
    9 import java.util.HashSet; 
    109import java.util.Iterator; 
    1110import java.util.LinkedList; 
  • branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java

    r1747 r1749  
    6666                final ISequenceInstance subsequence = taskFactory 
    6767                                .createNewTaskInstance(model); 
    68                  
    69                 //System.out.println("STARTINDEX: " + startIndex); 
    70                 //System.out.println("PRINTING SEQUENCE: "); 
    71                 //for(int i =0; i< parent.size();i++) { 
    72                 //    System.out.println(i + ": " +parent.get(i)); 
    73                 //} 
     68                /* 
     69                System.out.println("STARTINDEX: " + startIndex); 
     70                System.out.println("PRINTING SEQUENCE: "); 
     71                for(int i =0; i< parent.size();i++) { 
     72                    System.out.println(i + ": " +parent.get(i)); 
     73                } 
    7474                System.out.println(); 
    7575                 
     
    105105                } 
    106106                System.out.println(); 
    107                  
     107                */ 
    108108                // TODO: This is dirty, return this in addition with the sequence 
    109109                // instance instead 
  • branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java

    r1747 r1749  
    2525import java.util.List; 
    2626import java.util.Map; 
    27 import java.util.PriorityQueue; 
    2827import java.util.Queue; 
    2928import java.util.Set; 
     
    7372 
    7473    /** The n threads. */ 
    75     // public static int nThreads = Runtime.getRuntime().availableProcessors() - 1; 
    76     public static int nThreads = 1; 
     74    public static int nThreads = Runtime.getRuntime().availableProcessors() - 1; 
     75    //public static int nThreads = 1; 
    7776 
    7877    /** The iteration. */ 
    7978    private int iteration = 0; 
    8079 
    81     private int maxIterations = 1; 
     80    private int maxIterations = 10 
     81            ; 
    8282 
    8383    private static int alignmentThreshold = 9; 
     
    148148 
    149149        Console.traceln(Level.INFO, "generating substitution matrix from " + 
    150             appData.getUniqueTasks().size() + " unique tasks"); 
     150            appData.getNumber2Task().size() + " unique tasks"); 
    151151        appData.getStopWatch().start("substitution matrix"); 
    152         appData.getSubmat().generate(appData.getUniqueTasks()); 
     152        appData.getSubmat().generate(appData.getNumber2Task().values()); 
    153153        appData.getStopWatch().stop("substitution matrix"); 
    154154 
     
    358358                if (task == null) { 
    359359                    uniqueTasks.addSymbol(taskInstance, taskInstance.getTask()); 
    360                     appData.getUniqueTasks().add(taskInstance.getTask()); 
    361360                    appData.getNumber2Task().put(taskInstance.getTask().getId(), 
    362361                                                 taskInstance.getTask()); 
     
    372371        appData.getStopWatch().stop("harmonizing event tasks"); 
    373372        Console.traceln(Level.INFO, "harmonized " + unifiedTasks + " task occurrences (still " + 
    374             appData.getUniqueTasks().size() + " different tasks)"); 
     373            uniqueTasks.size() + " different tasks)"); 
    375374 
    376375        appData.getStopWatch().dumpStatistics(System.out); 
     
    708707            e.printStackTrace(); 
    709708        } 
     709        appData.getPreparedTasks().clear(); 
    710710    } 
    711711 
     
    10081008        public void run() { 
    10091009            for (int i = from; i <= to; i++) { 
    1010                 System.out.println("Replacing in SEQUENCE " + i); 
     1010                //System.out.println("Replacing in SEQUENCE " + i); 
    10111011                /* 
    10121012                 * HashMap for keeping track in which sequence which replacement has been performed. 
     
    10621062                    
    10631063 
    1064                     System.out.println("Replacing in Sequence " + oc.getSequenceId() + 
    1065                         " at position " + oc.getStartindex() + " till " + oc.getEndindex()); 
     1064                    //System.out.println("Replacing in Sequence " + oc.getSequenceId() + 
     1065                    //    " at position " + oc.getStartindex() + " till " + oc.getEndindex()); 
    10661066                    final ISequenceInstance sequenceInstances = 
    10671067                        RuleUtils.createNewSubSequenceInRange(appData.getSessions() 
     
    11161116        private final HashMap<Integer, ITask> number2task; 
    11171117 
    1118         /** 
    1119          * The unique tasks, keeps track about all unique tasks TODO: We Actually just need 
    1120          * number2task here, this structure can be removed in the future. 
    1121          */ 
    1122         private final HashSet<ITask> uniqueTasks; 
    11231118 
    11241119        /** 
     
    11681163            this.sessions = sessions; 
    11691164            numberseqs = new ArrayList<NumberSequence>(); 
    1170             uniqueTasks = new HashSet<ITask>(); 
    11711165            number2task = new HashMap<Integer, ITask>(); 
    11721166            stopWatch = new StopWatch(); 
     
    12711265 
    12721266        /** 
    1273          * Gets the unique tasks. 
    1274          * 
    1275          * @return the unique tasks 
    1276          */ 
    1277         private HashSet<ITask> getUniqueTasks() { 
    1278             return uniqueTasks; 
    1279         } 
    1280  
    1281         /** 
    12821267         * New task created. 
    12831268         * 
     
    12951280         */ 
    12961281        synchronized private void resetNewlyCreatedTasks() { 
    1297             uniqueTasks.addAll(newTasks); 
    12981282            newTasks.clear(); 
    12991283        } 
Note: See TracChangeset for help on using the changeset viewer.