Skip to main content

Crate persistence_agent

Crate persistence_agent 

Source
Expand description

§persistence-agent

Persistent homology for agent behavior profiling — topological fingerprints.

This crate computes persistent homology from point clouds representing agent state trajectories and maps topological invariants to behavior archetypes.

§Quick Start

use persistence_agent::agent_features::AgentProfiler;

// Agent observations over time (e.g. 2D state vectors)
let obs = vec![
    vec![0.0, 0.0],
    vec![0.1, 0.0],
    vec![0.0, 0.1],
    vec![1.0, 1.0],
    vec![1.1, 1.0],
];

let profiler = AgentProfiler::new(1);
let profile = profiler.profile(obs).unwrap();
println!("Archetype: {}", profile.archetype);
println!("Entropy:   {:.3}", profile.persistence_entropy);

§Pipeline

  1. PointCloud — embed observations, compute distances
  2. VietorisRipsComplex — build filtration from pairwise distances
  3. BoundaryMatrix — mod-2 boundary matrix + column reduction
  4. Barcode — extract persistence pairs and Betti curves
  5. AgentProfiler — classify behavior into archetypes

§Archetypes

ArchetypeTopological Signature
SteadySingle persistent cluster (β₀ = 1)
ExplorerMany short-lived loops
VolatileMany disconnected components
DeepLong-lived higher-dimensional features
BalancedMixed features, no dominant signature

Re-exports§

pub use agent_features::AgentArchetype;
pub use agent_features::AgentProfile;
pub use agent_features::AgentProfiler;
pub use barcode::Barcode;
pub use barcode::PersistencePair;
pub use boundary::BoundaryMatrix;
pub use error::PersistenceError;
pub use point_cloud::PointCloud;
pub use vietoris_rips::VietorisRipsComplex;

Modules§

agent_features
barcode
boundary
error
point_cloud
vietoris_rips