Class ProtelisVM


  • public class ProtelisVM
    extends java.lang.Object
    A virtual machine for executing a Protelis program on a particular device (context).
    • Constructor Summary

      Constructors 
      Constructor Description
      ProtelisVM​(ProtelisProgram program, ExecutionContext context)
      Create a virtual machine for executing a Protelis program in a particular context.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getCurrentValue()
      Return the value computed in the most recent execution cycle.
      void runCycle()
      Run one execution cycle of the VM, in which the computation is run atomically against the most recent neighbor and environment information, producing a new state to be committed to the environment and sent to neighbors.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProtelisVM

        public ProtelisVM​(ProtelisProgram program,
                          ExecutionContext context)
        Create a virtual machine for executing a Protelis program in a particular context.
        Parameters:
        program - Protelis program to be executed
        context - Environment in which this program will be executed
    • Method Detail

      • runCycle

        public void runCycle()
        Run one execution cycle of the VM, in which the computation is run atomically against the most recent neighbor and environment information, producing a new state to be committed to the environment and sent to neighbors.
      • getCurrentValue

        @Nonnull
        public java.lang.Object getCurrentValue()
        Return the value computed in the most recent execution cycle.
        Returns:
        Last value computed