Skip to main content

two_phase_spatial_2d

Function two_phase_spatial_2d 

Source
pub fn two_phase_spatial_2d<A, S, M, FOut, FIn>(
    store: &S,
    ids: &[AgentId],
    messages: &mut SpatialMessages2D<M>,
    output_fn: FOut,
    input_fn: FIn,
) -> TwoPhaseResult
where A: Agent, M: Clone, S: AgentStore<A>, FOut: FnMut(&A, &mut SpatialMessages2D<M>), FIn: FnMut(&mut A, &SpatialMessages2D<M>),
Expand description

Execute a two-phase step using 2D spatial messaging.

  • output_fn: called once per agent; should push messages with positions.
  • input_fn: called once per agent after the spatial index is built. Receives the agent and the spatial message list for neighbor queries.