count_agent_cells: Count the number of owned cells of each agent

View source: R/landscape.R

count_agent_cellsR Documentation

Count the number of owned cells of each agent

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

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

## 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 June 16, 2022, 9:05 a.m.