zeus.actors
Class ZeusAgentContext

java.lang.Object
  extended byzeus.actors.ZeusAgentContext
All Implemented Interfaces:
AgentContext

public class ZeusAgentContext
extends java.lang.Object
implements AgentContext

Every Zeus Agent possesses one implementation of the AgentContext interface whose role is to hold references to the objects that implement the agent's internal components.

ZeusAgentContext is the default implementation that is used for normal agents generated by the AgentGenerator. All of the components of an agent that we have implemented so far are expected to be present in an agent of this sort. Changes Simon adds whereAmI() to allow service descriptions to be done 22/9/02


Field Summary
 double accept_timeout
           
 double address_timeout
           
protected  AddressBook addressBook
          Stores agent identities and the location the agent believes they currenty reside at
 double addressbook_refresh
           
protected  BasicAgent agent
          A reference to a class implementing some shared agent methods
protected  BasicAgentUI agentUI
          A reference to the AgentViewer class that provides a visual depiction of the state of the agent's components
protected  Clock clock
          The agent's local time-keeping model
protected  Engine engine
          The co-ordination engine component, this drives the agent's social and problem solving behaviour
 boolean execute_earliest
           
protected  ExternalDb externalDb
          A reference to an implementation of wrapper class that connects the agent with an external data source (like a database)
 double facilitator_refresh
           
 double facilitator_timeout
           
protected  java.util.Vector facilitators
          Stores the agent's own list of known Facilitators
protected  GenSym genSym
          The agent's local unique identifier generator
protected  MailBox mbox
          The component that implements the agent's communication mechanism
protected  ExecutionMonitor monitor
          This component monitors the state of the tasks executed by the agent
protected  MsgHandler msgHandler
          The component that determines what actions are performed on the receipt of messages
protected  java.lang.String name
          The agent's identity - this should be unique
protected  java.util.Vector nameservers
          Stores the agent's own list of known Name Servers
protected  OntologyDb ontologyDb
          This holds the agents local copy of the concepts that form the application ontology
protected  OrganisationDb organisationDb
          This stores the organisational relationships believed by the agent
protected  Planner planner
          This component maintains and enacts the agent's diary of schedules goals
protected  ProtocolDb protocolDb
          This stores the protocols and strategies known the agent
protected  java.util.Hashtable queryTable
          Internal variable used by co-ordination engine components
 double registration_timeout
           
 double replan_period
           
protected  ResourceDb resourceDb
          This stores the resource objects currently owned by the agent
protected  ReteEngine reteEngine
          A rule engine based on the classic Rete Algorithm
 boolean share_plan
           
protected  TaskDb taskDb
          This stores the definitions of the tasks the agent knows it is capable of performing
protected  java.lang.String type
          The agent's functional type: one of "Nameserver", "Facilitator", "Visualiser", "DbProxy" or "Agent"
protected  ZeusExternal zeusExternal
          A reference to the class that implements the agent's external interface, this is typically used to connect GUI front-ends to the agent.
 
Constructor Summary
ZeusAgentContext(java.lang.String name, java.lang.String type)
          class constructor
 
