We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32895df commit 7016151Copy full SHA for 7016151
aima-core/src/main/java/aima/core/logic/planning/State.java
@@ -24,6 +24,7 @@ public class State {
24
25
public State(List<Literal> fluents) {
26
this.fluents = fluents;
27
+ fluents.sort(Comparator.comparing(Literal::toString));
28
}
29
30
public State(String fluents) {
@@ -98,10 +99,9 @@ public List<Literal> getFluents() {
98
99
100
@Override
101
public boolean equals(Object obj) {
- if (getClass() != obj.getClass())
102
+ if (obj == null || getClass() != obj.getClass())
103
return false;
- return this.fluents.containsAll(((State) obj).getFluents())
104
- && ((State) obj).getFluents().containsAll(this.getFluents());
+ return fluents.equals(((State) obj).getFluents());
105
106
107
0 commit comments