How code-aarush/kestral works
KESTREL is a C++ spatial-indexing and hazard-assessment simulation with a decoupled Canvas viewer. The primary workflow runs seeded entity motion, maintains the entity store and dynamic R-tree, then answers mission region, proximity, and corridor queries. A separate exporter serializes simulation, index, and query state for the frontend to render. The graph follows the README and shown entry points; some internal calls are documented only at subsystem level, so unsampled implementation details are not expanded.
Main entry points: export.cpp State Exporter · mission.cpp Mission Queries · simulator.cpp Kepler Simulator · rtree.cpp Dynamic R-Tree
Components 11
Simulation & State
- Demo Entry
src/main.cpp - Kepler Simulator
src/simulator.cpp - Entity Store
src/entity_store.cpp - Entity Model
src/entity.h
Spatial Index
- Dynamic R-Tree
src/rtree.cpp - R-Tree Nodes
src/rtree_node.cpp - Geometry Operations
src/geometry.cpp
Hazard Assessment
- Mission Queries
src/mission.cpp
Export & Visualization
- State Exporter
src/export.cpp - Mission Control Canvas
frontend/app.js
Other components
- Demo Operator
Connections 17
- Demo Operator → Demo Entry: starts
README.md - Demo Entry → Kepler Simulator: steps
src/main.cpp - Demo Entry → Mission Queries: runs queries
src/main.cpp - Kepler Simulator → Entity Store: updates entities
README.md - Kepler Simulator → Dynamic R-Tree: updates index
README.md - Entity Store → Entity Model: stores
- Dynamic R-Tree → R-Tree Nodes: manages nodes
- R-Tree Nodes → Geometry Operations: uses bounds
- Mission Queries → Dynamic R-Tree: retrieves candidates
README.md - Mission Queries → Geometry Operations: checks candidates
README.md - Mission Queries → Entity Store: reads entities
- State Exporter → Kepler Simulator: runs steps
src/export.cpp - State Exporter → Mission Queries: queries region
src/export.cpp - State Exporter → Dynamic R-Tree: exports index
src/export.cpp - Demo Operator → State Exporter: requests state
README.md - State Exporter → Mission Control Canvas: provides JSON
README.md - Mission Control Canvas → Demo Operator: renders results
frontend/app.js