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§
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§
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
Mutably borrows from an owned value. Read more
§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>
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.