pub enum Event {
Show 20 variants
CarReachedParkingSpot(CarID, ParkingSpot),
CarLeftParkingSpot(CarID, ParkingSpot),
BusArrivedAtStop(CarID, TransitRouteID, TransitStopID),
BusDepartedFromStop(CarID, TransitRouteID, TransitStopID),
PassengerBoardsTransit(PersonID, CarID, TransitRouteID, TransitStopID, Duration),
PassengerAlightsTransit(PersonID, CarID, TransitRouteID, TransitStopID),
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, TransitRouteID, TransitStopID)
BusDepartedFromStop(CarID, TransitRouteID, TransitStopID)
PassengerBoardsTransit(PersonID, CarID, TransitRouteID, TransitStopID, Duration)
How long waiting at the stop?
PassengerAlightsTransit(PersonID, CarID, TransitRouteID, TransitStopID)
PersonEntersBuilding(PersonID, BuildingID)
PersonLeavesBuilding(PersonID, BuildingID)
PersonLeavesMap(PersonID, Option<AgentID>, IntersectionID)
None if cancelled
PersonEntersMap(PersonID, AgentID, IntersectionID)
PedReachedParkingSpot(PedestrianID, ParkingSpot)
BikeStoppedAtSidewalk(CarID, LaneID)
ProblemEncountered(TripID, Problem)
AgentEntersTraversable(AgentID, Option<TripID>, Traversable, Option<usize>)
If the agent is a transit vehicle, then include a count of how many passengers are on board.
IntersectionDelayMeasured(TripID, TurnID, AgentID, Duration)
TripID, TurnID (Where the delay was encountered), Time spent waiting at that turn
TripFinished
TripCancelled(TripID, TripMode)
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§
source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
source§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>,
source§impl PartialEq for Event
impl PartialEq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.