lime
Class AgentID

java.lang.Object
  extended bylime.AgentID
All Implemented Interfaces:
java.io.Serializable

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

Defines the identifier of StationaryAgent and MobileAgent objects. The (globally unique) identifier is generated when the agent is instantiated and will remain the same when the agent migrates.

Version:
1.0 alpha
Author:
Amy L. Murphy, Gian Pietro Picco
See Also:
Serialized Form

Field Summary
(package private)  LimeServerID creationHost
          The identifier is composed of two parts: the LimeServerID of the host where the agent was created and a progressive number assigned by that LimeServer.
(package private)  long n
           
 
Constructor Summary
(package private) AgentID()
          Construct the DEFAULT agent id.
  AgentID(LimeServerID creationHost, long n)
          Construct a new agent identifier.
 
Method Summary
 boolean equals(java.lang.Object id)
          Tests two agent identifiers for equality.
 int hashCode()
           
 java.lang.String toString()
          Returns a concise textual description for this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

creationHost

final LimeServerID creationHost
The identifier is composed of two parts: the LimeServerID of the host where the agent was created and a progressive number assigned by that LimeServer.


n

final long n
Constructor Detail

AgentID

public AgentID(LimeServerID creationHost,
               long n)
Construct a new agent identifier. This constructor may disappear in the future.

Parameters:
creationHost - the host where the agent has been created.
n - the numeric identifier.

AgentID

AgentID()
Construct the DEFAULT agent id. To be used for system tuple space tuples NOTE: this is a hack!!!!

Method Detail

equals

public boolean equals(java.lang.Object id)
Tests two agent identifiers for equality.

Parameters:
id - the agent id to be compared with.
Returns:
true if the two identifiers are the same, false otherwise.

hashCode

public int hashCode()

toString

public java.lang.String toString()
Returns a concise textual description for this object.