All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaAgent.agent.OPAgent

java.lang.Object
   |
   +----JavaAgent.agent.Agent
           |
           +----JavaAgent.agent.OPAgent

public class OPAgent
extends Agent
An OPAgent is a normal JAT Agent that also runs an OPlan Process.


Variable Index

 o fromOPlan
the OPReader for reading from the OPlan Process
 o oPlanProcess
the handle of the OPlan Process strted by this OPAgent
 o toOPlan
the OPWriter for writing to the OPlan Process

Constructor Index

 o OPAgent(ContextInterface, String, URL, URL, File, File)
The constructor for an OPAgent directly calls standard agent constructor without changing the parameters.

Method Index

 o init()
Creates the ResourceManager, MessageHandler, starts an OPlan Process, and reads in the init_file.
 o initiateTermination()
Called when the executable class which contains the OPAgent terminates.

Variables

 o oPlanProcess
 public Process oPlanProcess
the handle of the OPlan Process strted by this OPAgent

 o fromOPlan
 public OPReader fromOPlan
the OPReader for reading from the OPlan Process

 o toOPlan
 public OPWriter toOPlan
the OPWriter for writing to the OPlan Process

Constructors

 o OPAgent
 public OPAgent(ContextInterface context,
                String n,
                URL init_url,
                URL shared,
                File shared_dir,
                File working_dir)
The constructor for an OPAgent directly calls standard agent constructor without changing the parameters. The OPlan Process that this OPAgent will run is started in the init() method.

Parameters:
context - the ContextInterface for this OPAgent
n - the name of this agent
init_url - the URL pointing to the initialization messages
shared - a URL pointing to some shared location
shared_dir - a shared directory
working_dir - the working directory for this OPAgent

Methods

 o init
 public void init()
Creates the ResourceManager, MessageHandler, starts an OPlan Process, and reads in the init_file. This function also starts an OPReader and an OPWriter which are threads for the communication with OPlan.

Overrides:
init in class Agent
 o initiateTermination
 public void initiateTermination()
Called when the executable class which contains the OPAgent terminates. The agent sends a remove-address message to the ANS and terminates the OPlan Process.

Overrides:
initiateTermination in class Agent

All Packages  Class Hierarchy  This Package  Previous  Next  Index