public abstract class Planner extends Object implements Runnable
Contact: Don Brutzman (web.nps.navy.mil/~brutzman) brutzman@nps.navy.mil
Modifier and Type | Field and Description |
---|---|
protected List<Plan> |
agenda
Ordered set of partial plans to be tested
|
protected boolean |
die
Set to true when the planner is to quit whether a plan is ready or not
|
protected WorldState |
goal
World state defining the desired goal of the plan
|
protected Plan |
plan
Computed plan that produces the desired goal state
|
protected boolean |
planReady
Set to true when a plan has been generated
|
Constructor and Description |
---|
Planner()
Creates a new instance of Planner
This constructor creates an object that must be reset with
start and goal states before it can be run
|
Planner(int dummy)
Creates a new instance of Planner
This constructor creates an object that must be reset with
start and goal states before it can be run
|
Planner(WorldState start,
WorldState goal)
Creates a new instance of Planner
|
Planner(WorldState start,
WorldState goal,
int dummy)
Creates a new instance of Planner
|
Modifier and Type | Method and Description |
---|---|
void |
addToAgenda(Plan plan)
Adds a plan to the agenda
|
void |
clearAgenda()
Clears all partial plans from the agenda
|
WorldState |
getGoal()
Returns a reference to the goal state of the planner.
|
Plan |
getPlan()
Returns the generated plan, or null if none was found.
|
double |
getRunTime()
Returns the amount of time (seconds) that the planner took to run.
|
boolean |
goalAchievable()
Returns true if there are more agenda items to evaluate
False means that all possible paths have been exhausted with no solution found
|
boolean |
goalAchieved()
Returns true if the first plan in the agenda achieves the desired goal
|
boolean |
isPlanReady()
Returns true if a plan has been successfully created
|
void |
reset()
Partially resets the planner prior to re-initializing by an inheriting class
This reset still requires the agenda to be initialized with a starting plan
|
void |
reset(WorldState start)
Resets the planner to start over with a new start state
|
void |
reset(WorldState start,
WorldState goal)
Resets the planner to start over with a new start state and a new goal
|
void |
run()
Implements the Runnable interface
|
void |
setDie()
Kills a running planner before a plan is found
|
void |
setRunTime(long time)
Sets the planner's run time (nanoseconds)
|
protected Plan plan
protected WorldState goal
protected boolean planReady
protected boolean die
public Planner()
public Planner(int dummy)
dummy
- public Planner(WorldState start, WorldState goal)
start
- world state when planning commences (must completely define)goal
- desired world state following plan execution (not necessarily complete world description)public Planner(WorldState start, WorldState goal, int dummy)
start
- world state when planning commences (must completely define)goal
- desired world state following plan execution (not necessarily complete world description)dummy
- place holder to facilitate swapping between this and the SelfPruningPlanner subclasspublic boolean goalAchieved()
public void reset()
public void reset(WorldState start)
start
- world state when planning commences (must completely define world)public void reset(WorldState start, WorldState goal)
start
- world state when planning commences (must completely define world)goal
- desired world state following plan execution (not necessarily complete world description)public final void addToAgenda(Plan plan)
plan
- partial plan that is to be evaluated and added to the agendapublic void clearAgenda()
public boolean goalAchievable()
public WorldState getGoal()
public Plan getPlan()
public double getRunTime()
public void setRunTime(long time)
time
- public boolean isPlanReady()
public void setDie()