Struct headless::AgentPosition
source · [−]pub(crate) struct AgentPosition {
pub(crate) id: AgentID,
pub(crate) trip: Option<TripID>,
pub(crate) person: Option<PersonID>,
pub(crate) vehicle_type: Option<VehicleType>,
pub(crate) pos: LonLat,
pub(crate) distance_crossed: Distance,
}
Fields
id: AgentID
The agent’s ID
trip: Option<TripID>
None for buses
person: Option<PersonID>
None for buses
vehicle_type: Option<VehicleType>
None for pedestrians
pos: LonLat
The agent’s current position. For pedestrians, this is their center. For vehicles, this represents the front of the vehicle.
distance_crossed: Distance
The distance crossed so far by the agent, in meters. There are some caveats to this value:
- The distance along driveways between buildings/parking lots and the road doesn’t count here.
- The distance only represents the current leg of the trip. If somebody walks to a car, the distance will reset when they begin driving, and also vehicle_type will change.
- No meaning for bus passengers currently.
- For buses and trains, the value will reset every time the vehicle reaches the next transit stop.
- At the very end of a driving trip, the agent may wind up crossing slightly more or less than the total path length, due to where they park along that last road.
Trait Implementations
sourceimpl Serialize for AgentPosition
impl Serialize for AgentPosition
Auto Trait Implementations
impl RefUnwindSafe for AgentPosition
impl Send for AgentPosition
impl Sync for AgentPosition
impl Unpin for AgentPosition
impl UnwindSafe for AgentPosition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more