Method Summary
 void addFacilitator(java.lang.String agent)
           
 void addNameserver(Address address)
           
 AddressBook AddressBook()
           
 BasicAgent Agent()
           
 BasicAgentUI AgentUI()
           
 Clock Clock()
           
 Time currentTime()
           
 Engine Engine()
           
 ExecutionMonitor ExecutionMonitor()
           
 ExternalDb ExternalDb()
           
 java.util.Vector facilitators()
           
 GenSym GenSym()
           
 double getAcceptTimeout()
           
 AddressBook getAddressBook()
           
 double getAddressBookRefresh()
           
 double getAddressTimeout()
           
 BasicAgent getAgent()
           
 BasicAgentUI getAgentUI()
           
 Clock getClock()
           
 long getClockStep()
           
 Engine getEngine()
           
 boolean getExecuteEarliest()
           
 ExecutionMonitor getExecutionMonitor()
           
 ExternalDb getExternalDb()
           
 double getFacilitatorRefresh()
           
 java.util.Vector getFacilitators()
           
 double getFacilitatorTimeout()
           
 GenSym getGenSym()
           
 InTray getInTray()
          return the inTray for this agent
 MailBox getMailBox()
           
 MsgHandler getMsgHandler()
           
 java.util.Vector getNameservers()
           
 OntologyDb getOntologyDb()
           
 OrganisationDb getOrganisationDb()
           
 Planner getPlanner()
           
 ProtocolDb getProtocolDb()
           
 java.util.Hashtable getQueryTable()
           
 double getRegistrationTimeout()
           
 double getReplanPeriod()
           
 ResourceDb getResourceDb()
           
 ReteEngine getReteEngine()
           
 boolean getSharePlan()
           
 TaskDb getTaskDb()
           
 TransportFactory getTransportFactory()
          use the getTransportFactory to get a transportFactory that your agent can use to get a message transport for a particular address that it wants to send a message to.
 ZeusExternal getZeusExternal()
           
 MailBox MailBox()
           
 MsgHandler MsgHandler()
           
 java.util.Vector nameservers()
           
 java.lang.String newId()
           
 java.lang.String newId(java.lang.String tag)
           
 double now()
           
 OntologyDb OntologyDb()
           
 OrganisationDb OrganisationDb()
           
 Planner Planner()
           
 ProtocolDb ProtocolDb()
           
 java.util.Hashtable queryTable()
           
 void removeFacilitator(java.lang.String agent)
           
 void removeNameserver(java.lang.String address)
           
 ResourceDb ResourceDb()
           
 ReteEngine ReteEngine()
           
 void set(AddressBook addressBook)
          set the addressBook for this agent
 void set(BasicAgent agent)
          set a reference to the agent object into this context object
 void set(BasicAgentUI agentUI)
           
 void set(Clock clock)
          setting the clock is a vital activity for a Zeus agent, basically by getting a Clock that is set to the Agency time (provided by the ANServer) the agent are able to co-ordinate their actions
 void set(Engine engine)
           
 void set(ExecutionMonitor monitor)
           
 void set(ExternalDb externalDb)
           
 void set(MailBox mbox)
           
 void set(MsgHandler msgHandler)
           
 void set(OntologyDb ontologyDb)
           
 void set(OrganisationDb db)
           
 void set(Planner planner)
           
 void set(ProtocolDb protocolDb)
           
 void set(ResourceDb resourceDb)
           
 void set(ReteEngine reteEngine)
           
 void set(TaskDb taskDb)
           
 void set(ZeusExternal zeusExternal)
          the ZeusExternal is the user defined part of the agent that is called by the agent class when it is run
 void setAcceptTimeout(double val)
           
 void setAddressBookRefresh(double val)
           
 void setAddressTimeout(double val)
           
 void setExecuteEarliest(boolean execute_earliest)
           
 void setFacilitatorRefresh(double val)
           
 void setFacilitators(java.util.Vector input)
           
 void setFacilitatorTimeout(double val)
           
 void setNameservers(java.util.Vector input)
           
 void setRegistrationTimeout(double val)
           
 void setReplanPeriod(double val)
           
 void setSharePlan(boolean share_plan)
           
 TaskDb TaskDb()
           
 Time time(long ctm)
           
 java.lang.String whatami()
          return the type of agent, originally one of "Nameserver", "Facilitator", "Visualiser", "DbProxy" or "Agent"
 java.lang.String whereAmI()
          whereAmI should return the deployed address of the agent - implemented as a TCP/IP address ....
 java.lang.String whoami()
          return the name of the agent
 ZeusExternal ZeusExternal()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

share_plan

public boolean share_plan

execute_earliest

public boolean execute_earliest

registration_timeout

public double registration_timeout

facilitator_timeout

public double facilitator_timeout

address_timeout

public double address_timeout

accept_timeout

public double accept_timeout

addressbook_refresh

public double addressbook_refresh

facilitator_refresh

public double facilitator_refresh

replan_period

public double replan_period

nameservers

protected java.util.Vector nameservers
Stores the agent's own list of known Name Servers


facilitators

protected java.util.Vector facilitators
Stores the agent's own list of known Facilitators


addressBook

protected AddressBook addressBook
Stores agent identities and the location the agent believes they currenty reside at


mbox

protected MailBox mbox
The component that implements the agent's communication mechanism


msgHandler

protected MsgHandler msgHandler
The component that determines what actions are performed on the receipt of messages


reteEngine

protected ReteEngine reteEngine
A rule engine based on the classic Rete Algorithm


engine

