Class Utilities

java.lang.Object
edu.uky.ai.planning.Utilities

public class Utilities extends Object
A assortment of useful methods.
Author:
Stephen G. Ware
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final Iterable<Literal>
    asLiterals(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 Iterable.
    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 a Consumer.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 a Consumer.
      Parameters:
      proposition - the precondition or effect of an action
      consumer - an operation that accepts a literal as input
    • asLiterals

      public static final Iterable<Literal> asLiterals(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 Iterable.
      Parameters:
      proposition - the precondition or effect of an action
      Returns:
      an Iterable of literals
    • toLiterals

      public 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.
      Parameters:
      proposition - the precondition or effect of an action
      Returns:
      an array of literals