pub trait PositionedAgent: Agent {
type Position: Clone;
// Required methods
fn position(&self) -> &Self::Position;
fn set_position(&mut self, position: Self::Position);
}Expand description
Extension trait for agents that have a spatial position.
Implement this for agent types used with spatial models (grids, continuous spaces, graphs, etc.). The position type is determined by the space.
Required Associated Types§
Required Methods§
Sourcefn set_position(&mut self, position: Self::Position)
fn set_position(&mut self, position: Self::Position)
Update the agent’s position.