|
|||||||||||
| 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.TaskDb
The Task Database is a simple storage component that holds the Task
descriptions known by the owning agent. This information is used by
the agent's Planner component.
The methods of this component are only likely to be of interest to developers who write code to monitor or change the abilities of agents. Change log ---------- 12-06-01 Added agentName and orgDb to facilitate intialisation from extended types.
| Nested Class Summary |
| Nested classes inherited from class java.util.Hashtable |
|
| Field Summary | |
static int |
ACCESS
|
static int |
ADD
|
protected java.lang.String |
agentName
|
protected static int |
CMAX
|
protected static int |
CMIN
|
protected AgentContext |
context
|
static int |
DELETE
|
protected boolean |
demo_version
|
protected HSet[] |
eventMonitor
|
protected GenSym |
gensym
|
static int |
MODIFY
|
static int |
NONE
|
protected OrganisationDb |
orgDb
|
protected static java.util.Random |
rand
|
| Fields inherited from class java.util.Hashtable |
|
| Constructor Summary | |
TaskDb()
|
|
TaskDb(AgentContext context)
|
|
| Method Summary | |
void |
add(Task task)
The primary method for adding new task abilities to the Task Database |
void |
add(Task[] List)
|
void |
add(java.util.Vector List)
|
protected int |
addItem(Fact[] List,
Task task)
|
protected int |
addItem(Fact fact,
Task task)
|
protected int |
addItem(java.util.Vector List,
Task task)
|
void |
addTaskMonitor(TaskMonitor monitor,
long event_type)
|
void |
addTaskMonitor(TaskMonitor monitor,
long event_type,
boolean notify_previous)
Use this if your code needs to react to changes in the Task Database |
void |
checkAndMapValue(java.lang.String attrName,
AttributeList attrs,
Fact[] produced)
checkAndMapValue takes a value from an attribute and checks to see if it is a reference to a post condition. |
protected java.util.Vector |
checkPath(java.util.Vector prior,
java.util.Vector path)
|
private void |
debug(java.lang.String out)
|
void |
del(Task task)
The primary method for deleting task abilities from the Task Database |
void |
del(Task[] List)
|
void |
del(java.util.Vector List)
|
protected int |
deleteItem(Fact[] List,
Task task)
|
protected int |
deleteItem(Fact fact,
Task task)
|
protected int |
deleteItem(java.util.Vector List,
Task task)
|
void |
deleteTask(java.lang.String name)
Deletes the task object with the given name |
java.util.Vector |
findAll(Fact fact)
Retrieves the tasks that produce a fact matching the parameter |
java.util.Vector |
findAll(Fact[] consumed,
Fact[] produced,
java.util.Vector path)
Retrieves the tasks that produce and consume the same facts as the parameters |
java.util.Vector |
findAll(Fact fact,
java.util.Vector path)
|
Task |
findOne(Fact fact)
Randomly chooses a task able to produces a fact matching the parameter |
AgentContext |
getAgentContext()
returns a reference to the agent context pointer |
Task |
getTask(java.lang.String name)
Returns a duplicate of the task object with the given name |
protected boolean |
hasCondition(Fact[] test,
Fact[] data)
|
protected boolean |
hasCondition(Fact test,
Fact[] data)
|
protected void |
notifyMonitors(Task task,
int type)
|
protected java.util.Vector |
reduce(java.util.Hashtable List,
Fact fact)
|
void |
removeTaskMonitor(TaskMonitor monitor,
long event_type)
|
void |
resolveall(ArithmeticFn target,
Task task,
Fact[] resolvers)
|
void |
resolveCostAndTime(Task task,
Fact[] consumed,
Fact[] produced)
resolveCostAndTime is used to check that the cost and timing of the task in terms of the preconditions and postconditions of the task is properly resolved . |
void |
resolvePreconditions(Task task,
Fact[] consumed,
Fact[] produced)
resolvePreconditions is used to check through all the precondition attributes in the task as they are loaded to see if there are any references to postcondition attributes, and then resolve those references so that when task chaining and execution occur the correct values will be used |
protected void |
sort_basic(java.util.Vector List)
|
protected void |
sort(java.util.Vector List)
Sorts a vector of tasks according to their time and cost functions |
| 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 |
protected HSet[] eventMonitor
public static final int MODIFY
public static final int ADD
public static final int DELETE
public static final int ACCESS
public static final int NONE
protected static java.util.Random rand
protected static int CMIN
protected static int CMAX
protected boolean demo_version
protected java.lang.String agentName
protected OrganisationDb orgDb
protected AgentContext context
protected GenSym gensym
| Constructor Detail |
public TaskDb()
public TaskDb(AgentContext context)
| Method Detail |
public AgentContext getAgentContext()
public void add(Task task)
public void resolveCostAndTime(Task task,
Fact[] consumed,
Fact[] produced)
public void resolveall(ArithmeticFn target,
Task task,
Fact[] resolvers)
public void resolvePreconditions(Task task,
Fact[] consumed,
Fact[] produced)
public void checkAndMapValue(java.lang.String attrName,
AttributeList attrs,
Fact[] produced)
public void add(java.util.Vector List)
public void add(Task[] List)
protected int addItem(java.util.Vector List,
Task task)
protected int addItem(Fact[] List,
Task task)
protected int addItem(Fact fact,
Task task)
public void del(Task task)
public void del(java.util.Vector List)
public void del(Task[] List)
protected int deleteItem(java.util.Vector List,
Task task)
protected int deleteItem(Fact[] List,
Task task)
protected int deleteItem(Fact fact,
Task task)
public Task getTask(java.lang.String name)
public void deleteTask(java.lang.String name)
public Task findOne(Fact fact)
public java.util.Vector findAll(Fact fact)
public java.util.Vector findAll(Fact fact,
java.util.Vector path)
public java.util.Vector findAll(Fact[] consumed,
Fact[] produced,
java.util.Vector path)
protected boolean hasCondition(Fact[] test,
Fact[] data)
protected boolean hasCondition(Fact test,
Fact[] data)
protected java.util.Vector checkPath(java.util.Vector prior,
java.util.Vector path)
protected java.util.Vector reduce(java.util.Hashtable List,
Fact fact)
protected void sort(java.util.Vector List)
protected void sort_basic(java.util.Vector List)
public void addTaskMonitor(TaskMonitor monitor,
long event_type,
boolean notify_previous)
public void addTaskMonitor(TaskMonitor monitor,
long event_type)
public void removeTaskMonitor(TaskMonitor monitor,
long event_type)
protected void notifyMonitors(Task task,
int type)
private void debug(java.lang.String out)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||