Skip to content

Commit 74ad1e2

Browse files
committed
Minor cleanup.
1 parent 7016151 commit 74ad1e2

File tree

1 file changed

+3
-7
lines changed
  • aima-core/src/main/java/aima/core/logic/planning

1 file changed

+3
-7
lines changed

aima-core/src/main/java/aima/core/logic/planning/State.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public State result(List<ActionSchema> actions) {
7171
return state;
7272
}
7373

74-
7574
/**
7675
* Checks if the action is applicable in a state.
7776
* <p>
@@ -81,16 +80,13 @@ public State result(List<ActionSchema> actions) {
8180
* @return a boolean stating if the action is applicable.
8281
*/
8382
public boolean isApplicable(ActionSchema action) {
84-
boolean result = true;
8583
for (Literal literal : action.getPrecondition()) {
8684
if (literal.isPositiveLiteral()
8785
? !fluents.contains(literal)
88-
: fluents.contains(literal.getComplementaryLiteral())) {
89-
result = false;
90-
break;
91-
}
86+
: fluents.contains(literal.getComplementaryLiteral()))
87+
return false;
9288
}
93-
return result;
89+
return true;
9490
}
9591

9692
public List<Literal> getFluents() {

0 commit comments

Comments
 (0)