[][src]Struct sim::Sim

pub struct Sim {
    driving: DrivingSimState,
    parking: ParkingSimState,
    walking: WalkingSimState,
    intersections: IntersectionSimState,
    transit: TransitSimState,
    cap: CapSimState,
    trips: TripManager,
    pandemic: Option<PandemicModel>,
    scheduler: Scheduler,
    time: Time,
    pub(crate) map_name: String,
    pub(crate) edits_name: String,
    run_name: String,
    step_count: usize,
    analytics: Analytics,
    alerts: AlertHandler,
}

Fields

driving: DrivingSimStateparking: ParkingSimStatewalking: WalkingSimStateintersections: IntersectionSimStatetransit: TransitSimStatecap: CapSimStatetrips: TripManagerpandemic: Option<PandemicModel>scheduler: Schedulertime: Timemap_name: Stringedits_name: Stringrun_name: Stringstep_count: usizeanalytics: Analyticsalerts: AlertHandler

Implementations

impl Sim[src]

pub fn new(map: &Map, opts: SimOptions, timer: &mut Timer) -> Sim[src]

pub fn make_spawner(&self) -> TripSpawner[src]

pub fn flush_spawner(
    &mut self,
    spawner: TripSpawner,
    map: &Map,
    timer: &mut Timer
)
[src]

pub fn get_free_onstreet_spots(&self, l: LaneID) -> Vec<ParkingSpot>[src]

pub fn get_free_offstreet_spots(&self, b: BuildingID) -> Vec<ParkingSpot>[src]

pub fn get_free_lot_spots(&self, pl: ParkingLotID) -> Vec<ParkingSpot>[src]

pub fn get_all_parking_spots(&self) -> (Vec<ParkingSpot>, Vec<ParkingSpot>)[src]

pub fn walking_path_to_nearest_parking_spot(
    &self,
    map: &Map,
    b: BuildingID
) -> Option<(Path, Distance)>
[src]

pub(crate) fn new_person(
    &mut self,
    p: PersonID,
    orig_id: Option<OrigPersonID>,
    ped_speed: Speed,
    vehicle_specs: Vec<VehicleSpec>
)
[src]

pub fn random_person(
    &mut self,
    ped_speed: Speed,
    vehicle_specs: Vec<VehicleSpec>
) -> &Person
[src]

pub(crate) fn seed_parked_car(&mut self, vehicle: Vehicle, spot: ParkingSpot)[src]

pub(crate) fn seed_bus_route(&mut self, route: &BusRoute)[src]

fn start_bus(&mut self, route: &BusRoute, map: &Map)[src]

pub fn set_name(&mut self, name: String)[src]

impl Sim[src]

fn minimal_step(
    &mut self,
    map: &Map,
    max_dt: Duration,
    maybe_cb: &mut Option<Box<dyn SimCallback>>
) -> bool
[src]

fn do_step(
    &mut self,
    map: &Map,
    time: Time,
    cmd: Command,
    maybe_cb: &mut Option<Box<dyn SimCallback>>
) -> bool
[src]

fn dispatch_events(&mut self, events: Vec<Event>, map: &Map)[src]

pub fn timed_step(
    &mut self,
    map: &Map,
    dt: Duration,
    maybe_cb: &mut Option<Box<dyn SimCallback>>,
    timer: &mut Timer
)
[src]

pub fn tiny_step(
    &mut self,
    map: &Map,
    maybe_cb: &mut Option<Box<dyn SimCallback>>
)
[src]

pub fn time_limited_step(
    &mut self,
    map: &Map,
    dt: Duration,
    real_time_limit: Duration,
    maybe_cb: &mut Option<Box<dyn SimCallback>>
)
[src]

pub fn dump_before_abort(&self)[src]

impl Sim[src]

pub fn run_until_done<F: Fn(&mut Sim, &Map)>(
    &mut self,
    map: &Map,
    callback: F,
    time_limit: Option<Duration>
)
[src]

impl Sim[src]

pub fn save_dir(&self) -> String[src]

fn save_path(&self, base_time: Time) -> String[src]

pub fn save(&mut self) -> String[src]

pub fn find_previous_savestate(&self, base_time: Time) -> Option<String>[src]

pub fn find_next_savestate(&self, base_time: Time) -> Option<String>[src]

pub fn load_savestate(
    path: String,
    map: &Map,
    timer: &mut Timer
) -> Result<Sim, Error>
[src]

pub fn restore_paths(&mut self, map: &Map, timer: &mut Timer)[src]

pub fn handle_live_edited_traffic_signals(&mut self, map: &Map)[src]

impl Sim[src]

pub fn time(&self) -> Time[src]

pub fn is_done(&self) -> bool[src]

pub fn is_empty(&self) -> bool[src]

pub fn num_trips(&self) -> (usize, usize)[src]

pub fn num_agents(&self) -> Counter<AgentType>[src]

pub fn num_ppl(&self) -> (usize, usize, usize)[src]

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

