Ignore:
Timestamp:
08/12/14 21:55:45 (10 years ago)
Author:
rkrimmel
Message:

Cleanup up the debubbing output

File:
1 edited

Legend:

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

    r1664 r1666  
    198198                                                .getNumberSequences().get(j).containsPattern(pattern); 
    199199                                if (startpositions.size() > 0) { 
    200                                         NumberSequence tempns = appData.getNumberSequences().get(j); 
    201  
    202200                                        for (Iterator<Integer> jt = startpositions.iterator(); jt 
    203201                                                        .hasNext();) { 
     
    234232                                                .get(i).getOccurences().iterator(); it.hasNext();) { 
    235233                                        MatchOccurence oc = it.next(); 
     234                                        /* 
    236235                                        System.out.println("Trying to replace sequence: "); 
    237236                                        matchseqs.get(i).getFirstSequence().printSequence(); 
     
    244243                                                        + oc.getEndindex()); 
    245244                                        System.out.println(); 
    246  
     245                                        */ 
     246                                         
    247247                                        // System.out.println("Printing session: "); 
    248                                         for (int j = 0; j < sessions.get(oc.getSequenceId()).size(); j++) { 
    249                                                 System.out.println(j + ": " 
    250                                                                 + sessions.get(oc.getSequenceId()).get(j)); 
    251                                         } 
     248                                        //for (int j = 0; j < sessions.get(oc.getSequenceId()).size(); j++) { 
     249                                        //      System.out.println(j + ": " 
     250                                        //                      + sessions.get(oc.getSequenceId()).get(j)); 
     251                                        //} 
    252252 
    253253                                        // Check if nothing has been replaced in the sequence we 
     
    272272                                                         
    273273                                                        if (oc.getStartindex() >= tmpOC.getStartindex() && oc.getStartindex()<=tmpOC.getEndindex()) { 
    274                                                                 System.out.println("This position has already been replaced in this iteration"); 
    275274                                                                continue invalidOccurence; 
    276275                                                        } 
     
    284283                                                                // Just to be sure. 
    285284                                                                if (diff > 0) { 
    286                                                                         System.out.println("Old index: Start: " 
    287                                                                                         + oc.getStartindex() + " End " 
    288                                                                                         + oc.getEndindex()); 
    289285                                                                        oc.setStartindex(oc.getStartindex() - diff+1); 
    290286                                                                        oc.setEndindex(oc.getEndindex() - diff+1); 
    291                                                                         System.out.println("Updated index: Start: " 
    292                                                                                         + oc.getStartindex() + " End " 
    293                                                                                         + oc.getEndindex()); 
    294287                                                                } else { 
    295288                                                                        Console.traceln(Level.WARNING, 
     
    346339        } 
    347340 
    348         // check if we have any replaced occurence with indexes 
    349         // smaller than ours. If so, we need to adjust our start 
    350         // and endpoints 
    351         // of the replacement. 
    352         // Also do a check if we have replaced this specific 
    353         // MatchOccurence in this sequence already. Jump to the 
    354         // next occurence if this is the case. 
    355         private void updateMatchIndexes(List<Match> matchseqs, int sequenceId, 
    356                         int startindex, int endindex) { 
    357  
    358                 for (int i = 0; i < matchseqs.size(); i++) { 
    359                         for (Iterator<MatchOccurence> it = matchseqs.get(i).getOccurences() 
    360                                         .iterator(); it.hasNext();) { 
    361                                 MatchOccurence tmpOC = it.next(); 
    362                                 // if the matchoccurence starts in a sequence that has been 
    363                                 // replaced right now we delete it 
    364                                 if (tmpOC.getStartindex() > startindex 
    365                                                 && tmpOC.getStartindex() < endindex) { 
    366                                         it.remove(); 
    367                                 } else if (tmpOC.getStartindex() > endindex) { 
    368                                         int diff =  endindex-startindex; 
    369                                         // Just to be sure. 
    370                                         if (diff > 0) { 
    371                                                 System.out.println("Old index: Start: " 
    372                                                                 + tmpOC.getStartindex() + " End " 
    373                                                                 + tmpOC.getEndindex()); 
    374                                                 tmpOC.setStartindex(tmpOC.getStartindex() - diff + 1); 
    375                                                 tmpOC.setEndindex(tmpOC.getEndindex() - diff + 1); 
    376                                                 System.out.println("Updated index: Start: " 
    377                                                                 + tmpOC.getStartindex() + " End " 
    378                                                                 + tmpOC.getEndindex()); 
    379                                         } else { 
    380                                                 Console.traceln(Level.WARNING, 
    381                                                                 "End index of a Match before start. This should never happen"); 
    382                                         } 
    383                                 } 
    384                         } 
    385                 } 
    386         } 
    387  
     341         
    388342        /** 
    389343         * <p> 
Note: See TracChangeset for help on using the changeset viewer.