rustsim-core 0.0.1

Core ABM engine: agents, models, stores, schedulers, stepping, data collection
Documentation
//! Agent trait - the fundamental interface for all simulation entities.
use crate::types::AgentId;

/// The core trait that every agent type must implement.
///
/// An agent is any entity that participates in the simulation. The only
/// requirement is a unique identifier accessible via [`Agent::id`].
///
/// # Example
///
/// ```
/// use rustsim_core::prelude::*;
///
/// #[derive(Debug, Clone)]
/// struct Particle {
///     id: AgentId,
///     x: f64,
/// }
///
/// impl Agent for Particle {
///     fn id(&self) -> AgentId { self.id }
/// }
/// ```
pub trait Agent {
    /// Returns the unique identifier for this agent.
    fn id(&self) -> AgentId;
}