pub fn debug_car(&self, id: CarID)[src]

pub fn debug_intersection(&self, id: IntersectionID, map: &Map)[src]

pub fn debug_lane(&self, id: LaneID)[src]

pub fn agent_properties(&self, id: AgentID) -> AgentProperties[src]

pub fn num_transit_passengers(&self, car: CarID) -> usize[src]

pub fn bus_route_id(&self, maybe_bus: CarID) -> Option<BusRouteID>[src]

pub fn active_agents(&self) -> Vec<AgentID>[src]

pub fn agent_to_trip(&self, id: AgentID) -> Option<TripID>[src]

pub fn trip_to_agent(&self, id: TripID) -> TripResult<AgentID>[src]

pub fn trip_info(&self, id: TripID) -> TripInfo[src]

pub fn all_trip_info(&self) -> Vec<(TripID, TripInfo)>[src]

pub fn finished_trip_time(&self, id: TripID) -> Option<(Duration, Duration)>[src]

pub fn trip_to_person(&self, id: TripID) -> PersonID[src]

pub fn agent_to_person(&self, id: AgentID) -> Option<PersonID>[src]

pub fn get_owner_of_car(&self, id: CarID) -> Option<PersonID>[src]

pub fn lookup_parked_car(&self, id: CarID) -> Option<&ParkedCar>[src]

pub fn lookup_person(&self, id: PersonID) -> Option<&Person>[src]

pub fn get_person(&self, id: PersonID) -> &Person[src]

pub fn find_person_by_orig_id(&self, id: OrigPersonID) -> Option<PersonID>[src]

pub fn get_all_people(&self) -> &Vec<Person>[src]

pub fn lookup_car_id(&self, idx: usize) -> Option<CarID>[src]

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

pub fn get_all_driving_paths(&self) -> Vec<&Path>[src]

pub fn trace_route(
    &self,
    id: AgentID,
    map: &Map,
    dist_ahead: Option<Distance>
) -> Option<PolyLine>
[src]

pub fn get_canonical_pt_per_trip(
    &self,
    trip: TripID,
    map: &Map
) -> TripResult<Pt2D>
[src]

pub fn get_canonical_pt_per_person(
    &self,
    p: PersonID,
    map: &Map
) -> Option<Pt2D>
[src]

pub fn canonical_pt_for_agent(&self, id: AgentID, map: &Map) -> Option<Pt2D>[src]

pub fn get_accepted_agents(&self, id: IntersectionID) -> HashSet<AgentID>[src]

pub fn get_blocked_by(&self, a: AgentID) -> HashSet<AgentID>[src]

pub fn status_of_buses(
    &self,
    route: BusRouteID,
    map: &Map
) -> Vec<(CarID, Option<usize>, f64, Pt2D)>
[src]

pub fn get_analytics(&self) -> &Analytics[src]

pub fn find_blockage_front(&self, car: CarID, map: &Map) -> String[src]

pub fn delayed_intersections(
    &self,
    threshold: Duration
) -> Vec<(IntersectionID, Time)>
[src]

pub fn bldg_to_people(&self, b: BuildingID) -> Vec<PersonID>[src]

pub fn worst_delay(
    &self,
    map: &Map
) -> (BTreeMap<RoadID, Duration>, BTreeMap<IntersectionID, Duration>)
[src]

pub fn get_pandemic_model(&self) -> Option<&PandemicModel>[src]

pub fn get_end_of_day(&self) -> Time[src]

pub fn current_stage_and_remaining_time(
    &self,
    i: IntersectionID
) -> (usize, Duration)
[src]

pub fn all_arrivals_at_border(
    &self,
    i: IntersectionID
) -> Vec<(AgentType, Vec<(Time, usize)>)>
[src]

pub fn target_lane_penalty(&self, lane: &Lane) -> (usize, usize)[src]

pub fn get_people_waiting_at_stop(
    &self,
    at: BusStopID
) -> &Vec<(PedestrianID, BusRouteID, Option<BusStopID>, Time)>
[src]

pub fn generate_scenario(&self, map: &Map, name: String) -> Scenario[src]

pub fn get_cap_counter(&self, l: LaneID) -> usize[src]

impl Sim[src]

pub fn kill_stuck_car(&mut self, id: CarID, map: &Map)[src]

pub fn clear_alerts(&mut self) -> Vec<(Time, AlertLocation, String)>[src]

impl Sim[src]

pub fn set_periodic_callback(&mut self, frequency: Duration)[src]

pub fn unset_periodic_callback(&mut self)[src]

Trait Implementations

impl Clone for Sim[src]

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

impl GetDrawAgents for Sim[src]

impl Serialize for Sim[src]

Auto Trait Implementations

impl RefUnwindSafe for Sim

impl Send for Sim

impl Sync for Sim

impl Unpin for Sim

impl UnwindSafe for Sim

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, U> Into<U> for T where
    U: From<T>, 
[src]

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>,