distanceTo

inline fun <ID : Any, Distance : Comparable<Distance>> Aggregate<ID>.distanceTo(source: Boolean, bottom: Distance, top: Distance, crossinline accumulateDistance: (Distance, Distance) -> Distance, crossinline metric: () -> Field<ID, Distance>): Distance

Compute the Distance from the closest source, starting from bottom and up to top.

the Distance between neighboring devices is computed using the metric function, the distance summation is governed by the accumulateDistance function.


inline fun <ID : Any> Aggregate<ID>.distanceTo(source: Boolean, crossinline metric: () -> Field<ID, Double> = { neighboring(1.0) }): Double

Compute the distance from the closest source, using Doubles.

The distance between neighboring devices is computed using the metric function, and defaults to the hop distance.