Class PerceptList


  • public class PerceptList
    extends java.lang.Object
    The list of scheduled component percepts and convenience methods for processing selected percepts. This implementation is not thread-safe, i.e. methods should only be called from threads that are already synchronized with the environment space monitor.
    • Constructor Detail

      • PerceptList

        public PerceptList​(IEnvironmentSpace space)
        Create a new percept list.
    • Method Detail

      • schedulePercept

        public void schedulePercept​(java.lang.String type,
                                    java.lang.Object data,
                                    IComponentDescription component,
                                    ISpaceObject avatar,
                                    IPerceptProcessor processor)
        Schedules a percept.
        Parameters:
        type - The percept type.
        data - The content of the percept (if any).
        component - The component that should receive the percept.
        avatar - The avatar of the component (if any).
        processor - The percept processor.
      • setOrdering

        public void setOrdering​(java.util.Comparator<PerceptList.PerceptEntry> comp)
        Set an ordering used for executing actions.
        Parameters:
        comp - The comparator representing the ordering.
      • processPercepts

        public void processPercepts​(IFilter<PerceptList.PerceptEntry> filter)
        Process scheduled percepts. Should be called on environment thread only.
        Parameters:
        filter - A filter to select only a subset of percepts (or null for all percepts).