trajectory_table: Compile trajectory records into a data frame

View source: R/trajectory_table.R

trajectory_tableR Documentation

Compile trajectory records into a data frame

Description

Takes the list of trajectory records from an engine run and returns a tidy data frame with one row per emitted leaf decision record. For grouped rows, grouped_decision_point_id and group_activation_id identify the shared consultation; they do not assert that a selected action later realized. Arbitrary decision_plan_metadata remains on raw records only.

Usage

trajectory_table(records, vars = NULL)

Arguments

records

List of trajectory records (from engine$run(...)$trajectory_records).

vars

Character vector of state variable names to extract from state_before and state_after. If NULL (default), all variables in state_before are included.

Value

A data.frame with columns: run_id, entity_id, t, decision_point_id, grouped_decision_point_id, group_activation_id, trigger_event, selected_action, condition_met, plus ⁠<var>_before⁠ and ⁠<var>_after⁠ for each requested variable. Grouped ids are NA for ordinary or legacy records. Opaque decision-plan metadata remains available only in raw trajectory records.


fluxCore documentation built on Sept. 22, 2026, 5:07 p.m.