protected Engine engine
The co-ordination engine component, this drives the agent's social and problem solving behaviour


monitor

protected ExecutionMonitor monitor
This component monitors the state of the tasks executed by the agent


planner

protected Planner planner
This component maintains and enacts the agent's diary of schedules goals


organisationDb

protected OrganisationDb organisationDb
This stores the organisational relationships believed by the agent


taskDb

protected TaskDb taskDb
This stores the definitions of the tasks the agent knows it is capable of performing


resourceDb

protected ResourceDb resourceDb
This stores the resource objects currently owned by the agent


ontologyDb

protected OntologyDb ontologyDb
This holds the agents local copy of the concepts that form the application ontology


externalDb

protected ExternalDb externalDb
A reference to an implementation of wrapper class that connects the agent with an external data source (like a database)


zeusExternal

protected ZeusExternal zeusExternal
A reference to the class that implements the agent's external interface, this is typically used to connect GUI front-ends to the agent.


agent

protected BasicAgent agent
A reference to a class implementing some shared agent methods


agentUI

protected BasicAgentUI agentUI
A reference to the AgentViewer class that provides a visual depiction of the state of the agent's components


protocolDb

protected ProtocolDb protocolDb
This stores the protocols and strategies known the agent


genSym

protected GenSym genSym
The agent's local unique identifier generator


clock

protected Clock clock
The agent's local time-keeping model


name

protected java.lang.String name
The agent's identity - this should be unique


type

protected java.lang.String type
The agent's functional type: one of "Nameserver", "Facilitator", "Visualiser", "DbProxy" or "Agent"


queryTable

protected java.util.Hashtable queryTable
Internal variable used by co-ordination engine components

Constructor Detail

ZeusAgentContext

public ZeusAgentContext(java.lang.String name,
                        java.lang.String type)
class constructor

Parameters:
name - is a string containing the name of the agent (ie. "myAgent") which must be unique in this naming space
type - is the type of the agent - usually something like "ANServer","Facilitator" or "FIPA_IIOP"

If either of these two parameters are null an IllegalArguementException will be thrown.

TO DO: the IllegalArguementException should be part of the method declaration.

Method Detail

getSharePlan

public boolean getSharePlan()
Specified by:
getSharePlan in interface AgentContext

getExecuteEarliest

public boolean getExecuteEarliest()
Specified by:
getExecuteEarliest in interface AgentContext

getAddressBookRefresh

public double getAddressBookRefresh()
Specified by:
getAddressBookRefresh in interface AgentContext

getAddressTimeout

public double getAddressTimeout()
Specified by:
getAddressTimeout in interface AgentContext

getReplanPeriod

public double getReplanPeriod()
Specified by:
getReplanPeriod in interface AgentContext

getRegistrationTimeout

public double getRegistrationTimeout()
Specified by:
getRegistrationTimeout in interface AgentContext

getFacilitatorTimeout

public double getFacilitatorTimeout()
Specified by:
getFacilitatorTimeout in interface AgentContext

getAcceptTimeout

public double getAcceptTimeout()
Specified by:
getAcceptTimeout in interface AgentContext

getFacilitatorRefresh

public double getFacilitatorRefresh()
Specified by:
getFacilitatorRefresh in interface AgentContext

setSharePlan

public void setSharePlan(boolean share_plan)
Specified by:
setSharePlan in interface AgentContext

setExecuteEarliest

public void setExecuteEarliest(boolean execute_earliest)
Specified by:
setExecuteEarliest in interface AgentContext

setAddressBookRefresh

public void setAddressBookRefresh(double val)
Specified by:
setAddressBookRefresh in interface AgentContext

setAddressTimeout

public void setAddressTimeout(double val)
Specified by:
setAddressTimeout in interface AgentContext

setReplanPeriod

public void setReplanPeriod(double val)
Specified by:
setReplanPeriod in interface AgentContext

setRegistrationTimeout

public void setRegistrationTimeout(double val)
Specified by:
setRegistrationTimeout in interface AgentContext

setFacilitatorTimeout

public void setFacilitatorTimeout(double val)
Specified by:
setFacilitatorTimeout in interface AgentContext

setAcceptTimeout

public void setAcceptTimeout(double val)
Specified by:
setAcceptTimeout in interface AgentContext

setFacilitatorRefresh

public void setFacilitatorRefresh(double val)
Specified by:
setFacilitatorRefresh in interface AgentContext

