aggregate

fun <X> aggregate(localId: ID, messages: Set<InboundMessage> = emptySet(), state: Set<State<*>> = emptySet(), init: AggregateContext.() -> X): AggregateResult<X>

Aggregate program entry point which computes a single iteration of a device localId, taking as parameters the previous state, the messages received from the neighbours and the init with AggregateContext object receiver that provides the aggregate constructs.


fun <X> aggregate(localId: ID, condition: () -> Boolean, network: Network, init: AggregateContext.() -> X): AggregateResult<X>

Aggregate program entry point which computes multiple iterations of a device localId, over a condition and a network of devices, with the lambda init with AggregateContext object receiver that provides the aggregate constructs.