countDevices

inline fun <ID : Any, Potential : Comparable<Potential>> Aggregate<ID>.countDevices(potential: Field<ID, Potential>, selectParent: Comparator<FieldEntry<ID, Potential>> = defaultComparator()): Int
inline fun <ID : Any, Potential : Comparable<Potential>> Aggregate<ID>.countDevices(potential: Potential, selectParent: Comparator<FieldEntry<ID, Potential>> = defaultComparator()): Int

Counts the number of devices in the network along a spanning tree built descending the provided potential field using the selectParent. For all devices to get counted, there must be a single global minimum.


inline fun <ID : Any> Aggregate<ID>.countDevices(sink: Boolean): Int

Counts the number of devices in the network along a spanning tree built using hopDistanceTo starting from sink. For all devices to get counted, there must be a single sink.