Class RBeliefbase.RBeliefSet

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ListWrapper<java.lang.Object> facts
      The value.
      • Fields inherited from class jadex.bdiv3.runtime.impl.RElement

        agent, cnt, id, modelelement
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> void addBeliefSetListener​(IBeliefListener<T> listener)
      Add a belief set listener.
      void addFact​(java.lang.Object fact)
      Add a fact to a belief.
      void addFacts​(java.lang.Object[] facts)
      Add facts to a parameter set.
      boolean containsFact​(java.lang.Object fact)
      Test if a fact is contained in a belief.
      protected java.util.List<java.lang.Object> evaluateValues()
      Evaluate the default values.
      java.lang.Class<?> getClazz()
      Get the value class.
      java.lang.Object getFact​(java.lang.Object oldval)
      Get a value equal to the given object.
      java.lang.Object[] getFacts()
      Get the facts of a beliefset.
      java.lang.String getName()
      Get the name.
      protected java.util.List<java.lang.Object> internalGetValues()  
      void modified​(java.lang.Object fact)
      Indicate that the fact of this belief was modified.
      <T> void removeBeliefSetListener​(IBeliefListener<T> listener)
      Remove a belief set listener.
      void removeFact​(java.lang.Object fact)
      Remove a fact to a belief.
      void removeFacts()
      Remove all facts from a belief.
      int size()
      Get the number of values currently contained in this set.
      • Methods inherited from class jadex.bdiv3.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
    • Field Detail

      • facts

        protected ListWrapper<java.lang.Object> facts
        The value.
    • Constructor Detail

      • RBeliefSet

        public RBeliefSet​(MBelief modelelement,
                          IInternalAccess agent,
                          java.lang.Object vals)
        Create a new parameter.
        Parameters:
        modelelement - The model element.
        name - The name.
        vals - The values as array, list, iterable...
      • RBeliefSet

        public RBeliefSet​(MBelief modelelement,
                          IInternalAccess agent)
        Create a new parameter.
        Parameters:
        modelelement - The model element.
        name - The name.
    • Method Detail

      • evaluateValues

        protected java.util.List<java.lang.Object> evaluateValues()
        Evaluate the default values.
      • getName

        public java.lang.String getName()
        Get the name.
        Returns:
        The name
      • addFact

        public void addFact​(java.lang.Object fact)
        Add a fact to a belief.
        Specified by:
        addFact in interface IBeliefSet
        Parameters:
        fact - The new fact.
      • removeFact

        public void removeFact​(java.lang.Object fact)
        Remove a fact to a belief.
        Specified by:
        removeFact in interface IBeliefSet
        Parameters:
        fact - The new fact.
      • addFacts

        public void addFacts​(java.lang.Object[] facts)
        Add facts to a parameter set.
        Specified by:
        addFacts in interface IBeliefSet
      • removeFacts

        public void removeFacts()
        Remove all facts from a belief.
        Specified by:
        removeFacts in interface IBeliefSet
      • getFact

        public java.lang.Object getFact​(java.lang.Object oldval)
        Get a value equal to the given object.
        Specified by:
        getFact in interface IBeliefSet
        Parameters:
        oldval - The old value.
      • containsFact

        public boolean containsFact​(java.lang.Object fact)
        Test if a fact is contained in a belief.
        Specified by:
        containsFact in interface IBeliefSet
        Parameters:
        fact - The fact to test.
        Returns:
        True, if fact is contained.
      • getFacts

        public java.lang.Object[] getFacts()
        Get the facts of a beliefset.
        Specified by:
        getFacts in interface IBeliefSet
        Returns:
        The facts.
      • size

        public int size()
        Get the number of values currently contained in this set.
        Specified by:
        size in interface IBeliefSet
        Returns:
        The values count.
      • getClazz

        public java.lang.Class<?> getClazz()
        Get the value class.
        Specified by:
        getClazz in interface IBeliefSet
        Returns:
        The valuec class.
      • modified

        public void modified​(java.lang.Object fact)
        Indicate that the fact of this belief was modified. Calling this method causes an internal fact changed event that might cause dependent actions.
        Specified by:
        modified in interface IBeliefSet
      • addBeliefSetListener

        public <T> void addBeliefSetListener​(IBeliefListener<T> listener)
        Add a belief set listener.
        Specified by:
        addBeliefSetListener in interface IBeliefSet
        Parameters:
        listener - The belief set listener.
      • removeBeliefSetListener

        public <T> void removeBeliefSetListener​(IBeliefListener<T> listener)
        Remove a belief set listener.
        Specified by:
        removeBeliefSetListener in interface IBeliefSet
        Parameters:
        listener - The belief set listener.
      • internalGetValues

        protected java.util.List<java.lang.Object> internalGetValues()