45template <
typename LatticeT,
typename CellT>
71 template <
typename PositionT>
72 bool update(
const PositionT& position)
74 const CellT cell =
m_lattice.cell_at(position);
123 size_t crossings = 0;
124 for (
size_t i = 0; i + 1 < window; ++i) {
125 if (!(view[i] == view[i + 1]))
150 std::vector<CellT> seen;
151 seen.reserve(window);
152 for (
size_t i = 0; i < window; ++i) {
154 for (
const auto& s : seen) {
161 seen.push_back(view[i]);
186 size_t best_count = 0;
187 for (
size_t i = 0; i < window; ++i) {
189 for (
size_t j = 0; j < window; ++j) {
190 if (view[j] == view[i])
193 if (
count > best_count) {
198 return { best, best_count };
const LatticeT & lattice() const
The lattice this trajectory observes positions through.
size_t crossings_in_window(size_t window) const
Crossings within the most recent window observations.
bool update(const PositionT &position)
Observe one new position, updating the cell sequence.
Memory::HistoryBuffer< CellT > m_history
SymbolicTrajectory(LatticeT lattice, size_t window=16)
Construct a trajectory over a given lattice.
const CellT & current_cell() const
Cell the most recent observation fell in.
size_t unique_cells_in_window(size_t window) const
Count of distinct cells visited within the most recent window observations.
size_t crossing_count() const
Total crossings observed since construction or reset()
std::pair< CellT, size_t > dominant_cell(size_t window) const
Cell with the most observations within the most recent window observations.
void reset()
Reset to uninitialized state.
Tracks a moving point's sequence of cells through a lattice partition over time.
std::span< T > linearized_view()
Get mutable linearized view of entire history.
void push(const T &value)
Push new value to front of history.
void reset()
Reset buffer to initial state (all zeros)
size_t capacity() const
Get buffer capacity.
History buffer for difference equations and recursive relations.