setFacilitators

public void setFacilitators(java.util.Vector input)
Specified by:
setFacilitators in interface AgentContext

addFacilitator

public void addFacilitator(java.lang.String agent)
Specified by:
addFacilitator in interface AgentContext

removeFacilitator

public void removeFacilitator(java.lang.String agent)
Specified by:
removeFacilitator in interface AgentContext

setNameservers

public void setNameservers(java.util.Vector input)
Specified by:
setNameservers in interface AgentContext

addNameserver

public void addNameserver(Address address)
Specified by:
addNameserver in interface AgentContext

removeNameserver

public void removeNameserver(java.lang.String address)
Specified by:
removeNameserver in interface AgentContext

set

public void set(AddressBook addressBook)
Description copied from interface: AgentContext
set the addressBook for this agent

Specified by:
set in interface AgentContext

set

public void set(ProtocolDb protocolDb)
Specified by:
set in interface AgentContext

set

public void set(MailBox mbox)
Specified by:
set in interface AgentContext

set

public void set(MsgHandler msgHandler)
Specified by:
set in interface AgentContext

set

public void set(Engine engine)
Specified by:
set in interface AgentContext

set

public void set(ReteEngine reteEngine)
Specified by:
set in interface AgentContext

set

public void set(ExecutionMonitor monitor)
Specified by:
set in interface AgentContext

set

public void set(Planner planner)
Specified by:
set in interface AgentContext

set

public void set(OrganisationDb db)
Specified by:
set in interface AgentContext

set

public void set(TaskDb taskDb)
Specified by:
set in interface AgentContext

set

public void set(ResourceDb resourceDb)
Specified by:
set in interface AgentContext

set

public void set(OntologyDb ontologyDb)
Specified by:
set in interface AgentContext

set

public void set(BasicAgent agent)
Description copied from interface: AgentContext
set a reference to the agent object into this context object

Specified by:
set in interface AgentContext

set

public void set(BasicAgentUI agentUI)
Specified by:
set in interface AgentContext

set

public void set(ZeusExternal zeusExternal)
Description copied from interface: AgentContext
the ZeusExternal is the user defined part of the agent that is called by the agent class when it is run

Specified by:
set in interface AgentContext

set

public void set(ExternalDb externalDb)
Specified by:
set in interface AgentContext

set

public void set(Clock clock)
Description copied from interface: AgentContext
setting the clock is a vital activity for a Zeus agent, basically by getting a Clock that is set to the Agency time (provided by the ANServer) the agent are able to co-ordinate their actions

Specified by:
set in interface AgentContext

now

public double now()
Specified by:
now in interface AgentContext

currentTime

public Time currentTime()
Specified by:
currentTime in interface AgentContext

time

public Time time(long ctm)
Specified by:
time in interface AgentContext

getClockStep

public long getClockStep()
Specified by:
getClockStep in interface AgentContext

newId

public java.lang.String newId()
Specified by:
newId in interface AgentContext

newId

public java.lang.String newId(java.lang.String tag)
Specified by:
newId in interface AgentContext

whatami

public java.lang.String whatami()
Description copied from interface: AgentContext
return the type of agent, originally one of "Nameserver", "Facilitator", "Visualiser", "DbProxy" or "Agent"

Specified by:
whatami in interface AgentContext

whoami

public java.lang.String whoami()
Description copied from interface: AgentContext
return the name of the agent

Specified by:
whoami in interface AgentContext

queryTable

public java.util.Hashtable queryTable()
Specified by:
queryTable in interface AgentContext

facilitators

public java.util.Vector facilitators()
Specified by:
facilitators in interface AgentContext

nameservers

public java.util.Vector nameservers()
Specified by:
nameservers in interface AgentContext

AddressBook

public AddressBook AddressBook()
Specified by:
AddressBook in interface AgentContext

MailBox

public MailBox MailBox()
Specified by:
MailBox in interface AgentContext

MsgHandler

public MsgHandler MsgHandler()
Specified by:
MsgHandler in interface AgentContext

ReteEngine

public ReteEngine ReteEngine()
Specified by:
ReteEngine in interface AgentContext

Engine

public Engine Engine()
Specified by:
Engine in interface AgentContext

ExecutionMonitor

public ExecutionMonitor ExecutionMonitor()
Specified by:
ExecutionMonitor in interface AgentContext

