jadex.application.space.envsupport.environment
Class PerceptList

java.lang.Object
  extended by jadex.application.space.envsupport.environment.PerceptList

public class PerceptList
extends 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.


Nested Class Summary
static class PerceptList.PerceptEntry
          Entry for a scheduled percept.
 
Field Summary
protected  Set percepts
          The scheduled percepts.
protected  IEnvironmentSpace space
          The environment space.
 
Constructor Summary
PerceptList(IEnvironmentSpace space)
          Create a new percept list.
 
Method Summary
 void processPercepts(IFilter filter)
          Process scheduled percepts.
 void schedulePercept(String type, Object data, IComponentIdentifier component, ISpaceObject avatar, IPerceptProcessor processor)
          Schedules a percept.
 void setOrdering(Comparator comp)
          Set an ordering used for executing actions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

space

protected IEnvironmentSpace space
The environment space.


percepts

protected Set percepts
The scheduled percepts.

Constructor Detail

PerceptList

public PerceptList(IEnvironmentSpace space)
Create a new percept list.

Method Detail

schedulePercept

public void schedulePercept(String type,
                            Object data,
                            IComponentIdentifier 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(Comparator comp)
Set an ordering used for executing actions.

Parameters:
comp - The comparator representing the ordering.

processPercepts

public void processPercepts(IFilter 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).


Copyright © 2010. All Rights Reserved.