Class Problem

java.lang.Object
edu.uky.ai.planning.Problem
Direct Known Subclasses:
StateSpaceProblem

public class Problem extends Object
A planning problem exists in some Domain and defines the initial state of the world and a goal to be achieved.
Author:
Stephen G. Ware
  • Field Details

    • name

      public final String name
      The name of the problem
    • domain

      public final Domain domain
      The domain in which this problem exists
    • objects

      public final ImmutableArray<Constant> objects
      All the objects that exist in the world
    • initial

      public final State initial
      The initial state of the world, which specifies the disposition of every object
    • goal

      public final Proposition goal
      Some goal that needs to be achieved by any solution to this problem
  • Constructor Details

    • Problem

      public Problem(String name, Domain domain, ImmutableArray<Constant> objects, State initial, Proposition goal)
      Constructs a new problem.
      Parameters:
      name - the name of the problem
      domain - the domain in which it exists
      objects - the objects in the world
      initial - the initial state
      goal - the goal
    • Problem

      public Problem(String name, Domain domain, Constant[] objects, State initial, Proposition goal)
      Constructs a new problem.
      Parameters:
      name - the name of the problem
      domain - the domain in which it exists
      objects - the objects in the world
      initial - the initial state
      goal - the goal
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isSolution

      public boolean isSolution(Plan plan)
      Checks if a given plan is a solution to this problem.
      Parameters:
      plan - the plan to test
      Returns:
      true if the plan is a solution to the problem, false otherwise
    • getObjectsByType

      public Iterable<Constant> getObjectsByType(String type)
      Returns all the objects in the world which are of a given type.
      Parameters:
      type - the type of objects to return
      Returns:
      the (possibly empty) set of objects
    • toString

      public String toString()
      Overrides:
      toString in class Object