|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
com.agentfactory.platform.core.Agent
public abstract class Agent
This class represents the embodiment of an agent within the AgentFactory runtime environment. Memebers include the agents name and various objects used by the AF platform's services. This class is abstract and must be instantiated for a given agent oriented programming language. A number of abstract methods are defined, each of these will have to be made concrete to provide the logical elements of a successful agent implementation. There is an arguement that some of the meta information contained here could be contained in the agent's own mental state. For example, the agent's beliefs could easily include information about the agent's name and required services. Rather than holding that information in the mental state, we hold it here. We do this because: (1) it cuts down on the information that needs to be reasoned about by the agent; (2) it removes the need to enforece the use of specific self knowledge actuators; (3) since this information is meta information about the state of the agent implementation, it is subalbe to store the information out of the agent's mental state. TODO - robertr - 13-Aug-2004 - Code review on migration.
| Field Summary | |
|---|---|
static int |
ACTIVE
FIPA ACTIVE STATE |
AgentPlatform |
agentPlatform
The AF Platform on which the agent is running. |
protected java.util.Vector |
args
The arguements supplied to the agent interpreter |
protected FIPAMessageQueue |
fipaMessageQueue
A Queue of FIPA compliant messages. |
static int |
INITIATED
FIPA INITIATED STATE |
java.lang.String |
name
The agent's name. |
protected int |
state
Indicate the state of the agent. |
static int |
SUSPENDED
FIPA SUSPENDED STATE |
static int |
TERMINATED
FIPA TERMINATED STATE |
static int |
TERMINATING
|
protected int |
timeSlice
The amount of time that the agent has for execution... |
static int |
TRANSIT
FIPA TRANSIT STATE |
static int |
WAITING
FIPA WAITING STATE |
| Constructor Summary | |
|---|---|
Agent(java.lang.String name,
java.lang.String inType,
AgentPlatform platform,
java.util.Vector arguments)
The main constructor for the Agent class. |
|
| Method Summary | |
|---|---|
void |
addAgentID(AgentID id)
Methods concerned with the Agent's Addressbook. |
boolean |
bindToService(java.lang.String serviceID)
this method attempts to bind the agent to a specified service. |
void |
changeAIDName(java.lang.String inName)
Change the AID Name. |
boolean |
containsBoundServiceByName(java.lang.String serviceName)
|
abstract void |
endOfTimeSlice()
|
abstract void |
execute()
|
AgentID |
getAgentID()
|
AgentID |
getAgentID(java.lang.String inName)
Retrives the AgentID associated with the given name. |
java.util.Collection |
getAgentIDs()
|
AgentPlatform |
getAgentPlatform()
Get a handle to the AgentPlatform on which this agent is running |
java.util.Vector |
getAvailableMTSServices()
Return the services available. |
java.util.Enumeration |
getBoundServices()
Get the services that the agent is acutally bound to on this platform. |
FIPAMessageQueue |
getMessageQueue()
Get the agent's message queuee |
java.lang.String |
getName()
Get the agent's name. |
PlatformService |
getService(java.lang.String name)
|
int |
getState()
Get the State of the Agent Interperter. |
int |
getTimeSlice()
Get the current time slice |
abstract java.lang.String |
getType()
|
abstract void |
initialise(java.lang.String content)
Called directly by the ScriptHandler class, this method is used to initialized a given type of agent. |
abstract void |
kill()
|
void |
metaRegistration()
Perform meta registration to activate FIPA type services. |
void |
notify(java.lang.String message)
OBSERVER METHODS |
void |
removeAgentID(java.lang.String inName)
Remove an agent ID from the agent's addressbook |
void |
resume()
|
void |
setState(int state)
Set the state of the agent interperter. |
void |
setTimeSlice(int timeSlice)
Set the current time slice |
abstract void |
step()
|
void |
suspend()
|
abstract void |
terminate()
|
java.lang.String |
toString()
|
void |
update(java.util.Observable o,
java.lang.Object arg)
|
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int INITIATED
public static final int ACTIVE
public static final int WAITING
public static final int SUSPENDED
public static final int TRANSIT
public static final int TERMINATED
public static final int TERMINATING
protected int state
protected int timeSlice
public java.lang.String name
protected FIPAMessageQueue fipaMessageQueue
public AgentPlatform agentPlatform
protected java.util.Vector args
| Constructor Detail |
|---|
public Agent(java.lang.String name,
java.lang.String inType,
AgentPlatform platform,
java.util.Vector arguments)
throws AgentConfigurationException
inName - - A String object that hods the given name of an agentinType - - A String object that holds the type of the agentinAgentPlatform - - An AgentPlatform objet that is running this
agent interpreter.inArguements - - A Vector object containing any arguements supplied
to the interpreter. These will have been defined in the platform
configuration file and are all String objects.
AgentConfigurationException - - Thrown if there were any problems
instantiating the agent instance.| Method Detail |
|---|
public void metaRegistration()
public void setState(int state)
state - - The state to which the agent is to be set.public int getState()
public FIPAMessageQueue getMessageQueue()
public boolean bindToService(java.lang.String serviceID)
serviceID - the id of the service that the agent is to attempt to bind to
public java.util.Vector getAvailableMTSServices()
public java.util.Enumeration getBoundServices()
public boolean containsBoundServiceByName(java.lang.String serviceName)
public PlatformService getService(java.lang.String name)
public void addAgentID(AgentID id)
id - an AgentIDpublic AgentID getAgentID(java.lang.String inName)
inName - the name of the agent whose ID is required.
public void removeAgentID(java.lang.String inName)
inName - The name of the agent that is to be removed from the addressbook.public void changeAIDName(java.lang.String inName)
inName - public AgentID getAgentID()
public java.util.Collection getAgentIDs()
public java.lang.String getName()
public AgentPlatform getAgentPlatform()
public int getTimeSlice()
public void setTimeSlice(int timeSlice)
timeSlice - the new time slice value
public void update(java.util.Observable o,
java.lang.Object arg)
update in interface java.util.Observerpublic void notify(java.lang.String message)
public void suspend()
public void resume()
public abstract void kill()
public abstract void step()
public abstract void terminate()
public abstract java.lang.String getType()
public abstract void endOfTimeSlice()
public abstract void execute()
public abstract void initialise(java.lang.String content)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||