convergeCast

inline fun <ID : Any, Data, Potential : Comparable<Potential>> Aggregate<ID>.convergeCast(local: Data, potential: Field<ID, Potential>, selectParent: Comparator<FieldEntry<ID, Potential>> = defaultComparator(), crossinline accumulateData: (Data, Data) -> Data): Data
inline fun <ID : Any, Data, Potential : Comparable<Potential>> Aggregate<ID>.convergeCast(local: Data, potential: Potential, selectParent: Comparator<FieldEntry<ID, Potential>> = defaultComparator(), crossinline accumulateData: (Data, Data) -> Data): Data

Aggregate a field of local along a spanning tree built according descending the provided potential field. The parent of the current node is selected by picking the minimum as provided by the selectParent comparator which, by default, selects the parent with lowest potential. Data is accumulated using the accumulateData function.


inline fun <ID : Any, Data> Aggregate<ID>.convergeCast(local: Data, sink: Boolean, crossinline accumulateData: (Data, Data) -> Data): Data

Aggregate a field of local into the closest sink along a spanning tree built using hopDistanceTo. Data is accumulated using the accumulateData function.