Design collective systems using concise, type-safe Kotlin syntax.
Run on JVM, JS, Native, Android, and iOS. Write once, run everywhere.
Compose your system from reusable, collective functions.
Define your collective system using aggregate operators.
/**
* Each node computes the distance from the source node.
*/
fun Aggregate<Int>.gradient(collektiveDevice: CollektiveDevice<*>, source: Boolean): Double =
share(POSITIVE_INFINITY) {
val dist = with(collektiveDevice) { distances() }
val minValue = (it + dist).min(POSITIVE_INFINITY)
when {
source -> 0.0
else -> minValue
}
}
Contribute, ask questions, and help shape the next-gen Aggregate framework.
Join on GitHub