use std::ops::Add; use rand::Rng; use serde::Serialize; pub mod walker; pub mod grid; pub mod model; pub mod nd; mod hexagonal; pub trait GriddedPosition: Add + Serialize + Clone { const NEIGHBOURS: u32; fn zero() -> Self; fn spawn(rng: &mut R, radius: f32) -> Self; fn abs(&self) -> f32; fn neighbour(&self, neighbour_index: u32) -> Self; fn linear_index(&self, grid_size: u32) -> usize; } pub trait Storage { fn at(&self, position: &P) -> bool; fn deposit(&mut self, position: &P); }