count_agent_cells | R Documentation |
Counts the total number of cells on a landscape owned by each agent and inserts that total number into a column of the agents array.
count_agent_cells(AGENTS, LAND = NULL, tot = 14, own = 3, ID = 1)
AGENTS |
The agents array holding agents' information |
LAND |
The landscape on which some cells are owned |
tot |
Column in which the total number of owned cells in AGENTS is added |
own |
Layer of the landscape array where ownership information is held |
ID |
Column in which the ID of an agent is held in the AGENTS array |
The AGENTS array with the column of total cell count filled in.
## Not run: agents <- make_agents(agent_number = 3, type_counts = c(1, 2)) land <- make_landscape(rows = 10, cols = 10, model = "IBM", ownership = 2:3) new_agents <- count_agent_cells(AGENTS = agents, LAND = land); ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.