Enum sim::events::Event [−][src]
pub enum Event {}Show 20 variants
CarReachedParkingSpot(CarID, ParkingSpot), CarLeftParkingSpot(CarID, ParkingSpot), BusArrivedAtStop(CarID, BusRouteID, BusStopID), BusDepartedFromStop(CarID, BusRouteID, BusStopID), PassengerBoardsTransit(PersonID, CarID, BusRouteID, BusStopID, Duration), PassengerAlightsTransit(PersonID, CarID, BusRouteID, BusStopID), PersonEntersBuilding(PersonID, BuildingID), PersonLeavesBuilding(PersonID, BuildingID), PersonLeavesMap(PersonID, Option<AgentID>, IntersectionID), PersonEntersMap(PersonID, AgentID, IntersectionID), PedReachedParkingSpot(PedestrianID, ParkingSpot), BikeStoppedAtSidewalk(CarID, LaneID), ProblemEncountered(TripID, Problem), AgentEntersTraversable(AgentID, Option<TripID>, Traversable, Option<usize>), IntersectionDelayMeasured(TripID, TurnID, AgentID, Duration), TripFinished { trip: TripID, mode: TripMode, total_time: Duration, blocked_time: Duration, }, TripCancelled(TripID, TripMode), TripPhaseStarting(TripID, PersonID, Option<PathRequest>, TripPhaseType), PathAmended(Path), Alert(AlertLocation, String),
Expand description
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(CarID, ParkingSpot)
CarLeftParkingSpot(CarID, ParkingSpot)
BusArrivedAtStop(CarID, BusRouteID, BusStopID)
BusDepartedFromStop(CarID, BusRouteID, BusStopID)
PassengerBoardsTransit(PersonID, CarID, BusRouteID, BusStopID, Duration)
How long waiting at the stop?
PassengerAlightsTransit(PersonID, CarID, BusRouteID, BusStopID)
PersonEntersBuilding(PersonID, BuildingID)
PersonLeavesBuilding(PersonID, BuildingID)
PersonLeavesMap(PersonID, Option<AgentID>, IntersectionID)
None if cancelled
PersonEntersMap(PersonID, AgentID, IntersectionID)
PedReachedParkingSpot(PedestrianID, ParkingSpot)
If the agent is a transit vehicle, then include a count of how many passengers are on board.
TripID, TurnID (Where the delay was encountered), Time spent waiting at that turn
TripPhaseStarting(TripID, PersonID, Option<PathRequest>, TripPhaseType)
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(AlertLocation, String)
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Event
impl UnwindSafe for Event
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self