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
  • Field Details

  • Constructor Details

  • Method Details

    • initParameters

      public void initParameters(Map<String,Object> vals, MConfigParameterElement config)
      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

      public abstract String getFetcherName()
      Get the name of the element in the fetcher (e.g. $goal).
      Returns:
      The element name in the fetcher name.
    • testWriteOK

      public void testWriteOK(MParameter mparam)
      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

      public IParameter createParameter(MParameter modelelement, String name, Object value)
    • createParameterSet

      public IParameterSet createParameterSet(MParameter modelelement, String name, List<jadex.common.UnparsedExpression> inivals)
    • createParameterSet

      public IParameterSet createParameterSet(MParameter modelelement, String name, Object values)
    • addParameter

      public void addParameter(IParameter param)
      Add a parameter.
      Parameters:
      param - The parameter.
    • addParameterSet

      public void addParameterSet(IParameterSet paramset)
      Add a parameterset.
      Parameters:
      paramset - The parameterset.
    • getParameters

      public IParameter[] getParameters()
      Get all parameters.
      Specified by:
      getParameters in interface IParameterElement
      Returns:
      All parameters.
    • getParameterSets

      public IParameterSet[] getParameterSets()
      Get all parameter sets.
      Specified by:
      getParameterSets in interface IParameterElement
      Returns:
      All parameter sets.
    • getParameter

      public IParameter getParameter(String name)
      Get the parameter element.
      Specified by:
      getParameter in interface IParameterElement
      Parameters:
      name - The name.
      Returns:
      The param.
    • getParameterSet

      public IParameterSet getParameterSet(String name)
      Get the parameter set element.
      Specified by:
      getParameterSet in interface IParameterElement
      Parameters:
      name - The name.
      Returns:
      The param set.
    • hasParameter

      public boolean hasParameter(String name)
      Has the element a parameter element.
      Specified by:
      hasParameter in interface IParameterElement
      Parameters:
      name - The name.
      Returns:
      True, if it has the parameter.
    • hasParameterSet

      public boolean hasParameterSet(String name)
      Has the element a parameter set element.
      Specified by:
      hasParameterSet in interface IParameterElement
      Parameters:
      name - The name.
      Returns:
      True, if it has the parameter set.
    • get

      public Object get(Object key)
      Get an object from the map.
      Specified by:
      get in interface jadex.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

      public String getType()
      Get the element type (i.e. the name declared in the ADF).
      Specified by:
      getType in interface IParameterElement
      Returns:
      The element type.