Class RunProtelisProgram

  • All Implemented Interfaces:
    it.unibo.alchemist.model.Action , java.io.Serializable

    
    public final class RunProtelisProgram<P extends Position<P>>
     implements Action<Any>
                        

    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.