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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

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

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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.