Changeset 1958 for trunk/autoquest-core-tasktrees/src
- Timestamp:
- 06/01/15 13:55:48 (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
r1955 r1958 1028 1028 int overallMinSumOfCollisionIndexes = Integer.MAX_VALUE; 1029 1029 int overallMinimalCollisionIndex = Integer.MAX_VALUE; 1030 InterleavingSubsequence interleavingWithMinSum = null;1031 InterleavingSubsequence interleavingWithMinIndex = null;1030 List<InterleavingSubsequence> interleavingsWithMinSum = new LinkedList<>(); 1031 List<InterleavingSubsequence> interleavingsWithMinIndex = new LinkedList<>(); 1032 1032 1033 1033 for (InterleavingSubsequence interleaving : interleavings) { … … 1048 1048 1049 1049 if (overallMinSumOfCollisionIndexes > sumOfCollisionIndexes) { 1050 interleavingWithMinSum = interleaving; 1050 interleavingsWithMinSum.clear(); 1051 interleavingsWithMinSum.add(interleaving); 1051 1052 overallMinSumOfCollisionIndexes = sumOfCollisionIndexes; 1052 1053 } 1053 1054 else if (overallMinSumOfCollisionIndexes == sumOfCollisionIndexes) { 1054 // cannot decide between already found and new one 1055 interleavingWithMinSum = null; 1055 interleavingsWithMinSum.add(interleaving); 1056 1056 } 1057 1057 1058 1058 if (overallMinimalCollisionIndex > minimalCollisionIndex) { 1059 interleavingWithMinIndex = interleaving; 1059 interleavingsWithMinIndex.clear(); 1060 interleavingsWithMinIndex.add(interleaving); 1060 1061 overallMinimalCollisionIndex = minimalCollisionIndex; 1061 1062 } 1062 1063 else if (overallMinimalCollisionIndex == minimalCollisionIndex) { 1063 // cannot decide between already found and new one 1064 interleavingWithMinIndex = null; 1065 } 1066 } 1067 1068 if (interleavingWithMinSum != null) { 1064 interleavingsWithMinIndex.add(interleaving); 1065 } 1066 } 1067 1068 if (interleavingsWithMinSum.size() < appData.getLastFoundSubsequences().size()) { 1069 1069 for (InterleavingSubsequence interleaving : interleavings) { 1070 if (interleaving != interleavingWithMinSum) { 1070 boolean found = false; 1071 for (InterleavingSubsequence candidate : interleavingsWithMinSum) { 1072 if (candidate == interleaving) { 1073 found = true; 1074 break; 1075 } 1076 } 1077 1078 if (!found) { 1071 1079 appData.getLastFoundSubsequences().remove(interleaving.getSubsequence()); 1072 1080 } … … 1076 1084 } 1077 1085 1078 if (interleaving WithMinIndex != null) {1086 if (interleavingsWithMinIndex.size() < appData.getLastFoundSubsequences().size()) { 1079 1087 for (InterleavingSubsequence interleaving : interleavings) { 1080 if (interleaving != interleavingWithMinIndex) { 1088 boolean found = false; 1089 for (InterleavingSubsequence candidate : interleavingsWithMinIndex) { 1090 if (candidate == interleaving) { 1091 found = true; 1092 break; 1093 } 1094 } 1095 1096 if (!found) { 1081 1097 appData.getLastFoundSubsequences().remove(interleaving.getSubsequence()); 1082 1098 }
Note: See TracChangeset
for help on using the changeset viewer.