madkit.kernel
Class AgentAddress

java.lang.Object
  extended by madkit.kernel.AgentAddress
All Implemented Interfaces:
java.io.Serializable

public class AgentAddress
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
AgentAddress(AgentAddress add)
           
AgentAddress(java.lang.String def)
          Attempts to define an AgentAddress from a string representation (MadKit syntax).
AgentAddress(java.lang.String n, KernelAddress k)
          Define a new AgentAddress
 
Method Summary
 boolean equals(java.lang.Object o)
          Compare two instances of AgentAddress
 KernelAddress getKernel()
          return the address of the kernel on which the agent is currently running
 java.lang.String getLocalID()
          The discriminating part of an AgentAddress
 java.lang.String getName()
          Return current agent name
 java.lang.String getProtocol()
          Return this address protocol
 int hashCode()
           
 boolean isLocal()
          Check is this address is a local address
 java.lang.String toString()
          Returns a string representation of the AgentAddress (with MadKit syntax)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentAddress

public AgentAddress(java.lang.String n,
                    KernelAddress k)
Define a new AgentAddress

Parameters:
n - agent name
k - local kernel address

AgentAddress

public AgentAddress(AgentAddress add)

AgentAddress

public AgentAddress(java.lang.String def)
             throws InvalidAddressException
Attempts to define an AgentAddress from a string representation (MadKit syntax). The official format is "mka:a,b@k" ("a" an agent name, "b" agent ID, "k" a kernel address)

Parameters:
def - string representation or agent name
Throws:
InvalidAddressException - if the string cannot be parsed
Method Detail

toString

public java.lang.String toString()
Returns a string representation of the AgentAddress (with MadKit syntax)

Overrides:
toString in class java.lang.Object

isLocal

public boolean isLocal()
Check is this address is a local address


equals

public boolean equals(java.lang.Object o)
Compare two instances of AgentAddress

Overrides:
equals in class java.lang.Object
Parameters:
o - other agent address (can be void)

getProtocol

public java.lang.String getProtocol()
Return this address protocol


getName

public java.lang.String getName()
Return current agent name


getLocalID

public java.lang.String getLocalID()
The discriminating part of an AgentAddress


getKernel

public KernelAddress getKernel()
return the address of the kernel on which the agent is currently running


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.