Package edu.uky.ai.planning
Class Utilities
java.lang.Object
edu.uky.ai.planning.Utilities
A assortment of useful methods.
- Author:
- Stephen G. Ware
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasLiterals
(Proposition proposition) Since the precondition and effect of an action should be either a literal or a conjunction of literals, this utility method takes such a proposition and converts it into anIterable
.static final void
forEachLiteral
(Proposition proposition, Consumer<? super Literal> consumer) Since the precondition and effect of an action should be either a literal or a conjunction of literals, this utility method takes such a proposition and feeds each of its literals to aConsumer
.static final Literal[]
toLiterals
(Proposition proposition) Since the precondition and effect of an action should be either a literal or a conjunction of literals, this utility method takes such a proposition and converts it into an array of literals.
-
Constructor Details
-
Utilities
public Utilities()
-
-
Method Details
-
forEachLiteral
public static final void forEachLiteral(Proposition proposition, Consumer<? super Literal> consumer) Since the precondition and effect of an action should be either a literal or a conjunction of literals, this utility method takes such a proposition and feeds each of its literals to aConsumer
.- Parameters:
proposition
- the precondition or effect of an actionconsumer
- an operation that accepts a literal as input
-
asLiterals
Since the precondition and effect of an action should be either a literal or a conjunction of literals, this utility method takes such a proposition and converts it into anIterable
.- Parameters:
proposition
- the precondition or effect of an action- Returns:
- an
Iterable
of literals
-
toLiterals
Since the precondition and effect of an action should be either a literal or a conjunction of literals, this utility method takes such a proposition and converts it into an array of literals.- Parameters:
proposition
- the precondition or effect of an action- Returns:
- an array of literals
-