Skip to contents

This function uses the current state of the environment to determine the values of a whole range of variables that are used within the utility functions.

This function uses the current state of the environment to determine the values of a whole range of variables that are used within the utility functions.

Usage

# S4 method for class 'agent'
compute_utility_variables(
  object,
  state,
  background,
  agent_specifications,
  centers,
  check,
  cpp = TRUE
)

# S4 method for class 'data.frame'
compute_utility_variables(object, background)

Arguments

object

Object of the agent-class.

state

Object of the state-class.

background

Object of the background-class.

agent_specifications

List created by the create_agent_specifications function. Contains all information of all agents within the current state and allows for the communication between the predped simulation functions and the m4ma utility functions.

centers

Numerical matrix containing the coordinates at each position the object can be moved to. Should have one row for each cell.

check

Logical matrix of dimensions 11 x 3 denoting whether an agent can move to a given cell (TRUE) or not (FALSE).

cpp

Logical denoting whether to use the Rcpp alternative (TRUE) or the R alternative of this function (FALSE). Defaults to TRUE.

Value

Data.frame containing all of the needed variables to be able to compute the values of the utility functions.

Data.frame containing all of the needed variables to be able to compute the values of the utility functions.

See also

simulate, simulate.state, update-agent, update, update_position, update

simulate, simulate.state, update-agent, update, update_position, update