Trajectory#

class hybrid_aif.composition.Trajectory[source]#

Bases: NamedTuple

What run() recorded: a tree with one node per component of the System.

The root holds params; every node holds its parts (its components, by their name relative to the node) and the records below, each a mapping keyed by name relative to the node, a non-leaf node’s mappings being the prefixed union of its parts’. The records are stacked over rounds: received, present and carries have ticks + 1 entries, emitted, intended and decided have ticks.

trajectory["agent.rover"] walks the tree by dotted path; a name that is no node is refused, naming the nodes. A node that is planned jointly is a leaf of the tree.

params: SystemParams | None#

The parameter home after the last round (held at the root).

parts: dict[str, Trajectory]#

The node’s components, each a Trajectory, keyed by name relative to the node.

received: dict[str, Array]#

The value each modality slot, and each control node a variable drives, held for its step, ticks + 1 entries: entry t is what the step was handed at round t, the last what the slots hold after the last round. An absent value is zeros. On a round the node did not step (see decided) it holds what the node’s in-ports held.

present: dict[str, Array]#

Whether each entry of received held a value, ticks + 1 entries.

emitted: dict[str, Array]#

The realised value of each action node and emission of the node, ticks entries. On a round the node did not step it holds the node’s standing values.

intended: dict[str, Array]#

Each action node as its step chose it, ticks entries: equal to emitted where no kernel in params.actuator moved the draw. On a round the node did not step it holds the node’s held action.

start: dict[str, Array]#

The out-ports that held a value entering round 0, as the reset call left them.

carries: Any#

A stepped node’s carry after each round (ticks + 1 entries, the first after the reset call) when record_carries asked for them, else None. For a node that is not itself stepped, a mapping from each stepped node beneath it, by relative name. Each entry is the object the step returned, kept as it is and not copied, so a step whose carries are recorded returns a new carry each round rather than mutating the one it was handed.

carry: Any#

A stepped node’s carry after the last round; for a node that is not itself stepped, a mapping from each stepped node beneath it, by relative name.

decided: Any#

A bool per round, whether the node stepped: False on a round that a node declaring durations spent inside its option, True every round of any other node.

static __new__(
_cls,
params,
parts,
received,
present,
emitted,
intended,
start,
carries,
carry,
decided,
)#

Create new instance of Trajectory(params, parts, received, present, emitted, intended, start, carries, carry, decided)