Learn R Programming

ABM (version 0.4.1)

getID: Get the ID of the agent.

Description

Get the ID of the agent.

Value

an integer value

Arguments

agent

an external pointer returned by newAgent

Details

Before an agent is added to a population, its id is 0. After it is added, its id is the index in the population (starting from 1).

If agent is an R6 object, then we should either use agent$id, or use getID(agent$get)