Package org.protelis.vm
Class ProtelisVM
- java.lang.Object
-
- org.protelis.vm.ProtelisVM
-
public class ProtelisVM extends java.lang.ObjectA 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.ObjectgetCurrentValue()Return the value computed in the most recent execution cycle.voidrunCycle()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.
-
-
-
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 executedcontext- 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
-
-