Planner

public Planner Planner()
Specified by:
Planner in interface AgentContext

OrganisationDb

public OrganisationDb OrganisationDb()
Specified by:
OrganisationDb in interface AgentContext

TaskDb

public TaskDb TaskDb()
Specified by:
TaskDb in interface AgentContext

ResourceDb

public ResourceDb ResourceDb()
Specified by:
ResourceDb in interface AgentContext

OntologyDb

public OntologyDb OntologyDb()
Specified by:
OntologyDb in interface AgentContext

ExternalDb

public ExternalDb ExternalDb()
Specified by:
ExternalDb in interface AgentContext

ProtocolDb

public ProtocolDb ProtocolDb()
Specified by:
ProtocolDb in interface AgentContext

ZeusExternal

public ZeusExternal ZeusExternal()
Specified by:
ZeusExternal in interface AgentContext

AgentUI

public BasicAgentUI AgentUI()
Specified by:
AgentUI in interface AgentContext

Agent

public BasicAgent Agent()
Specified by:
Agent in interface AgentContext

GenSym

public GenSym GenSym()
Specified by:
GenSym in interface AgentContext

Clock

public Clock Clock()
Specified by:
Clock in interface AgentContext

getQueryTable

public java.util.Hashtable getQueryTable()
Specified by:
getQueryTable in interface AgentContext

getFacilitators

public java.util.Vector getFacilitators()
Specified by:
getFacilitators in interface AgentContext

getNameservers

public java.util.Vector getNameservers()
Specified by:
getNameservers in interface AgentContext

getAddressBook

public AddressBook getAddressBook()
Specified by:
getAddressBook in interface AgentContext

getMailBox

public MailBox getMailBox()
Specified by:
getMailBox in interface AgentContext

getMsgHandler

public MsgHandler getMsgHandler()
Specified by:
getMsgHandler in interface AgentContext

getReteEngine

public ReteEngine getReteEngine()
Specified by:
getReteEngine in interface AgentContext

getEngine

public Engine getEngine()
Specified by:
getEngine in interface AgentContext

getExecutionMonitor

public ExecutionMonitor getExecutionMonitor()
Specified by:
getExecutionMonitor in interface AgentContext

getPlanner

public Planner getPlanner()
Specified by:
getPlanner in interface AgentContext

getOrganisationDb

public OrganisationDb getOrganisationDb()
Specified by:
getOrganisationDb in interface AgentContext

getTaskDb

public TaskDb getTaskDb()
Specified by:
getTaskDb in interface AgentContext

getResourceDb

public ResourceDb getResourceDb()
Specified by:
getResourceDb in interface AgentContext

getOntologyDb

public OntologyDb getOntologyDb()
Specified by:
getOntologyDb in interface AgentContext

getExternalDb

public ExternalDb getExternalDb()
Specified by:
getExternalDb in interface AgentContext

getProtocolDb

public ProtocolDb getProtocolDb()
Specified by:
getProtocolDb in interface AgentContext

getZeusExternal

public ZeusExternal getZeusExternal()
Specified by:
getZeusExternal in interface AgentContext

getAgentUI

public BasicAgentUI getAgentUI()
Specified by:
getAgentUI in interface AgentContext

getAgent

public BasicAgent getAgent()
Specified by:
getAgent in interface AgentContext

getGenSym

public GenSym getGenSym()
Specified by:
getGenSym in interface AgentContext

getClock

public Clock getClock()
Specified by:
getClock in interface AgentContext

getTransportFactory

public TransportFactory getTransportFactory()
use the getTransportFactory to get a transportFactory that your agent can use to get a message transport for a particular address that it wants to send a message to.

Once you have the TransportFactory you will be able to use it to get the specific transport (OutTray) that you need

Specified by:
getTransportFactory in interface AgentContext
See Also:
OutTray, zeus.actors.service.TransportFactory, zeus.actors.service.IIOP_Z_HTTP_TransportFactory

getInTray

public InTray getInTray()
return the inTray for this agent

Specified by:
getInTray in interface AgentContext
Since:
1.1

whereAmI

public java.lang.String whereAmI()
whereAmI should return the deployed address of the agent - implemented as a TCP/IP address .... would be better implemented from a config file this is used to generate service descriptions

Specified by:
whereAmI in interface AgentContext


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