|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
zeus.actors.PlanDb
zeus.actors.Planner
This component implements the agent's Planning and Scheduling mechanism.
Its role is to construct action sequences that will achieve desired input goals.
Hence the Planner is under the control of the Engine component, which
initiates planning and manages the contracting of any subgoals that the agent
cannot achieve.
Planning operators (actions or tasks) are represented in the classical fashion as primitive or summary operators. Primitive operators are defined in terms of their preconditions, effects, cost, duration and constraints and precondition order, while summary operators are defined in terms of a graph of existing primitive tasks.
The Planner utilises classical partial order means end planning in its plan
construction process. So when given a goal the Planner searches its PlanDb
for an operator with a public effect that unifies (with unification bindings q)
with the desired_effect of the goal. If multiple operators are found, they are
ranked by cost, and then by duration. Next, the Planner selects the first
ranked operator, constrains its preconditions and effects with q, and then
attempts to schedule the operator into its diary. If the operator cannot be
scheduled, the Planner backtracks and re-peats the process with the next
applicable operator.
Details on how the Planner functions are provided in the Zeus Technical Manual.
| Nested Class Summary |
| Nested classes inherited from class java.util.Hashtable |
|
| Field Summary | |
protected java.util.Hashtable |
BindTable
|
protected AgentContext |
context
|
static int |
CREATE
|
static int |
DISPOSE
|
private HSet[] |
eventMonitor
|
static boolean |
EXPAND
|
static int |
FAIL
|
protected int |
now
|
static int |
PLAN
|
protected int |
plannerLength
|
protected int |
plannerWidth
|
static int |
REPLAN
|
static int |
START
|
static int |
STATE_CHANGE
|
static int |
SUCCEED
|
protected PlanRecord[][] |
table
This object stores the Planner's diary as is a two-dimensional array, with time on one dimension and processors on another. |
protected boolean |
user_responded
|
protected long |
USER_TIME_OUT
|
| Fields inherited from class java.util.Hashtable |
|
| Constructor Summary | |
Planner()
|
|
Planner(AgentContext context,
int plannerWidth,
int plannerLength)
|
|
| Method Summary | |
void |
addPlanningMonitor(PlanningMonitor monitor,
long type)
Use a PlanningMonitor if your code needs to react to changes in the Planner |
void |
addPlanStepMonitor(PlanStepMonitor monitor,
long type)
|
void |
addPlanStepMonitor(PlanStepMonitor monitor,
long type,
boolean notify_previous)
Use a PlanStepMonitor if your code needs to react to state changes in a particular plan |
protected void |
addToExternal(java.util.Vector List,
Goal goal)
|
(package private) int |
anySideEffect(Fact desc,
PlanRecord rec,
int position,
int required)
|
(package private) int |
anySideEffect(Fact desc,
PlanRecord rec,
java.lang.Object precond,
int required)
|
protected void |
assignCell(int proc,
int t,
PlanRecord rec)
|
java.util.Vector |
bind(java.util.Vector goals)
|
BindResults |
bind(java.util.Vector goals,
java.util.Vector input,
int mode)
|
protected void |
book(int type,
Goal goal,
java.util.Vector rootSet)
|
void |
book(int type,
java.util.Vector goals,
java.util.Vector records)
|
PlannerQueryStruct |
canAchieve(java.util.Vector goals,
java.lang.String key)
|
void |
checkRecords()
start Firmly booked tasks & cancel Tentatively booked ones 1.3 - promoted to public // synched ? |
PlannerQueryStruct |
clear_bind(java.util.Vector goals)
|
PlannerEnactStruct |
enact(Goal goal,
Goal sla)
|
(package private) void |
executeEarliest()
|
(package private) void |
executeEarliest(PlanRecord rec)
|
(package private) java.util.Vector |
expand_summary(Decomposition decomposition,
PlannerQueryStruct struct,
boolean mode)
|
void |
failParentOf(Goal g)
|
void |
failParentOf(java.util.Vector goals)
|
(package private) void |
freeCell(int proc,
int t)
|
(package private) void |
freeCells(int proc,
int s,
int e)
|
AgentContext |
getAgentContext()
|
int |
getPlannerLength()
|
int |
getPlannerWidth()
|
void |
goalConfirmed(java.util.Vector original_goals,
java.util.Vector confirmed_goals,
java.util.Vector selection)
|
(package private) boolean |
incrementProcessorTime(PlanRecord rec,
int time)
|
protected void |
index(PlannerQueryStruct Results)
|
protected boolean |
isFreeCell(int proc,
int t)
|
(package private) int |
latestConfirmTime(Goal goal)
|
(package private) int |
latestConfirmTime(java.util.Vector goals)
|
protected boolean |
loopFound(java.util.Vector goals)
|
protected java.lang.String |
makeIndex(java.util.Vector goals)
|
(package private) void |
notifyMonitors(Goal goal,
int event_type,
int sub_type)
|
(package private) void |
notifyMonitors(PlanRecord record,
int type)
|
void |
notifyReceived(Fact f1,
java.lang.String goalId,
java.lang.String subgoalId)
|
protected double |
now()
now introduced to prevent the need for a call back to the context object to get timeing - decouples the Planner a bit.. |
void |
reconfirmParentOf(Goal g)
|
void |
reconfirmParentOf(java.util.Vector goals)
|
Goal |
recreateSubgoal(Goal goal)
|
protected void |
reject(Goal goal,
java.util.Vector rootSet)
|
void |
reject(java.util.Vector goals,
java.util.Vector records)
|
protected void |
removeFromIndexTable(java.util.Vector goals)
|
void |
removePlanningMonitor(PlanningMonitor monitor,
long type)
|
void |
removePlanStepMonitor(PlanStepMonitor monitor,
long type)
|
void |
reset_bind(java.util.Vector goals,
PlannerQueryStruct data)
|
protected void |
resume_planning(DelegationStruct[] ds,
PlannerQueryStruct struct)
|
protected java.util.Vector |
schedule_children(java.lang.String key,
PlanRecord rec,
java.util.Vector path,
PlannerQueryStruct struct,
boolean mode)
|
(package private) java.util.Vector |
schedule_primitive(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
Goal goal,
java.util.Vector tasks,
PlannerQueryStruct struct,
boolean mode)
|
(package private) java.util.Vector |
schedule_summary(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
Goal goal,
java.util.Vector tasks,
PlannerQueryStruct struct,
boolean mode)
|
(package private) java.util.Vector |
schedule(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
Goal goal,
PlannerQueryStruct struct,
boolean mode)
|
(package private) java.util.Vector |
schedule(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
Goal goal,
java.util.Vector tasks,
PlannerQueryStruct struct,
boolean mode)
|
(package private) java.util.Vector |
schedule(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
java.util.Vector goals,
PlannerQueryStruct struct,
boolean mode)
|
void |
shuffle()
1.3 promoted to public - used to decide which job to execute |
(package private) void |
softFailParentOf(java.util.Vector goals,
PlannerQueryStruct struct,
int mode)
|
protected java.util.Vector |
sortFeasible(java.lang.String gid,
java.util.Vector input)
|
void |
userResponded()
|
protected boolean |
validProc(int proc)
|
protected boolean |
validTime(int t)
|
| Methods inherited from class zeus.actors.PlanDb |
add, add, containsRecord, del, del, lookUp, lookUp |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private HSet[] eventMonitor
public static final int START
public static final int FAIL
public static final int SUCCEED
public static final int CREATE
public static final int DISPOSE
public static final int STATE_CHANGE
public static final boolean EXPAND
public static final int REPLAN
public static final int PLAN
protected PlanRecord[][] table
protected int plannerWidth
protected int plannerLength
protected int now
protected java.util.Hashtable BindTable
protected boolean user_responded
protected long USER_TIME_OUT
protected AgentContext context
| Constructor Detail |
public Planner()
public Planner(AgentContext context,
int plannerWidth,
int plannerLength)
| Method Detail |
public AgentContext getAgentContext()
public int getPlannerWidth()
public int getPlannerLength()
int anySideEffect(Fact desc,
PlanRecord rec,
int position,
int required)
int anySideEffect(Fact desc,
PlanRecord rec,
java.lang.Object precond,
int required)
public PlannerQueryStruct canAchieve(java.util.Vector goals,
java.lang.String key)
protected boolean loopFound(java.util.Vector goals)
public PlannerQueryStruct clear_bind(java.util.Vector goals)
public void reset_bind(java.util.Vector goals,
PlannerQueryStruct data)
public java.util.Vector bind(java.util.Vector goals)
public void userResponded()
public BindResults bind(java.util.Vector goals,
java.util.Vector input,
int mode)
protected java.util.Vector sortFeasible(java.lang.String gid,
java.util.Vector input)
public PlannerEnactStruct enact(Goal goal,
Goal sla)
int latestConfirmTime(java.util.Vector goals)
int latestConfirmTime(Goal goal)
protected java.lang.String makeIndex(java.util.Vector goals)
protected void index(PlannerQueryStruct Results)
protected void removeFromIndexTable(java.util.Vector goals)
public void book(int type,
java.util.Vector goals,
java.util.Vector records)
protected void book(int type,
Goal goal,
java.util.Vector rootSet)
public void reject(java.util.Vector goals,
java.util.Vector records)
protected void reject(Goal goal,
java.util.Vector rootSet)
java.util.Vector schedule(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
java.util.Vector goals,
PlannerQueryStruct struct,
boolean mode)
java.util.Vector schedule(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
Goal goal,
PlannerQueryStruct struct,
boolean mode)
protected void addToExternal(java.util.Vector List,
Goal goal)
java.util.Vector schedule(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
Goal goal,
java.util.Vector tasks,
PlannerQueryStruct struct,
boolean mode)
java.util.Vector schedule_summary(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
Goal goal,
java.util.Vector tasks,
PlannerQueryStruct struct,
boolean mode)
java.util.Vector expand_summary(Decomposition decomposition,
PlannerQueryStruct struct,
boolean mode)
java.util.Vector schedule_primitive(java.lang.String key,
PlanRecord parent,
java.util.Vector path,
Goal goal,
java.util.Vector tasks,
PlannerQueryStruct struct,
boolean mode)
protected java.util.Vector schedule_children(java.lang.String key,
PlanRecord rec,
java.util.Vector path,
PlannerQueryStruct struct,
boolean mode)
protected void resume_planning(DelegationStruct[] ds,
PlannerQueryStruct struct)
public void goalConfirmed(java.util.Vector original_goals,
java.util.Vector confirmed_goals,
java.util.Vector selection)
protected boolean validTime(int t)
protected boolean validProc(int proc)
protected boolean isFreeCell(int proc,
int t)
public void shuffle()
void executeEarliest()
void executeEarliest(PlanRecord rec)
boolean incrementProcessorTime(PlanRecord rec,
int time)
public void checkRecords()
public void notifyReceived(Fact f1,
java.lang.String goalId,
java.lang.String subgoalId)
protected void assignCell(int proc,
int t,
PlanRecord rec)
void freeCell(int proc,
int t)
void freeCells(int proc,
int s,
int e)
public Goal recreateSubgoal(Goal goal)
public void reconfirmParentOf(java.util.Vector goals)
public void reconfirmParentOf(Goal g)
public void failParentOf(java.util.Vector goals)
public void failParentOf(Goal g)
void softFailParentOf(java.util.Vector goals,
PlannerQueryStruct struct,
int mode)
public void addPlanningMonitor(PlanningMonitor monitor,
long type)
public void removePlanningMonitor(PlanningMonitor monitor,
long type)
public void addPlanStepMonitor(PlanStepMonitor monitor,
long type,
boolean notify_previous)
public void addPlanStepMonitor(PlanStepMonitor monitor,
long type)
public void removePlanStepMonitor(PlanStepMonitor monitor,
long type)
void notifyMonitors(Goal goal,
int event_type,
int sub_type)
void notifyMonitors(PlanRecord record,
int type)
protected double now()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||