RunProtelisProgram

An Action that executes a Protelis program.

Requires the current randomGenerator and environment, a valid ProtelisDevice (device), and the local reaction hosting the computation.

The program can be created using a String (originalProgram), or, alternatively, by providing a ProtelisProgram (program).

retentionTime specifies whether, upon message usage, the received messages should be deleted (assuming a reasonable synchronization among devices) or if they should remain in memory for a specified amount of time. By default, retentionTime is Double.NaN, indicating that messages are deleted upon read.

It is possible to sumulate the loss of messages due to a higher connection distance by providing a RealDistribution (packetLossDistance) mapping distances to the loss probability. By default this feature is disabled.

Constructors

Link copied to clipboard
constructor(randomGenerator: RandomGenerator, environment: Environment<Any, P>, device: ProtelisDevice<P>, reaction: Reaction<Any>, program: ProtelisProgram, retentionTime: Double = Double.NaN)
constructor(randomGenerator: RandomGenerator, environment: Environment<Any, P>, device: ProtelisDevice<P>, reaction: Reaction<Any>, program: ProtelisProgram, retentionTime: Double = Double.NaN, packetLossDistributionName: String, vararg packetLossDistributionParameters: Double)
constructor(randomGenerator: RandomGenerator, environment: Environment<Any, P>, device: ProtelisDevice<P>, reaction: Reaction<Any>, program: String, retentionTime: Double = Double.NaN)
constructor(randomGenerator: RandomGenerator, environment: Environment<Any, P>, device: ProtelisDevice<P>, reaction: Reaction<Any>, program: String, retentionTime: Double = Double.NaN, packetLossDistributionName: String, vararg packetLossDistributionParameters: Double)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Provides an access to the underlying org.protelis.vm.ExecutionContext.

Link copied to clipboard
val node: Node<Any>

The Alchemist Node hosting the ProtelisDevice.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val program: ProtelisProgram
Link copied to clipboard
val randomGenerator: RandomGenerator
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
open override fun cloneAction(node: Node<Any>, reaction: Reaction<Any>): RunProtelisProgram<P>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun execute()
Link copied to clipboard
open override fun getContext(): Context
Link copied to clipboard
open override fun getOutboundDependencies(): ImmutableListSet<Dependency>
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Resets the computation status (used for dependency management).

Link copied to clipboard
open override fun toString(): String