Package jadex.bdi.runtime.impl
Class RFinishableElement
java.lang.Object
jadex.bdi.runtime.impl.RElement
jadex.bdi.runtime.impl.RParameterElement
jadex.bdi.runtime.impl.RProcessableElement
jadex.bdi.runtime.impl.RFinishableElement
- All Implemented Interfaces:
IElement
,IFinishableElement<Void>
,IParameterElement
,jadex.javaparser.IMapAccess
- Direct Known Subclasses:
RGoal
public abstract class RFinishableElement
extends RProcessableElement
implements IFinishableElement<Void>
Element that can be finished with processing.
-
Nested Class Summary
Nested classes/interfaces inherited from class jadex.bdi.runtime.impl.RProcessableElement
RProcessableElement.State
Nested classes/interfaces inherited from class jadex.bdi.runtime.impl.RParameterElement
RParameterElement.RParameter, RParameterElement.RParameterSet
-
Field Summary
FieldsFields inherited from class jadex.bdi.runtime.impl.RProcessableElement
apl, pojoelement, state, triedplans
Fields inherited from class jadex.bdi.runtime.impl.RParameterElement
parameters, parametersets
Fields inherited from class jadex.bdi.runtime.impl.RElement
cnt, id, modelelement
-
Constructor Summary
ConstructorsConstructorDescriptionRFinishableElement
(MProcessableElement modelelement, Object pojoelement, Map<String, Object> vals, MConfigParameterElement config) Create a new element. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(jadex.future.IResultListener<Void> listener) Add a new listener to get notified when the goal is finished.Get the exception.Get the listeners.boolean
Check if the element is currently part of the agent's reasoning.abstract boolean
isFailed()
Test if element is failed.boolean
Test if goal is finished.abstract boolean
Test if element is succeeded.void
Notify the listeners.void
removeListener
(jadex.future.IResultListener<Void> listener) Remove a listener.void
setException
(Exception exception) Set the exception.Methods inherited from class jadex.bdi.runtime.impl.RProcessableElement
addTriedPlan, getApplicablePlanList, getPojoElement, getState, getTriedPlans, planFinished, setApplicablePlanList, setPojoElement, setState, setTriedPlans, testWriteOK, toString
Methods inherited from class jadex.bdi.runtime.impl.RParameterElement
addParameter, addParameterSet, createParameter, createParameter, createParameterSet, createParameterSet, get, getFetcherName, getParameter, getParameters, getParameterSet, getParameterSets, getType, hasParameter, hasParameterSet, initParameters, wrapFetcher
Methods inherited from class jadex.bdi.runtime.impl.RElement
getAgent, getCapability, getCount, getId, getMCapability, getModelElement, getRuleSystem, setId, setModelElement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface jadex.bdi.runtime.IElement
getCount, getId, getModelElement
-
Field Details
-
exception
The exception. -
listeners
The listeners.
-
-
Constructor Details
-
RFinishableElement
public RFinishableElement(MProcessableElement modelelement, Object pojoelement, Map<String, Object> vals, MConfigParameterElement config) Create a new element.
-
-
Method Details
-
addListener
Add a new listener to get notified when the goal is finished.- Specified by:
addListener
in interfaceIFinishableElement<Void>
- Parameters:
listener
- The listener.
-
removeListener
Remove a listener.- Specified by:
removeListener
in interfaceIFinishableElement<Void>
- Parameters:
listener
- The listener.
-
getListeners
Get the listeners.- Returns:
- The listeners.
-
getException
Get the exception.- Specified by:
getException
in interfaceIFinishableElement<Void>
- Returns:
- The exception.
-
setException
Set the exception.- Parameters:
exception
- The exception to set.
-
notifyListeners
public void notifyListeners()Notify the listeners. -
isSucceeded
public abstract boolean isSucceeded()Test if element is succeeded.- Specified by:
isSucceeded
in interfaceIFinishableElement<Void>
- Returns:
- True, if is succeeded.
-
isFailed
public abstract boolean isFailed()Test if element is failed.- Specified by:
isFailed
in interfaceIFinishableElement<Void>
- Returns:
- True, if is failed.
-
isFinished
public boolean isFinished()Test if goal is finished.- Specified by:
isFinished
in interfaceIFinishableElement<Void>
- Returns:
- True, if is finished.
-
isAdopted
public boolean isAdopted()Check if the element is currently part of the agent's reasoning. E.g. the bases are always adopted and all of their contents such as goals, plans and beliefs.- Specified by:
isAdopted
in classRParameterElement
-