Skip to main content

PedestrianModel

Trait PedestrianModel 

Source
pub trait PedestrianModel {
    type Params;

    // Required methods
    fn name(&self) -> &'static str;
    fn step(
        &self,
        peds: &mut [Pedestrian],
        walls: &[WallSegment],
        params: &Self::Params,
        dt: f64,
    );
}
Expand description

Common contract for every pedestrian locomotion model in this crate.

Implementations advance a slice of Pedestrian in place by one timestep of dt seconds, considering static WallSegment obstacles and a model-specific parameter bundle.

All trait objects are safe; every concrete Params is Clone + Debug.

Required Associated Types§

Source

type Params

Model-specific parameter bundle (typically with a calibrated Default).

Required Methods§

Source

fn name(&self) -> &'static str

Short human-readable name, e.g. "Social Force".

Source

fn step( &self, peds: &mut [Pedestrian], walls: &[WallSegment], params: &Self::Params, dt: f64, )

Advance every pedestrian in peds by dt seconds.

walls is a slice of static obstacles; pass an empty slice if none.

Implementors§