Class SimpleProgramImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object compute​(ExecutionContext context)
      Execute one round of computation of this Protelis program.
      java.lang.String getName()
      The name of the program.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • SimpleProgramImpl

        public SimpleProgramImpl​(org.protelis.parser.protelis.ProtelisModule source,
                                 ProtelisAST<?> program)
        Parameters:
        source - Original ProtelisProgram parsed by Xtext. Used to get the module name.
        program - evaluation tree
      • SimpleProgramImpl

        public SimpleProgramImpl​(java.lang.String pName,
                                 ProtelisAST<?> program)
        Parameters:
        pName - Program name
        program - evaluation tree
    • Method Detail

      • compute

        public java.lang.Object compute​(ExecutionContext context)
        Description copied from interface: ProtelisProgram
        Execute one round of computation of this Protelis program.
        Specified by:
        compute in interface ProtelisProgram
        Parameters:
        context - The virtual machine environment in which computation will take place.
        Returns:
        the result of the program's evaluation
      • getName

        public java.lang.String getName()
        Description copied from interface: ProtelisProgram
        The name of the program.
        Specified by:
        getName in interface ProtelisProgram
        Returns:
        Name of the program, or some default name if no specific name is provided
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object