Package edu.uky.ai.planning
Class Problem
java.lang.Object
edu.uky.ai.planning.Problem
- Direct Known Subclasses:
StateSpaceProblem
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 Summary
FieldsModifier and TypeFieldDescriptionfinal Domain
The domain in which this problem existsfinal Proposition
Some goal that needs to be achieved by any solution to this problemfinal State
The initial state of the world, which specifies the disposition of every objectfinal String
The name of the problemfinal ImmutableArray<Constant>
All the objects that exist in the world -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new problem.Problem
(String name, Domain domain, ImmutableArray<Constant> objects, State initial, Proposition goal) Constructs a new problem. -
Method Summary
Modifier and TypeMethodDescriptiongetObjectsByType
(String type) Returns all the objects in the world which are of a given type.int
hashCode()
boolean
isSolution
(Plan plan) Checks if a given plan is a solution to this problem.toString()
-
Field Details
-
name
The name of the problem -
domain
The domain in which this problem exists -
objects
All the objects that exist in the world -
initial
The initial state of the world, which specifies the disposition of every object -
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 problemdomain
- the domain in which it existsobjects
- the objects in the worldinitial
- the initial stategoal
- the goal
-
Problem
Constructs a new problem.- Parameters:
name
- the name of the problemdomain
- the domain in which it existsobjects
- the objects in the worldinitial
- the initial stategoal
- the goal
-
-
Method Details
-
hashCode
public int hashCode() -
isSolution
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
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
-