Struct AgentID#

Struct Documentation#

struct AgentID#

The unique identifier for each Agent instance.

It is formed by combining the global index of the Place instance the Agent instance is spawned on and the number of Agent instances already spawned there. For the latter, it is maintained by each Place instances with the SPAWNED_AGENTS pre-defined attribute, which will be increased by 1 every time a new Agent instance is spawned there

Public Functions

__universal__ __forceinline__ inline AgentID(const Index bornPlaceGlobalIndex, const Index32 bornIndex)#
__universal__ __forceinline__ inline Index bornPlaceGlobalIndex() const#

Retrieve the global index of the Place instance this Agent instance is spawned on, which is the first 8 bytes of the raw storage

__universal__ __forceinline__ inline Index32 bornIndex() const#

Retrieve the number of Agent instances already spawned on the source Place instance when this Agent instance is spawned, which is the last 4 bytes of the raw storage

__universal__ __forceinline__ inline bool operator==(const AgentID &other) const#
__universal__ __forceinline__ inline bool operator<(const AgentID &other) const#
__universal__ __forceinline__ inline bool operator!=(const AgentID &other) const#
__universal__ __forceinline__ inline bool operator>(const AgentID &other) const#
__universal__ __forceinline__ inline bool operator<=(const AgentID &other) const#
__universal__ __forceinline__ inline bool operator>=(const AgentID &other) const#

Public Members

uint3 idStorage#

Raw storage of the ID, where the first 8 bytes is the global index of the Place instance it spawned on and the last 4 bytes is the number of Agent instances already spawned there.

Friends

inline friend std::ostream &operator<<(std::ostream &os, const AgentID &agentID)#