AlchemistNetworkManager

class AlchemistNetworkManager @JvmOverloads constructor(    val event: Reaction<Any>,     val device: ProtelisDevice<*> = event.node.asProperty(),     val program: RunProtelisProgram<*>,     val retentionTime: Double = Double.NaN,     val distanceLossDistribution: RealDistribution? = null) : NetworkManager, Serializable

Emulates a NetworkManager. This particular network manager does not send messages instantly. Instead, it records the last message to send, and only when simulateMessageArrival is called the transfer is actually performed.

Constructors

Link copied to clipboard
fun AlchemistNetworkManager(    event: Reaction<Any>,     device: ProtelisDevice<*> = event.node.asProperty(),     program: RunProtelisProgram<*>,     retentionTime: Double = Double.NaN,     distanceLossDistribution: RealDistribution? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun getNeighborState(): ImmutableMap<DeviceUID, Map<CodePath, Any>>
Link copied to clipboard
open override fun shareState(toSend: Map<CodePath, Any>)
Link copied to clipboard
fun simulateMessageArrival(currentTime: Double)

Simulates the arrival of the message to other nodes.

Properties

Link copied to clipboard
val device: ProtelisDevice<*>

The ProtelisDevice required to run Protelis.

Link copied to clipboard
val distanceLossDistribution: RealDistribution? = null

the distribution connecting the distance to the packet loss.

Link copied to clipboard
val event: Reaction<Any>

This reaction stores the time at which the neighbor state is read.

Link copied to clipboard
val program: RunProtelisProgram<*>

The action this network manager is associated with.

Link copied to clipboard
val retentionTime: Double

the message retention time, or NaN if all the messages get discarded as soon as a computation cycle is concluded.