RepastHPC
2.3.1
|
Agent identity information. More...
#include <AgentId.h>
Public Member Functions | |
AgentId () | |
No-arg constructor necessary for serialization. | |
AgentId (int id, int startProc, int agentType, int currentProc=-1) | |
Creates an AgentId. More... | |
int | id () const |
Gets the id component of this AgentId. More... | |
int | startingRank () const |
Gets the starting rank component of this AgentId. More... | |
int | agentType () const |
Gets the agent type component of this AgentId. More... | |
int | currentRank () const |
Gets the current process rank of this AgentId. More... | |
void | currentRank (int val) |
Sets the current process rank of this AgentId. More... | |
std::size_t | hashcode () const |
Gets the hashcode for this AgentId. More... | |
Friends | |
class | boost::serialization::access |
std::ostream & | operator<< (std::ostream &os, const AgentId &id) |
Writes the agent id to the ostream. | |
bool | operator== (const AgentId &one, const AgentId &two) |
Equality operator. | |
bool | operator< (const AgentId &one, const AgentId &two) |
A comparison operator for use with std::set. | |
Agent identity information.
An Agent ID consists of four values: 1) a numerical identifier; 2) the process on which the agent was created; 3) a numerical identifier that indicates the agent's type (in simulation semantic terms, not a software object type); and 4) the process on which the agent is a local agent. Each agent should be uniquely identified by an AgentId using the first three of the four values, which should be immutable. The fourth value can change throughout the simulation.
repast::AgentId::AgentId | ( | int | id, |
int | startProc, | ||
int | agentType, | ||
int | currentProc = -1 |
||
) |
Creates an AgentId.
The combination of the first three parameters should uniquely identify the agent.
id | the agent's id |
startProc | the rank of the agent's starting process |
agentType | the agent's type (user defined) |
currentProc | the rank where the agent is a local agent |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |