com.agentfactory.cldc.mts
Class AID

java.lang.Object
  extended by com.agentfactory.cldc.mts.AID

public class AID
extends java.lang.Object

The AID class represents an agent identifier. It contains the name of an agent and its address.

Author:
Conor Muldoon

Constructor Summary
AID(FOS nm, FOS addrs)
          Creates a new instance of AID.
 
Method Summary
 FOS addOutgoing(MessageTransportService mts, java.lang.String performative, AgentName agentName, FOS content)
          Adds an outgoing message to the message transport service.
 void appendBeliefString(java.lang.StringBuffer buffer)
          Appends the agent ID to a string buffer.
 FOS createMessage(java.lang.String localAddress, AgentName senderName, FOS content)
           
 boolean nameEquals(FOS fos)
          Checks if the name associated with this ID is equal to the specified name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AID

public AID(FOS nm,
           FOS addrs)
Creates a new instance of AID.

Parameters:
nm - the name of the agent.
addrs - the address of the agent.
Method Detail

nameEquals

public boolean nameEquals(FOS fos)
Checks if the name associated with this ID is equal to the specified name.

Parameters:
fos - the specified name.
Returns:
true if the agent name equals the speicified first order structure, false otherwise.

appendBeliefString

public void appendBeliefString(java.lang.StringBuffer buffer)
Appends the agent ID to a string buffer.

Parameters:
buffer - the string buffer to append the name to.

addOutgoing

public FOS addOutgoing(MessageTransportService mts,
                       java.lang.String performative,
                       AgentName agentName,
                       FOS content)
                throws MalformedLogicException
Adds an outgoing message to the message transport service. The message will be sent to the agent that has this agent ID.

Parameters:
mts - the message transport service that the outgoing message is to be added to.
performative - the performative of the message.
agentName - the name of the agent sending the message.
content - the content of the message.
Returns:
a first order structure representation of the message if operating in asynchronous mode, otherwise null.
Throws:
MalformedLogicException - if there is a logic error.

createMessage

public FOS createMessage(java.lang.String localAddress,
                         AgentName senderName,
                         FOS content)