Description Format Construction Fields Methods
Agent class is the generic class for creating urban actors such as Individual, Household, firms, Building and more.
R6::R6Class object inheriting from Entity.
1 |
data
::data.table::data.table()
Contain the attributes of agents. One of the attributes must be a unique id field.
get_latest_agent_id(ids)
(integer()
) -> integer()
Return the id of the last agent that was created.
get_new_agent_ids()
() -> integer()
Return the ids of new agents.
is_alive(ids)
(integer()
) -> logical()
Check if the agents with id in ids
are still alive/active in its data object.
or not.
generate_new_ids(n)
(integer(1)
) -> integer()
Generates n
number of new ids.
hatch(ids)
(integer()
)
Clone existing agents in ids
and inherit all attributes from their parents
except for the id attribute.
add(.data)
Add new agents in .data
to the existing pool of agents. It should be noted,
that all new agents must have all the columns that the existing agents possess
with exception of derived variables which should be denoted by a .
prefix.
For example, .past_partner_id
is a derived variable which is allowed to be
missing in the new agents' data.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.