nl.tudelft.goal.EIS2Java.handlers
Class AbstractPerceptHandler
java.lang.Object
nl.tudelft.goal.EIS2Java.handlers.PerceptHandler
nl.tudelft.goal.EIS2Java.handlers.AbstractPerceptHandler
- Direct Known Subclasses:
- AllPerceptPerceptHandler, DefaultPerceptHandler
public abstract class AbstractPerceptHandler
- extends PerceptHandler
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
entity
protected final Object entity
- The entity associated with this handler.
previousPercepts
protected final Map<Method,List<Object>> previousPercepts
- map of previous percepts that we got for each method.
AbstractPerceptHandler
public AbstractPerceptHandler(Object entity)
translatePercepts
protected final List<eis.iilang.Percept> translatePercepts(Method method,
List<Object> perceptObjects)
throws eis.exceptions.PerceiveException
- Translates the percept objects and applies filtering as described by
AsPercept.filter().
- Parameters:
entity - the entity which produced the perceptsmethod - the method which produced the perceptsperceptObjects - the generated percept objects.
- Returns:
-
- Throws:
eis.exceptions.PerceiveException
unpackPerceptObject
protected final List<Object> unpackPerceptObject(Method method,
Object perceptObject)
throws eis.exceptions.PerceiveException
- Depending on
AsPercept.multiplePercepts() a perceptObject is
either a collection that contains multiple percept objects or a single
percept. This method unpacks either case into a list of percept objects.
- Parameters:
method - that generated the percept objectperceptObject - the perceptObject generated by the method.
- Returns:
- a unpacked version of the percept object
- Throws:
eis.exceptions.PerceiveException
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.