diff options
Diffstat (limited to 'subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstStrategy.java')
-rw-r--r-- | subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstStrategy.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstStrategy.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstStrategy.java index 98af5695..0883d3d7 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstStrategy.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstStrategy.java | |||
@@ -16,10 +16,7 @@ import tools.refinery.store.dse.internal.Activation; | |||
16 | import tools.refinery.store.dse.objectives.Fitness; | 16 | import tools.refinery.store.dse.objectives.Fitness; |
17 | import tools.refinery.store.dse.objectives.ObjectiveComparatorHelper; | 17 | import tools.refinery.store.dse.objectives.ObjectiveComparatorHelper; |
18 | 18 | ||
19 | import java.util.Collection; | 19 | import java.util.*; |
20 | import java.util.Iterator; | ||
21 | import java.util.List; | ||
22 | import java.util.PriorityQueue; | ||
23 | 20 | ||
24 | public class BestFirstStrategy implements Strategy { | 21 | public class BestFirstStrategy implements Strategy { |
25 | 22 | ||
@@ -37,6 +34,20 @@ public class BestFirstStrategy implements Strategy { | |||
37 | public String toString() { | 34 | public String toString() { |
38 | return trajectory.toString() + fitness.toString(); | 35 | return trajectory.toString() + fitness.toString(); |
39 | } | 36 | } |
37 | |||
38 | @Override | ||
39 | public int hashCode() { | ||
40 | return trajectory.get(trajectory.size() - 1).hashCode(); | ||
41 | } | ||
42 | |||
43 | @Override | ||
44 | public boolean equals(Object obj) { | ||
45 | if (obj instanceof TrajectoryWithFitness other) { | ||
46 | return Objects.equals(trajectory.get(trajectory.size() - 1), other.trajectory.get(other.trajectory.size() - 1)); | ||
47 | // return trajectory.equals(((TrajectoryWithFitness) obj).trajectory); | ||
48 | } | ||
49 | return false; | ||
50 | } | ||
40 | } | 51 | } |
41 | 52 | ||
42 | public BestFirstStrategy() { | 53 | public BestFirstStrategy() { |