Changeset 1888
- Timestamp:
- 03/05/15 11:38:23 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRule.java
r1855 r1888 479 479 // Trie must be recreated with a longer sequence length to be sure that 480 480 // the found sequences occurring most often are found in their whole length 481 appData.setTrainedSubsequenceLength(appData.getTrainedSubsequenceLength() + 1);481 appData.setTrainedSubsequenceLength(appData.getTrainedSubsequenceLength() + 3); 482 482 createNewTrie = true; 483 483 break; … … 835 835 // checking now, if there is one sequence, having the lowest index for any of 836 836 // its collisions and preserve it. If there are several ones with the same minimum 837 // index, throw an exception837 // index, check if they are indpendent. If not, throw an exception 838 838 int minPosInAnySequence = Integer.MAX_VALUE; 839 InterleavingSubsequence subsequenceWithMinPos = null;839 List<InterleavingSubsequence> subsequencesWithMinPos = new LinkedList<>(); 840 840 841 841 for (InterleavingSubsequence interleaving : interleavings) { … … 843 843 if (minPosInAnySequence > collision.getLocation().getIndex()) { 844 844 minPosInAnySequence = collision.getLocation().getIndex(); 845 subsequence WithMinPos = interleaving;845 subsequencesWithMinPos.clear(); 846 846 } 847 else if (minPosInAnySequence == collision.getLocation().getIndex()) { 847 848 if (minPosInAnySequence == collision.getLocation().getIndex()) { 848 849 // several have the same min pos --> undecidable which to prefer 849 subsequence WithMinPos = null;850 subsequencesWithMinPos.add(interleaving); 850 851 } 851 852 } 852 853 } 853 854 854 if (subsequence WithMinPos != null) {855 if (subsequencesWithMinPos.size() > 0) { 855 856 List<Subsequence> subsequencesToRemove = new LinkedList<Subsequence>(); 856 857 857 858 for (Subsequence candidate : appData.getLastFoundSubsequences()) { 858 if (candidate != subsequenceWithMinPos.getSubsequence()) { 859 boolean found = false; 860 861 for (InterleavingSubsequence subsequenceWithMinPos : subsequencesWithMinPos) 862 { 863 if (candidate == subsequenceWithMinPos.getSubsequence()) { 864 found = true; 865 } 866 } 867 868 if (!found) { 859 869 subsequencesToRemove.add(candidate); 860 870 } 861 871 } 862 872 863 for (Subsequence candidate : subsequencesToRemove) { 864 appData.getLastFoundSubsequences().remove(candidate); 865 } 873 if (subsequencesToRemove.size() > 0) { 874 for (Subsequence candidate : subsequencesToRemove) { 875 appData.getLastFoundSubsequences().remove(candidate); 876 } 866 877 867 continue; 878 continue; 879 } 868 880 } 869 881
Note: See TracChangeset
for help on using the changeset viewer.