Struct sim::mechanics::walking::WalkingSimState[][src]

pub(crate) struct WalkingSimState {
    peds: FixedMap<PedestrianID, Pedestrian>,
    peds_per_traversable: MultiMap<Traversable, PedestrianID>,
    events: Vec<Event>,
}

Simulates pedestrians. Unlike vehicles, pedestrians can move bidirectionally on sidewalks and just "ghost" through each other. There's no queueing or slowdown when many people are overlapping. They're simply grouped together into a DrawPedCrowdInput for rendering.

Fields

peds: FixedMap<PedestrianID, Pedestrian>peds_per_traversable: MultiMap<Traversable, PedestrianID>events: Vec<Event>

Implementations

impl WalkingSimState[src]

pub fn new() -> WalkingSimState[src]

pub fn spawn_ped(
    &mut self,
    now: Time,
    params: CreatePedestrian,
    map: &Map,
    scheduler: &mut Scheduler
)
[src]

pub fn get_draw_ped(
    &self,
    id: PedestrianID,
    now: Time,
    map: &Map
) -> Option<DrawPedestrianInput>
[src]

pub fn get_all_draw_peds(
    &self,
    now: Time,
    map: &Map
) -> Vec<DrawPedestrianInput>
[src]

pub fn update_ped(
    &mut self,
    id: PedestrianID,
    now: Time,
    ctx: &mut Ctx<'_>,
    trips: &mut TripManager,
    transit: &mut TransitSimState
)
[src]

pub fn ped_boarded_bus(&mut self, now: Time, id: PedestrianID)[src]

pub fn delete_ped(&mut self, id: PedestrianID, ctx: &mut Ctx<'_>)[src]

Abruptly remove a pedestrian from the simulation. They may be in any arbitrary state, like in the middle of a turn.

pub fn debug_ped(&self, id: PedestrianID)[src]

pub fn agent_properties(
    &self,
    map: &Map,
    id: PedestrianID,
    now: Time
) -> AgentProperties
[src]

pub fn trace_route(
    &self,
    now: Time,
    id: PedestrianID,
    map: &Map
) -> Option<PolyLine>
[src]

pub fn get_path(&self, id: PedestrianID) -> Option<&Path>[src]

pub fn get_unzoomed_agents(&self, now: Time, map: &Map) -> Vec<UnzoomedAgent>[src]

pub fn get_draw_peds_on(
    &self,
    now: Time,
    on: Traversable,
    map: &Map
) -> (Vec<DrawPedestrianInput>, Vec<DrawPedCrowdInput>)
[src]

pub fn collect_events(&mut self) -> Vec<Event>[src]

pub fn find_trips_to_parking(
    &self,
    evicted_cars: Vec<ParkedCar>
) -> Vec<(AgentID, TripID)>
[src]

pub fn all_waiting_people(
    &self,
    now: Time,
    delays: &mut BTreeMap<PersonID, Duration>
)
[src]

pub fn populate_commuter_counts(&self, cnts: &mut CommutersVehiclesCounts)[src]

Trait Implementations

impl Clone for WalkingSimState[src]

impl<'de> Deserialize<'de> for WalkingSimState[src]

impl Serialize for WalkingSimState[src]

Auto Trait Implementations

impl RefUnwindSafe for WalkingSimState[src]

impl Send for WalkingSimState[src]

impl Sync for WalkingSimState[src]

impl Unpin for WalkingSimState[src]

impl UnwindSafe for WalkingSimState[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,