quantized_density_fields/qdf/simulate.rs
1use state::*;
2
3/// Trait that tells QDF how to simulate states of space.
4pub trait Simulate<S>
5where
6 S: State,
7{
8 /// Performs simulation of state based on neighbor states.
9 ///
10 /// # Arguments
11 /// * `state` - current state.
12 /// * `neighbor_states` - current neighbor states.
13 fn simulate(state: &S, neighbor_states: &[&S]) -> S;
14}
15
16impl<S> Simulate<S> for ()
17where
18 S: State,
19{
20 fn simulate(state: &S, _: &[&S]) -> S {
21 state.clone()
22 }
23}