pub trait Agent {
// Required method
fn id(&self) -> AgentId;
}Expand description
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 }
}