nl.tudelft.goal.EIS2Java.environment
Class AbstractEnvironment
java.lang.Object
eis.EIDefaultImpl
nl.tudelft.goal.EIS2Java.environment.AbstractEnvironment
- All Implemented Interfaces:
- eis.EnvironmentInterfaceStandard, Serializable
public abstract class AbstractEnvironment
- extends eis.EIDefaultImpl
Base implementation for environments that want to work with automated percept
and action discovery in EIS2Java.
11-02-2011: MP - Implemented synchronization feature to work with
asynchronous entities.
- Author:
- Lennard de Rijk, M.P. Korstanje
- See Also:
- Serialized Form
|
Method Summary |
void |
deleteEntity(String name)
|
protected LinkedList<eis.iilang.Percept> |
getAllPerceptsFromEntity(String name)
|
|
getEntity(String name)
Retrieve an entity for a given name. |
protected boolean |
isSupportedByEntity(eis.iilang.Action action,
String name)
|
protected eis.iilang.Percept |
performEntityAction(String name,
eis.iilang.Action action)
|
|
registerEntity(String name,
String type,
T entity)
Couples a name to an entity and parses it's annotations for percepts and
actions. |
|
registerEntity(String name,
String type,
T entity,
ActionHandler actionHandler,
PerceptHandler perceptHandler)
|
|
registerEntity(String name,
T entity)
Couples a name to an entity and parses it's annotations for percepts and
actions. |
|
registerEntity(String name,
T entity,
ActionHandler actionHandler,
PerceptHandler perceptHandler)
|
String |
requiredVersion()
|
| Methods inherited from class eis.EIDefaultImpl |
addEntity, addEntity, associateEntity, attachAgentListener, attachEnvironmentListener, detachAgentListener, detachEnvironmentListener, freeAgent, freeEntity, freePair, getAgents, getAllPercepts, getAssociatedAgents, getAssociatedEntities, getEntities, getFreeEntities, getState, getType, init, isInitSupported, isKillSupported, isPauseSupported, isStartSupported, isStateTransitionValid, isSupportedByEnvironment, isSupportedByType, kill, notifyAgents, notifyAgentsViaEntity, notifyDeletedEntity, notifyFreeEntity, notifyNewEntity, pause, performAction, queryEntityProperty, queryProperty, registerAgent, setState, setType, start, unregisterAgent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractEnvironment
public AbstractEnvironment()
registerEntity
public final <T> void registerEntity(String name,
T entity)
throws eis.exceptions.EntityException
- Couples a name to an entity and parses it's annotations for percepts and
actions.
- Parameters:
name - The name of the entity.entity - The entity itself.
- Throws:
eis.exceptions.EntityException - if the entity could not be added.
registerEntity
public final <T> void registerEntity(String name,
T entity,
ActionHandler actionHandler,
PerceptHandler perceptHandler)
throws eis.exceptions.EntityException
- Throws:
eis.exceptions.EntityException
registerEntity
public final <T> void registerEntity(String name,
String type,
T entity)
throws eis.exceptions.EntityException
- Couples a name to an entity and parses it's annotations for percepts and
actions.
- Parameters:
name - The name of the entity.type - The type of entityentity - The entity itself.
- Throws:
eis.exceptions.EntityException - if the entity could not be added.
registerEntity
public final <T> void registerEntity(String name,
String type,
T entity,
ActionHandler actionHandler,
PerceptHandler perceptHandler)
throws eis.exceptions.EntityException
- Throws:
eis.exceptions.EntityException
deleteEntity
public final void deleteEntity(String name)
throws eis.exceptions.EntityException,
eis.exceptions.RelationException
- Overrides:
deleteEntity in class eis.EIDefaultImpl
- Throws:
eis.exceptions.EntityException
eis.exceptions.RelationException
getEntity
public final <T> T getEntity(String name)
- Retrieve an entity for a given name.
- Type Parameters:
T - The class of entity to return.- Parameters:
name - The name of the entity.
getAllPerceptsFromEntity
protected final LinkedList<eis.iilang.Percept> getAllPerceptsFromEntity(String name)
throws eis.exceptions.PerceiveException,
eis.exceptions.NoEnvironmentException
- Specified by:
getAllPerceptsFromEntity in class eis.EIDefaultImpl
- Throws:
eis.exceptions.PerceiveException
eis.exceptions.NoEnvironmentException
isSupportedByEntity
protected final boolean isSupportedByEntity(eis.iilang.Action action,
String name)
- Specified by:
isSupportedByEntity in class eis.EIDefaultImpl
performEntityAction
protected final eis.iilang.Percept performEntityAction(String name,
eis.iilang.Action action)
throws eis.exceptions.ActException
- Specified by:
performEntityAction in class eis.EIDefaultImpl
- Throws:
eis.exceptions.ActException
requiredVersion
public final String requiredVersion()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.