aggregate

fun <ID : Any, R> aggregate(localId: ID, previousState: State = emptyMap(), inbound: Iterable<InboundMessage<ID>> = emptySet(), compute: Aggregate<ID>.() -> R): AggregateResult<ID, R>

Aggregate program entry point which computes an iteration of a device localId, taking as parameters the previousState, the inbound messages received from the neighbours and the compute with AggregateContext receiver that provides the aggregate constructs.


fun <ID : Any, R> aggregate(localId: ID, network: Network<ID>, previousState: State = emptyMap(), compute: Aggregate<ID>.() -> R): AggregateResult<ID, R>

Aggregate program entry point which computes an iteration of a device localId, over a network of devices, optionally from a previousState, running the compute aggregate program.