Enum sim::mechanics::parking::ParkingSimState [−][src]
pub enum ParkingSimState { Normal(NormalParkingSimState), Infinite(InfiniteParkingSimState), }
Variants
Normal(NormalParkingSimState)
Infinite(InfiniteParkingSimState)
Implementations
impl ParkingSimState
[src]
impl ParkingSimState
[src]pub fn new(map: &Map, infinite: bool, timer: &mut Timer<'_>) -> 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]
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]
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]
impl From<InfiniteParkingSimState> for ParkingSimState
[src]fn from(v: InfiniteParkingSimState) -> ParkingSimState
[src]
impl From<NormalParkingSimState> for ParkingSimState
[src]
impl From<NormalParkingSimState> for ParkingSimState
[src]fn from(v: NormalParkingSimState) -> ParkingSimState
[src]
impl ParkingSim for ParkingSimState
[src]
impl ParkingSim for ParkingSimState
[src]fn handle_live_edits(
&mut self,
__enum_dispatch_arg_0: &Map,
__enum_dispatch_arg_1: &mut Timer<'_>
) -> (Vec<ParkedCar>, Vec<CarID>)
[src]
&mut self,
__enum_dispatch_arg_0: &Map,
__enum_dispatch_arg_1: &mut Timer<'_>
) -> (Vec<ParkedCar>, Vec<CarID>)
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,
__enum_dispatch_arg_0: LaneID
) -> Vec<ParkingSpot>
[src]
&self,
__enum_dispatch_arg_0: LaneID
) -> Vec<ParkingSpot>
fn get_free_offstreet_spots(
&self,
__enum_dispatch_arg_0: BuildingID
) -> Vec<ParkingSpot>
[src]
&self,
__enum_dispatch_arg_0: BuildingID
) -> Vec<ParkingSpot>
fn get_free_lot_spots(
&self,
__enum_dispatch_arg_0: ParkingLotID
) -> Vec<ParkingSpot>
[src]
&self,
__enum_dispatch_arg_0: ParkingLotID
) -> Vec<ParkingSpot>
fn reserve_spot(
&mut self,
__enum_dispatch_arg_0: ParkingSpot,
__enum_dispatch_arg_1: CarID
)
[src]
&mut self,
__enum_dispatch_arg_0: ParkingSpot,
__enum_dispatch_arg_1: CarID
)
fn unreserve_spot(&mut self, __enum_dispatch_arg_0: CarID)
[src]
Needed when abruptly deleting a car, in case they’re being deleted during their last step.
fn remove_parked_car(&mut self, __enum_dispatch_arg_0: ParkedCar)
[src]
fn add_parked_car(&mut self, __enum_dispatch_arg_0: ParkedCar)
[src]
fn get_draw_cars(
&self,
__enum_dispatch_arg_0: LaneID,
__enum_dispatch_arg_1: &Map
) -> Vec<DrawCarInput>
[src]
&self,
__enum_dispatch_arg_0: LaneID,
__enum_dispatch_arg_1: &Map
) -> Vec<DrawCarInput>
fn get_draw_cars_in_lots(
&self,
__enum_dispatch_arg_0: LaneID,
__enum_dispatch_arg_1: &Map
) -> Vec<DrawCarInput>
[src]
&self,
__enum_dispatch_arg_0: LaneID,
__enum_dispatch_arg_1: &Map
) -> Vec<DrawCarInput>
fn get_draw_car(
&self,
__enum_dispatch_arg_0: CarID,
__enum_dispatch_arg_1: &Map
) -> Option<DrawCarInput>
[src]
&self,
__enum_dispatch_arg_0: CarID,
__enum_dispatch_arg_1: &Map
) -> Option<DrawCarInput>
fn canonical_pt(
&self,
__enum_dispatch_arg_0: CarID,
__enum_dispatch_arg_1: &Map
) -> Option<Pt2D>
[src]
&self,
__enum_dispatch_arg_0: CarID,
__enum_dispatch_arg_1: &Map
) -> Option<Pt2D>
There’s no DrawCarInput for cars parked offstreet, so we need this.
fn get_all_draw_cars(&self, __enum_dispatch_arg_0: &Map) -> Vec<DrawCarInput>
[src]
fn is_free(&self, __enum_dispatch_arg_0: ParkingSpot) -> bool
[src]
fn get_car_at_spot(
&self,
__enum_dispatch_arg_0: ParkingSpot
) -> Option<&ParkedCar>
[src]
&self,
__enum_dispatch_arg_0: ParkingSpot
) -> Option<&ParkedCar>
fn get_all_free_spots(
&self,
__enum_dispatch_arg_0: Position,
__enum_dispatch_arg_1: &Vehicle,
__enum_dispatch_arg_2: BuildingID,
__enum_dispatch_arg_3: &Map
) -> Vec<(ParkingSpot, Position)>
[src]
&self,
__enum_dispatch_arg_0: Position,
__enum_dispatch_arg_1: &Vehicle,
__enum_dispatch_arg_2: BuildingID,
__enum_dispatch_arg_3: &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,
__enum_dispatch_arg_0: ParkingSpot,
__enum_dispatch_arg_1: &Vehicle,
__enum_dispatch_arg_2: &Map
) -> Position
[src]
&self,
__enum_dispatch_arg_0: ParkingSpot,
__enum_dispatch_arg_1: &Vehicle,
__enum_dispatch_arg_2: &Map
) -> Position
fn spot_to_sidewalk_pos(
&self,
__enum_dispatch_arg_0: ParkingSpot,
__enum_dispatch_arg_1: &Map
) -> Position
[src]
&self,
__enum_dispatch_arg_0: ParkingSpot,
__enum_dispatch_arg_1: &Map
) -> Position
fn get_owner_of_car(&self, __enum_dispatch_arg_0: CarID) -> Option<PersonID>
[src]
fn lookup_parked_car(&self, __enum_dispatch_arg_0: CarID) -> Option<&ParkedCar>
[src]
fn get_all_parking_spots(&self) -> (Vec<ParkingSpot>, Vec<ParkingSpot>)
[src]
(Filled, available)
fn path_to_free_parking_spot(
&self,
__enum_dispatch_arg_0: LaneID,
__enum_dispatch_arg_1: &Vehicle,
__enum_dispatch_arg_2: BuildingID,
__enum_dispatch_arg_3: &Map
) -> Option<(Vec<PathStep>, ParkingSpot, Position)>
[src]
&self,
__enum_dispatch_arg_0: LaneID,
__enum_dispatch_arg_1: &Vehicle,
__enum_dispatch_arg_2: BuildingID,
__enum_dispatch_arg_3: &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,
__enum_dispatch_arg_0: &Map
) -> Vec<(Position, PersonID)>
[src]
&self,
__enum_dispatch_arg_0: &Map
) -> Vec<(Position, PersonID)>
fn bldg_to_parked_cars(&self, __enum_dispatch_arg_0: BuildingID) -> Vec<CarID>
[src]
impl Serialize for ParkingSimState
[src]
impl Serialize for ParkingSimState
[src]impl TryInto<NormalParkingSimState> for ParkingSimState
[src]
impl TryInto<NormalParkingSimState> 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> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,