count_agent_cells: Count the number of owned cells of each agent

Description Usage Arguments Value Examples

View source: R/landscape.R

Description

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.

Usage

1
count_agent_cells(AGENTS, LAND = NULL, tot = 14, own = 3, ID = 1)

Arguments

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

Value

The AGENTS array with the column of total cell count filled in.

Examples

1
2
3
4
5
6
7
## 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)

GMSE documentation built on Aug. 2, 2021, 5:07 p.m.