zeus.actors
Class TaskContext

java.lang.Object
  extended byzeus.actors.TaskContext

public class TaskContext
extends java.lang.Object

TaskContext is a API which should make it easy for the agent developer (you!) to access the parts of the system and agent that you need to develop code which changes the system state when an agents deliberative engine (it's planner) decides to execute some code

You use TaskContext is a little like AgentContext in ZeusExternals. However whereas the AgentContext object is used to store the AgentState, TaskContext is nowhere near as important to the system - it just acts as a bag of refereneces for you to access and use. These references are loaded into the class by task generated by TaskWriter when it has a primative class with a TaskExternal defined.

Useful methods are :

  • AgentContext getAgentContext (); which returns the context object for the agent that is executing this task
  • Fact [][] getInputArgs (); which returns the input facts (preconditions) for this task
  • Fact [][] getOutputArgs (); which gives you the output arguements (postconditions for this task. Obviously one use of the task exteranl is to change these so that they are dependent on the decisions that are made by the user code here
  • ZeusExteranl getExternal (); which gives you a referenece back to the external program that you have given to the agent - but you will have to cast the reference to the external manually, which is why we put in...
  • String getExternalClassName(); which you can use to get the name of the external in case the task is used by many agents that have different externals.

    Version:
    1.04
    Author:
    Simon Thompson
    See Also:
    AgentContext, zeus.concepts.PrimativeTask, zeus.generator.code.TaskWriter;

    Field Summary
    private  AgentContext context
               
    private  Fact[] expInputArgs
               
    private  Fact[] expOutputArgs
               
    private  Fact[][] inputArgs
               
    private  Fact[][] outputArgs
               
     
    Constructor Summary
    TaskContext()
               
     
    Method Summary
     AgentContext getAgentContext()
               
     Fact[] getExpInputArgs()
               
     Fact[] getExpOutputArgs()
               
     java.lang.String getExternalClassName()
               
     Fact[][] getInputArgs()
               
     Fact[][] getOutputArgs()
               
     ZeusExternal getZeusExternal()
               
     void setAgentContext(AgentContext context)
               
     void setExpInputArgs(Fact[] expInputArgs)
               
     void setExpOutputArgs(Fact[] expOutputArgs)
               
     void setInputArgs(Fact[][] inputArgs)
               
     void setOutputArgs(Fact[][] outputArgs)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    context

    private AgentContext context

    inputArgs

    private Fact[][] inputArgs

    outputArgs

    private Fact[][] outputArgs

    expInputArgs

    private Fact[] expInputArgs

    expOutputArgs

    private Fact[] expOutputArgs
    Constructor Detail

    TaskContext

    public TaskContext()
    Method Detail

    setAgentContext

    public void setAgentContext(AgentContext context)

    setInputArgs

    public void setInputArgs(Fact[][] inputArgs)

    setOutputArgs

    public void setOutputArgs(Fact[][] outputArgs)

    setExpInputArgs

    public void setExpInputArgs(Fact[] expInputArgs)

    setExpOutputArgs

    public void setExpOutputArgs(Fact[] expOutputArgs)

    getAgentContext

    public AgentContext getAgentContext()

    getOutputArgs

    public Fact[][] getOutputArgs()

    getInputArgs

    public Fact[][] getInputArgs()

    getExpOutputArgs

    public Fact[] getExpOutputArgs()

    getExpInputArgs

    public Fact[] getExpInputArgs()

    getZeusExternal

    public ZeusExternal getZeusExternal()

    getExternalClassName

    public java.lang.String getExternalClassName()


    Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.