Expand description
Ring Topology for Trajectory Memory
Provides a circular structure for organizing episodes in a trajectory. Inspired by RCP (Ring Contextual Propagation) which uses ring topology for multi-scale context organization.
§Key Properties
- Circular ordering: Enables wraparound attention
- O(1) neighbor access: Adjacent elements in constant time
- Ring distance: Shortest path in either direction
- Cache-friendly: Contiguous storage in Vec
§Usage
use rag_plusplus_core::trajectory::Ring;
let ring = Ring::new(vec![1, 2, 3, 4, 5]);
// Get neighbors
let neighbors: Vec<_> = ring.neighbors(0, 2).collect();
// Ring distance (shortest path)
let dist = ring.ring_distance(0, 3); // min(3, 2) = 2Structs§
- Dual
Ring - Dual Ring Structure for IRCP/RCP
- Dual
Ring Node - A node in a dual ring with both temporal position and influence weight.
- Ring
- A ring topology over a collection of elements.
- Ring
Node - A node in a ring with additional metadata.
Functions§
- build_
dual_ ring - Build a dual ring from episodes with temporal positions and influence scores.
- build_
dual_ ring_ with_ attention - Build a dual ring with full attention data.
- build_
weighted_ ring - Build a ring from a sequence of episodes with computed weights.
Type Aliases§
- Episode
Ring - Ring of episodes for multi-scale trajectory organization.