cz.cuni.amis.pogamut.base.agent.impl
Class AgentId
java.lang.Object
cz.cuni.amis.pogamut.base.agent.impl.AgentId
- All Implemented Interfaces:
- IAgentId, cz.cuni.amis.utils.token.IToken, Serializable
- Direct Known Subclasses:
- AgentTeamedId, TeamedAgentId
public class AgentId
- extends Object
- implements IAgentId
Default AgentId providing unique id based on UID
and IP of the host.
- Author:
- Jimmy
- See Also:
- Serialized Form
AGENT_NAME_DEPENDENCY
public static final String AGENT_NAME_DEPENDENCY
- See Also:
- Constant Field Values
random
protected static Random random
NO_NAME
public static final String NO_NAME
- See Also:
- Constant Field Values
AgentId
public AgentId()
AgentId
@Inject
public AgentId(String agentName)
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
getName
public cz.cuni.amis.utils.flag.Flag<String> getName()
- Description copied from interface:
IAgentId
- Contains a human-readable name of the agent.
Note that the name is quite different string than IAgentId.getToken()
. The
token contains unique-identifier of the agent across whole JVMs in the world, but
the name is just human-readable identifier that can be even changed over time.
Therefore, the name should not be used for any compares or interpretation.
- Specified by:
getName
in interface IAgentId
- Returns:
getIds
public long[] getIds()
- Specified by:
getIds
in interface cz.cuni.amis.utils.token.IToken
getToken
public String getToken()
- Description copied from interface:
IAgentId
- Must return token that is unique even across different JVMs.
- Specified by:
getToken
in interface IAgentId
- Specified by:
getToken
in interface cz.cuni.amis.utils.token.IToken
- Returns:
- token
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.