pub struct NearestTargetRequest { /* private fields */ }Expand description
The distance from one point to the nearest of several targets.
With Self::with_avoided, every walk keeps out of the named objects:
each is an obstacle wherever its body stands in the walking band, even a
surface or portal the backend would otherwise walk on or through. The
answer then bounds the shortest walk avoiding them all, so a lower bound
beyond the plain walk’s upper bound proves that every shortest walk
enters one of them. Only a backend that avoids
objects is asked.
With Self::with_costs, the distance is the least weighted cost of a
walk (see TravelCost), and the answer’s route is a walk whose
weighted cost is at most its upper bound. Only a backend that weighs
travel is asked.
Implementations§
Source§impl NearestTargetRequest
impl NearestTargetRequest
Sourcepub fn try_new(
origin: MetricPoint,
targets: Vec<MetricPoint>,
profile: MobilityProfile,
) -> Result<Self, MetricRoutingError>
pub fn try_new( origin: MetricPoint, targets: Vec<MetricPoint>, profile: MobilityProfile, ) -> Result<Self, MetricRoutingError>
Creates a request; targets keep their order, which answers index.
Sourcepub fn with_costs(self, costs: Vec<TravelCost>) -> Self
pub fn with_costs(self, costs: Vec<TravelCost>) -> Self
The same request, counting travel over objects by their factors (sorted by object, each object’s greatest factor kept, factors of one dropped).
Sourcepub fn costs(&self) -> &[TravelCost]
pub fn costs(&self) -> &[TravelCost]
The costs travel counts by, sorted by object; empty for plain length.
Sourcepub fn with_avoided(self, avoided: Vec<ObjectId>) -> Self
pub fn with_avoided(self, avoided: Vec<ObjectId>) -> Self
The same request, walking around avoided (sorted, deduplicated).
An avoided connector is not climbed.
Sourcepub fn with_connectors(self, connectors: ConnectorRouting) -> Self
pub fn with_connectors(self, connectors: ConnectorRouting) -> Self
The same request, climbing through connectors between levels
(see ConnectorRouting).
Sourcepub fn connectors(&self) -> Option<&ConnectorRouting>
pub fn connectors(&self) -> Option<&ConnectorRouting>
The connectors a route may climb through; None for a request that
leaves them to the backend.
Sourcepub fn origin(&self) -> &MetricPoint
pub fn origin(&self) -> &MetricPoint
Where every route starts.
Sourcepub fn targets(&self) -> &[MetricPoint]
pub fn targets(&self) -> &[MetricPoint]
The targets, in request order.
Sourcepub fn profile(&self) -> MobilityProfile
pub fn profile(&self) -> MobilityProfile
Mobility envelope.