Enum sim::events::Event[][src]

pub enum Event {
    CarReachedParkingSpot(CarIDParkingSpot),
    CarLeftParkingSpot(CarIDParkingSpot),
    BusArrivedAtStop(CarIDBusRouteIDBusStopID),
    BusDepartedFromStop(CarIDBusRouteIDBusStopID),
    PassengerBoardsTransit(PersonIDCarIDBusRouteIDBusStopIDDuration),
    PassengerAlightsTransit(PersonIDCarIDBusRouteIDBusStopID),
    PersonEntersBuilding(PersonIDBuildingID),
    PersonLeavesBuilding(PersonIDBuildingID),
    PersonLeavesMap(PersonIDOption<AgentID>, IntersectionID),
    PersonEntersMap(PersonIDAgentIDIntersectionID),
    PedReachedParkingSpot(PedestrianIDParkingSpot),
    BikeStoppedAtSidewalk(CarIDLaneID),
    AgentEntersTraversable(AgentIDTraversableOption<usize>),
    IntersectionDelayMeasured(TripIDTurnIDAgentIDDuration),
    TripFinished {
        trip: TripID,
        mode: TripMode,
        total_time: Duration,
        blocked_time: Duration,
    },
    TripCancelled(TripIDTripMode),
    TripPhaseStarting(TripIDPersonIDOption<PathRequest>, TripPhaseType),
    LaneSpeedPercentage(TripIDLaneIDSpeedSpeed),
    PathAmended(Path),
    Alert(AlertLocationString),
}

As a simulation runs, different systems emit Events. This cleanly separates the internal mechanics of the simulation from consumers that just want to know what's happening.

An Event always occurs at a particular time, plumbed separately to consumers.

Many of these were created for a test framework that's been abandoned. They could be removed or have their API adjusted, but it's not urgent; publishing an event that's not used by Analytics has no performance impact.

Variants

CarReachedParkingSpot(CarIDParkingSpot)
CarLeftParkingSpot(CarIDParkingSpot)
BusArrivedAtStop(CarIDBusRouteIDBusStopID)
BusDepartedFromStop(CarIDBusRouteIDBusStopID)
PassengerBoardsTransit(PersonIDCarIDBusRouteIDBusStopIDDuration)

How long waiting at the stop?

PassengerAlightsTransit(PersonIDCarIDBusRouteIDBusStopID)
PersonEntersBuilding(PersonIDBuildingID)
PersonLeavesBuilding(PersonIDBuildingID)
PersonLeavesMap(PersonIDOption<AgentID>, IntersectionID)

None if cancelled

PersonEntersMap(PersonIDAgentIDIntersectionID)
PedReachedParkingSpot(PedestrianIDParkingSpot)
BikeStoppedAtSidewalk(CarIDLaneID)
AgentEntersTraversable(AgentIDTraversableOption<usize>)

If the agent is a transit vehicle, then include a count of how many passengers are on board.

IntersectionDelayMeasured(TripIDTurnIDAgentIDDuration)

TripID, TurnID (Where the delay was encountered), Time spent waiting at that turn

TripFinished

Fields of TripFinished

trip: TripIDmode: TripModetotal_time: Durationblocked_time: Duration
TripCancelled(TripIDTripMode)
TripPhaseStarting(TripIDPersonIDOption<PathRequest>, TripPhaseType)
LaneSpeedPercentage(TripIDLaneIDSpeedSpeed)

TripID, LaneID (Where the delay was encountered), Average Speed, Max Speed

PathAmended(Path)

Just use for parking replanning. Not happy about copying the full path in here, but the way to plumb info into Analytics is Event.

Alert(AlertLocationString)

Trait Implementations

impl Clone for Event[src]

impl Debug for Event[src]

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

impl PartialEq<Event> for Event[src]

impl Serialize for Event[src]

impl StructuralPartialEq for Event[src]

Auto Trait Implementations

impl RefUnwindSafe for Event[src]

impl Send for Event[src]

impl Sync for Event[src]

impl Unpin for Event[src]

impl UnwindSafe for Event[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>,