hop Gradient Cast
Broadcasts a fast-repair gradient of local values using hop count as the distance metric.
Propagates values from every device where source is true, retaining the data from the nearest source (fewest hops). Internally delegates to intGradientCast with hops() as the metric and Int::plus as the distance reducer.
Return
The data associated with the nearest source node along a minimal-hop, loop-free path, or local if no source is reachable.
Parameters
The type representing neighbor identifiers.
The type of data being propagated.
True if this device is a source node; false otherwise.
The local data value or fallback if no source is reachable.
Upper bound on path hop count; paths longer than this are discarded. Defaults to Int.MAX_VALUE.
Function to update neighbor data on each hop. Receives the neighbor’s distance from source (hop count), the hop increment (always 1), and the neighbor’s data. Defaults to the identity function.