Compute the distance of a given agent to the group centroid. This group
centroid is computed as a summary statistic of the predicted x- and y-
coordinates of all pedestrians belonging to the same group as the agent. The
summary statistic of choice should be one of mean-tendency, but can be
specified by the user through the argument fx.
Arguments
- predictions
Numeric matrix with shape N x 2 containing predicted positions of all pedestrians that belong to the social group of the agent.
- centers
Numerical matrix containing the coordinates at each position the object can be moved to. Should have one row for each cell.
- number_agents
Integer indicating number of people in the pedestrian's social group.
- fx
Function used to find the group centroid. Defaults to
mean
Value
Numeric vector containing the distance from each cell in the `center`
to the group centroid. If not other agents belong to the same group as the
agent, returns NULL.
See also
gc_utility,
utility-agent