MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT > Class Template Reference

Tracks a moving point's sequence of cells through a lattice partition over time. More...

#include <SymbolicTrajectory.hpp>

+ Collaboration diagram for MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT >:

Public Member Functions

size_t crossing_count () const
 Total crossings observed since construction or reset()
 
size_t crossings_in_window (size_t window) const
 Crossings within the most recent window observations.
 
const CellT & current_cell () const
 Cell the most recent observation fell in.
 
std::pair< CellT, size_t > dominant_cell (size_t window) const
 Cell with the most observations within the most recent window observations.
 
const LatticeT & lattice () const
 The lattice this trajectory observes positions through.
 
void reset ()
 Reset to uninitialized state.
 
 SymbolicTrajectory (LatticeT lattice, size_t window=16)
 Construct a trajectory over a given lattice.
 
size_t unique_cells_in_window (size_t window) const
 Count of distinct cells visited within the most recent window observations.
 
template<typename PositionT >
bool update (const PositionT &position)
 Observe one new position, updating the cell sequence.
 

Private Attributes

size_t m_crossing_count { 0 }
 
CellT m_current_cell {}
 
bool m_has_prior { false }
 
Memory::HistoryBuffer< CellT > m_history
 
LatticeT m_lattice
 

Detailed Description

template<typename LatticeT, typename CellT>
class MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT >

Tracks a moving point's sequence of cells through a lattice partition over time.

Named for symbolic dynamics: a continuous trajectory, observed through a partition of its space into discrete cells, becomes a sequence of symbols, one per cell occupied at each observation. This class is that observation process, holding the memory a single Lattice2D::cell_at() or Lattice3D::cell_at() call does not: which cell the point occupied last, how many times it has crossed a cell boundary, and a short window of recently visited cells for measuring the shape of that crossing sequence.

Distinct from SpatialIndex, which tracks the current positions of many entities for neighbor queries and has no notion of history, and from Lattice2D/Lattice3D themselves, which are pure static geometry with no notion of a point moving through them at all. SymbolicTrajectory adds no new geometry: cell containment is entirely LatticeT::cell_at(). It adds only memory of what cell_at() has returned over time for one moving point.

Template Parameters
LatticeTLattice2D or Lattice3D
CellTThe corresponding cell coordinate type: glm::uvec2 for Lattice2D, glm::uvec3 for Lattice3D. Not deduced automatically since LatticeT does not expose its own coordinate type as a nested alias; specify explicitly at the call site.
for (auto pos : incoming_positions) {
traj.update(pos);
}
size_t crossings = traj.crossing_count();
size_t distinct = traj.unique_cells_in_window(8);
Tracks a moving point's sequence of cells through a lattice partition over time.
static Lattice2D ndc_quadrants() noexcept
Quadrant lattice over NDC space, resolution {2, 2}.
Definition Lattice.hpp:211

Definition at line 46 of file SymbolicTrajectory.hpp.


The documentation for this class was generated from the following file: