Changeset 1890 for trunk/autoquest-core-tasktrees/src/main/java/de
- Timestamp:
- 03/05/15 11:42:26 (10 years ago)
- Location:
- trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/utils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/utils/MostSimilarTaskDeterminer.java
r1851 r1890 118 118 119 119 /** 120 * filters the given list of similar tasks for those having the smalle ddiff level, which is120 * filters the given list of similar tasks for those having the smallest diff level, which is 121 121 * in turn the highest similarity 122 122 */ … … 140 140 } 141 141 } 142 143 Console.println("smallest diff level is " + smallestDiffLevel); 142 144 } 143 145 else { … … 197 199 ITaskModel taskModel) 198 200 { 201 for (SimilarTasks similarTasks : mostSimilarTasksList) { 202 System.out.println(similarTasks.getLeftHandSide() + " " + similarTasks.getRightHandSide()); 203 } 204 199 205 // check, if several remaining similar tasks refer to the same task 200 206 Map<ITask, LinkedList<SimilarTasks>> referredTasks = … … 597 603 getSimilarTasksToPrefer(similarTasks1, similarTasks2); 598 604 599 if (similarTasks.isInBetweenDifference()) { 605 if (similarTasks.isInBetweenDifference() || 606 (similarTasks.getPatch().getDeltas().size() == 0)) 607 { 600 608 if (similarTasks.getDiffLevel() < mostSimilarDiffLevel) { 601 609 mostSimilarTasks = similarTasks; -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/utils/SimilarTasks.java
r1850 r1890 1095 1095 if (isInefficientAction(path.getLast())) { 1096 1096 diffCount++; 1097 allCount++; 1097 1098 } 1098 1099 else { … … 1104 1105 if (isInefficientAction(path.getLast())) { 1105 1106 diffCount++; 1107 allCount++; 1106 1108 } 1107 1109 else { … … 1110 1112 } 1111 1113 1112 return (100 * diffCount) / allCount; 1114 if (allCount == 0) { 1115 // this happens, if all actions are inefficient. Return the highest diff level 1116 return 100; 1117 } 1118 else { 1119 return (100 * diffCount) / allCount; 1120 } 1113 1121 } 1114 1122
Note: See TracChangeset
for help on using the changeset viewer.