Package jadex.bdi.runtime.impl
Class RParameterElement
java.lang.Object
jadex.bdi.runtime.impl.RElement
jadex.bdi.runtime.impl.RParameterElement
- All Implemented Interfaces:
IElement
,IParameterElement
,jadex.javaparser.IMapAccess
- Direct Known Subclasses:
RPlan
,RProcessableElement
public abstract class RParameterElement
extends RElement
implements IParameterElement, jadex.javaparser.IMapAccess
Base element for elements with parameters such as:
- message event
- internal event
- goal
- plan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map
<String, IParameter> The parameters.protected Map
<String, IParameterSet> The parameter sets.Fields inherited from class jadex.bdi.runtime.impl.RElement
cnt, id, modelelement
-
Constructor Summary
ConstructorsConstructorDescriptionRParameterElement
(MParameterElement melement, Map<String, Object> vals, MConfigParameterElement config) Create a new parameter element. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(IParameter param) Add a parameter.void
addParameterSet
(IParameterSet paramset) Add a parameterset.createParameter
(MParameter modelelement, String name, jadex.common.UnparsedExpression inival) createParameter
(MParameter modelelement, String name, Object value) createParameterSet
(MParameter modelelement, String name, Object values) createParameterSet
(MParameter modelelement, String name, List<jadex.common.UnparsedExpression> inivals) Get an object from the map.abstract String
Get the name of the element in the fetcher (e.g.getParameter
(String name) Get the parameter element.Get all parameters.getParameterSet
(String name) Get the parameter set element.Get all parameter sets.getType()
Get the element type (i.e.boolean
hasParameter
(String name) Has the element a parameter element.boolean
hasParameterSet
(String name) Has the element a parameter set element.void
initParameters
(Map<String, Object> vals, MConfigParameterElement config) Create the parameters from model spec.abstract boolean
Check if the element is currently part of the agent's reasoning.void
testWriteOK
(MParameter mparam) Test if parameter writes are currently allowed.jadex.javaparser.SimpleValueFetcher
wrapFetcher
(jadex.common.IValueFetcher fetcher) Wrap the fetcher to include the element itself.Methods inherited from class jadex.bdi.runtime.impl.RElement
getAgent, getCapability, getCount, getId, getMCapability, getModelElement, getRuleSystem, setId, setModelElement, toString
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
-
parameters
The parameters. -
parametersets
The parameter sets.
-
-
Constructor Details
-
RParameterElement
public RParameterElement(MParameterElement melement, Map<String, Object> vals, MConfigParameterElement config) Create a new parameter element.
-
-
Method Details
-
initParameters
Create the parameters from model spec. -
wrapFetcher
public jadex.javaparser.SimpleValueFetcher wrapFetcher(jadex.common.IValueFetcher fetcher) Wrap the fetcher to include the element itself. -
getFetcherName
Get the name of the element in the fetcher (e.g. $goal).- Returns:
- The element name in the fetcher name.
-
testWriteOK
Test if parameter writes are currently allowed.- Throws:
Exception
- when write not ok.
-
createParameter
public IParameter createParameter(MParameter modelelement, String name, jadex.common.UnparsedExpression inival) -
createParameter
-
createParameterSet
public IParameterSet createParameterSet(MParameter modelelement, String name, List<jadex.common.UnparsedExpression> inivals) -
createParameterSet
-
addParameter
Add a parameter.- Parameters:
param
- The parameter.
-
addParameterSet
Add a parameterset.- Parameters:
paramset
- The parameterset.
-
getParameters
Get all parameters.- Specified by:
getParameters
in interfaceIParameterElement
- Returns:
- All parameters.
-
getParameterSets
Get all parameter sets.- Specified by:
getParameterSets
in interfaceIParameterElement
- Returns:
- All parameter sets.
-
getParameter
Get the parameter element.- Specified by:
getParameter
in interfaceIParameterElement
- Parameters:
name
- The name.- Returns:
- The param.
-
getParameterSet
Get the parameter set element.- Specified by:
getParameterSet
in interfaceIParameterElement
- Parameters:
name
- The name.- Returns:
- The param set.
-
hasParameter
Has the element a parameter element.- Specified by:
hasParameter
in interfaceIParameterElement
- Parameters:
name
- The name.- Returns:
- True, if it has the parameter.
-
hasParameterSet
Has the element a parameter set element.- Specified by:
hasParameterSet
in interfaceIParameterElement
- Parameters:
name
- The name.- Returns:
- True, if it has the parameter set.
-
get
Get an object from the map.- Specified by:
get
in interfacejadex.javaparser.IMapAccess
- Parameters:
key
- The key- Returns:
- The value.
-
isAdopted
public abstract 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. -
getType
Get the element type (i.e. the name declared in the ADF).- Specified by:
getType
in interfaceIParameterElement
- Returns:
- The element type.
-