rustsim_spaces/
nothing.rs1use rustsim_core::interaction::{PositionedAgent, SpaceInteraction};
10use rustsim_core::space::Space;
11
12#[derive(Debug, Default, Clone, Copy)]
17pub struct NothingSpace;
18
19impl Space for NothingSpace {}
20
21impl<A> SpaceInteraction<A> for NothingSpace
22where
23 A: PositionedAgent<Position = ()>,
24{
25 type Error = std::convert::Infallible;
26
27 fn random_position<R: rand::RngCore>(&self, _rng: &mut R) -> A::Position {}
28
29 fn add_agent(&mut self, _agent: &A) -> Result<(), Self::Error> {
30 Ok(())
31 }
32
33 fn remove_agent(&mut self, _agent: &A) -> Result<(), Self::Error> {
34 Ok(())
35 }
36
37 fn nearby_ids(
38 &self,
39 _position: &A::Position,
40 _radius: usize,
41 ) -> Vec<rustsim_core::types::AgentId> {
42 Vec::new()
43 }
44}