Skip to contents

Apply each measurement function to every agent and return one tidy row per agent-by-measure, stamped with the society's current step. A measure that errors yields NA for that agent rather than aborting the sweep. With no measures, the default is each agent's utterance count in the shared history ("n_utterances").

Usage

collect_measures(society, measures = NULL)

Arguments

society

A society().

measures

Optional named list of function(agent) -> value; defaults to the society's own measures.

Value

A tibble with columns agent_id, name, measure, value, and step, carrying attribute uncalibrated = TRUE.

Details

The result always carries attr(out, "uncalibrated") <- TRUE. These are model outputs, not measurements of people: the attribute is the structural reminder that any quantity here is conditioned on the models and the prompts, not validated against human data.

Examples

if (FALSE) { # \dontrun{
collect_measures(soc, measures = list(
  words = function(a) nchar(a$persona %||% "")))
} # }