hopDistanceTo

inline fun <ID : Any> Aggregate<ID>.hopDistanceTo(source: Boolean, maxDiameter: Int = Int.MAX_VALUE): Int

Computes the hop-count distance from the nearest source node as an Int.

Return

The computed hop-count Int distance to the closest source.

Parameters

ID

The type used for neighbor identifiers.

source

True if this device is a source node; otherwise false.

maxDiameter

Maximum allowed hops before discarding paths. Defaults to Int.MAX_VALUE.