[−][src]Enum sim::mechanics::parking::ParkingSimState
Variants
Normal(NormalParkingSimState)
Infinite(InfiniteParkingSimState)
Implementations
impl ParkingSimState
[src]
pub fn new(map: &Map, infinite: bool) -> ParkingSimState
[src]
Counterintuitive: any spots located in blackholes are just not represented here. If somebody tries to drive from a blackholed spot, they couldn't reach most places.
pub fn is_infinite(&self) -> bool
[src]
Trait Implementations
impl Clone for ParkingSimState
[src]
fn clone(&self) -> ParkingSimState
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de> Deserialize<'de> for ParkingSimState
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<InfiniteParkingSimState> for ParkingSimState
[src]
fn from(v: InfiniteParkingSimState) -> ParkingSimState
[src]
impl From<NormalParkingSimState> for ParkingSimState
[src]
fn from(v: NormalParkingSimState) -> ParkingSimState
[src]
impl ParkingSim for ParkingSimState
[src]
fn handle_live_edits(&mut self, map: &Map) -> (Vec<ParkedCar>, Vec<CarID>)
[src]
Returns any cars that got very abruptly evicted from existence, and also cars actively moving into a deleted spot.
fn get_free_onstreet_spots(&self, l: LaneID) -> Vec<ParkingSpot>
[src]
fn get_free_offstreet_spots(&self, b: BuildingID) -> Vec<ParkingSpot>
[src]
fn get_free_lot_spots(&self, pl: ParkingLotID) -> Vec<ParkingSpot>
[src]
fn reserve_spot(&mut self, spot: ParkingSpot, car: CarID)
[src]
fn unreserve_spot(&mut self, car: CarID)
[src]
Needed when abruptly deleting a car, in case they're being deleted during their last step.
fn remove_parked_car(&mut self, p: ParkedCar)
[src]
fn add_parked_car(&mut self, p: ParkedCar)
[src]
fn get_draw_cars(&self, id: LaneID, map: &Map) -> Vec<DrawCarInput>
[src]
fn get_draw_cars_in_lots(&self, id: LaneID, map: &Map) -> Vec<DrawCarInput>
[src]
fn get_draw_car(&self, id: CarID, map: &Map) -> Option<DrawCarInput>
[src]
fn canonical_pt(&self, id: CarID, map: &Map) -> Option<Pt2D>
[src]
There's no DrawCarInput for cars parked offstreet, so we need this.
fn get_all_draw_cars(&self, map: &Map) -> Vec<DrawCarInput>
[src]
fn is_free(&self, spot: ParkingSpot) -> bool
[src]
fn get_car_at_spot(&self, spot: ParkingSpot) -> Option<&ParkedCar>
[src]
fn get_all_free_spots(
&self,
driving_pos: Position,
vehicle: &Vehicle,
target: BuildingID,
map: &Map
) -> Vec<(ParkingSpot, Position)>
[src]
&self,
driving_pos: Position,
vehicle: &Vehicle,
target: BuildingID,
map: &Map
) -> Vec<(ParkingSpot, Position)>
The vehicle's front is currently at the given driving_pos. Returns all valid spots and their driving position.
fn spot_to_driving_pos(
&self,
spot: ParkingSpot,
vehicle: &Vehicle,
map: &Map
) -> Position
[src]
&self,
spot: ParkingSpot,
vehicle: &Vehicle,
map: &Map
) -> Position
fn spot_to_sidewalk_pos(&self, spot: ParkingSpot, map: &Map) -> Position
[src]
fn get_owner_of_car(&self, id: CarID) -> Option<PersonID>
[src]
fn lookup_parked_car(&self, id: CarID) -> Option<&ParkedCar>
[src]
fn get_all_parking_spots(&self) -> (Vec<ParkingSpot>, Vec<ParkingSpot>)
[src]
(Filled, available)
fn path_to_free_parking_spot(
&self,
start: LaneID,
vehicle: &Vehicle,
target: BuildingID,
map: &Map
) -> Option<(Vec<PathStep>, ParkingSpot, Position)>
[src]
&self,
start: LaneID,
vehicle: &Vehicle,
target: BuildingID,
map: &Map
) -> Option<(Vec<PathStep>, ParkingSpot, Position)>
Unrealistically assumes the driver has knowledge of currently free parking spots, even if they're far away. Since they don't reserve the spot in advance, somebody else can still beat them there, producing some nice, realistic churn if there's too much contention. But the implementation has some internal jitter between different vehicles, to discourage everybody near one spot from all competing for it. Note the first PathStep is the turn after start, NOT PathStep::Lane(start).
fn collect_events(&mut self) -> Vec<Event>
[src]
fn all_parked_car_positions(&self, map: &Map) -> Vec<(Position, PersonID)>
[src]
fn bldg_to_parked_cars(&self, b: BuildingID) -> Vec<CarID>
[src]
impl Serialize for ParkingSimState
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl TryInto<InfiniteParkingSimState> for ParkingSimState
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> Result<InfiniteParkingSimState, Self::Error>
[src]
impl TryInto<NormalParkingSimState> for ParkingSimState
[src]
Auto Trait Implementations
impl RefUnwindSafe for ParkingSimState
[src]
impl Send for ParkingSimState
[src]
impl Sync for ParkingSimState
[src]
impl Unpin for ParkingSimState
[src]
impl UnwindSafe for ParkingSimState
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,