Trajectory#
- class hybrid_aif.composition.Trajectory[source]#
Bases:
NamedTupleWhat
run()recorded: a tree with one node per component of the System.The root holds
params; every node holds itsparts(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,presentandcarrieshaveticks + 1entries,emitted,intendedanddecidedhaveticks.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 + 1entries: entrytis what the step was handed at roundt, the last what the slots hold after the last round. An absent value is zeros. On a round the node did not step (seedecided) it holds what the node’s in-ports held.
- emitted: dict[str, Array]#
The realised value of each action node and emission of the node,
ticksentries. 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,
ticksentries: equal toemittedwhere no kernel inparams.actuatormoved 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 + 1entries, the first after the reset call) whenrecord_carriesasked for them, elseNone. 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:
Falseon a round that a node declaring durations spent inside its option,Trueevery 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)