[][src]Struct sim::mechanics::parking::ParkingSimState

pub struct ParkingSimState {
    parked_cars: BTreeMap<CarID, ParkedCar>,
    occupants: BTreeMap<ParkingSpot, CarID>,
    reserved_spots: BTreeSet<ParkingSpot>,
    onstreet_lanes: BTreeMap<LaneID, ParkingLane>,
    driving_to_parking_lanes: MultiMap<LaneID, LaneID>,
    num_spots_per_offstreet: BTreeMap<BuildingID, usize>,
    driving_to_offstreet: MultiMap<LaneID, (BuildingID, Distance)>,
    num_spots_per_lot: BTreeMap<ParkingLotID, usize>,
    driving_to_lots: MultiMap<LaneID, ParkingLotID>,
    events: Vec<Event>,
}

Fields

parked_cars: BTreeMap<CarID, ParkedCar>occupants: BTreeMap<ParkingSpot, CarID>reserved_spots: BTreeSet<ParkingSpot>onstreet_lanes: BTreeMap<LaneID, ParkingLane>driving_to_parking_lanes: MultiMap<LaneID, LaneID>num_spots_per_offstreet: BTreeMap<BuildingID, usize>driving_to_offstreet: MultiMap<LaneID, (BuildingID, Distance)>num_spots_per_lot: BTreeMap<ParkingLotID, usize>driving_to_lots: MultiMap<LaneID, ParkingLotID>events: Vec<Event>

Implementations

impl ParkingSimState[src]

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

pub fn handle_live_edits(
    &mut self,
    map: &Map,
    timer: &mut Timer
) -> Vec<ParkedCar>
[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 reserve_spot(&mut self, spot: ParkingSpot)[src]

pub fn remove_parked_car(&mut self, p: ParkedCar)[src]

pub fn add_parked_car(&mut self, p: ParkedCar)[src]

pub fn get_draw_cars(&self, id: LaneID, map: &Map) -> Vec<DrawCarInput>[src]

pub fn get_draw_cars_in_lots(&self, id: LaneID, map: &Map) -> Vec<DrawCarInput>[src]

pub fn get_draw_car(&self, id: CarID, map: &Map) -> Option<DrawCarInput>[src]

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

pub fn get_all_draw_cars(&self, map: &Map) -> Vec<DrawCarInput>[src]

pub fn is_free(&self, spot: ParkingSpot) -> bool[src]

pub fn get_car_at_spot(&self, spot: ParkingSpot) -> Option<&ParkedCar>[src]

pub fn get_all_free_spots(
    &self,
    driving_pos: Position,
    vehicle: &Vehicle,
    target: BuildingID,
    map: &Map
) -> Vec<(ParkingSpot, Position)>
[src]

pub fn spot_to_driving_pos(
    &self,
    spot: ParkingSpot,
    vehicle: &Vehicle,
    map: &Map
) -> Position
[src]

pub fn spot_to_sidewalk_pos(&self, spot: ParkingSpot, map: &Map) -> Position[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 get_all_parking_spots(&self) -> (Vec<ParkingSpot>, Vec<ParkingSpot>)[src]

pub fn path_to_free_parking_spot(
    &self,
    start: LaneID,
    vehicle: &Vehicle,
    target: BuildingID,
    map: &Map
) -> Option<(Vec<PathStep>, ParkingSpot, Position)>
[src]

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

Trait Implementations

impl Clone for ParkingSimState[src]

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

impl Serialize for ParkingSimState[src]

Auto Trait Implementations

impl RefUnwindSafe for ParkingSimState

impl Send for ParkingSimState

impl Sync for ParkingSimState

impl Unpin for ParkingSimState

impl UnwindSafe for ParkingSimState

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