RepastHPC  2.3.1
Public Types | Public Member Functions | Friends | List of all members
repast::AgentStatus Class Reference

Encapsulates the status (moved or removed) of agent in order to synchronize that status across processes. More...

#include <AgentStatus.h>

Public Types

enum  Status { REMOVED, MOVED }
 Enum indicating the status of th agent.
 

Public Member Functions

 AgentStatus ()
 No-arg constructor for serialization.
 
 AgentStatus (AgentId id)
 Creates an AgentStatus indicating the status for the specified agent. More...
 
 AgentStatus (AgentId old, AgentId newId)
 Creates an AgentStatus indicating the status for the specified agent and the new id of that agent as result from the change in status. More...
 
Status getStatus () const
 Gets the status. More...
 
const AgentIdgetId () const
 Gets the id of the agent that this is the status for. More...
 
const AgentIdgetOldId () const
 Gets the old id of the agent that this is the status for, if this contains an old and updated AgentId. More...
 
const AgentIdgetNewId () const
 Gets the new updated id of the agent that this is the status for, if this contains an old and updated AgentId. More...
 

Friends

class boost::serialization::access
 
bool operator< (const AgentStatus &one, const AgentStatus &two)
 Comparison operator that can be used in sorts, etc.
 

Detailed Description

Encapsulates the status (moved or removed) of agent in order to synchronize that status across processes.

Constructor & Destructor Documentation

◆ AgentStatus() [1/2]

repast::AgentStatus::AgentStatus ( AgentId  id)

Creates an AgentStatus indicating the status for the specified agent.

Parameters
idthe id of the agent whose status this represents

◆ AgentStatus() [2/2]

repast::AgentStatus::AgentStatus ( AgentId  old,
AgentId  newId 
)

Creates an AgentStatus indicating the status for the specified agent and the new id of that agent as result from the change in status.

When an agent moves between processes its current rank may change and thus the current rank part of its id will change.

Parameters
oldthe id of the agent whose status this represents
newIdthe new id of the agent that results from its status change

Member Function Documentation

◆ getId()

const AgentId& repast::AgentStatus::getId ( ) const
inline

Gets the id of the agent that this is the status for.

Returns
the id of the agent that this is the status for.

◆ getNewId()

const AgentId& repast::AgentStatus::getNewId ( ) const
inline

Gets the new updated id of the agent that this is the status for, if this contains an old and updated AgentId.

Returns
Gets the new id of the agent that this is the status for, if this contains an old and updated AgentId.

◆ getOldId()

const AgentId& repast::AgentStatus::getOldId ( ) const
inline

Gets the old id of the agent that this is the status for, if this contains an old and updated AgentId.

Returns
Gets the old id of the agent that this is the status for, if this contains an old and updated AgentId.

◆ getStatus()

Status repast::AgentStatus::getStatus ( ) const
inline

Gets the status.

Returns
the status

The documentation for this class was generated from the following files: