Package jadex.bdiv3x.runtime
Class RBeliefbase.RBeliefSet
- java.lang.Object
-
- jadex.bdiv3.runtime.impl.RElement
-
- jadex.bdiv3x.runtime.RBeliefbase.RBeliefSet
-
- All Implemented Interfaces:
IBeliefSet,IElement
- Enclosing class:
- RBeliefbase
public class RBeliefbase.RBeliefSet extends jadex.bdiv3.runtime.impl.RElement implements IBeliefSet
-
-
Field Summary
Fields Modifier and Type Field Description protected ListWrapper<java.lang.Object>factsThe value.
-
Constructor Summary
Constructors Constructor Description RBeliefSet(MBelief modelelement, IInternalAccess agent)Create a new parameter.RBeliefSet(MBelief modelelement, IInternalAccess agent, java.lang.Object vals)Create a new parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> voidaddBeliefSetListener(IBeliefListener<T> listener)Add a belief set listener.voidaddFact(java.lang.Object fact)Add a fact to a belief.voidaddFacts(java.lang.Object[] facts)Add facts to a parameter set.booleancontainsFact(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.ObjectgetFact(java.lang.Object oldval)Get a value equal to the given object.java.lang.Object[]getFacts()Get the facts of a beliefset.java.lang.StringgetName()Get the name.protected java.util.List<java.lang.Object>internalGetValues()voidmodified(java.lang.Object fact)Indicate that the fact of this belief was modified.<T> voidremoveBeliefSetListener(IBeliefListener<T> listener)Remove a belief set listener.voidremoveFact(java.lang.Object fact)Remove a fact to a belief.voidremoveFacts()Remove all facts from a belief.intsize()Get the number of values currently contained in this set.-
Methods inherited from class jadex.bdiv3.runtime.impl.RElement
getAgent, getCapability, 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.bdiv3x.runtime.IElement
getModelElement
-
-
-
-
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:
addFactin interfaceIBeliefSet- Parameters:
fact- The new fact.
-
removeFact
public void removeFact(java.lang.Object fact)
Remove a fact to a belief.- Specified by:
removeFactin interfaceIBeliefSet- Parameters:
fact- The new fact.
-
addFacts
public void addFacts(java.lang.Object[] facts)
Add facts to a parameter set.- Specified by:
addFactsin interfaceIBeliefSet
-
removeFacts
public void removeFacts()
Remove all facts from a belief.- Specified by:
removeFactsin interfaceIBeliefSet
-
getFact
public java.lang.Object getFact(java.lang.Object oldval)
Get a value equal to the given object.- Specified by:
getFactin interfaceIBeliefSet- Parameters:
oldval- The old value.
-
containsFact
public boolean containsFact(java.lang.Object fact)
Test if a fact is contained in a belief.- Specified by:
containsFactin interfaceIBeliefSet- 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:
getFactsin interfaceIBeliefSet- Returns:
- The facts.
-
size
public int size()
Get the number of values currently contained in this set.- Specified by:
sizein interfaceIBeliefSet- Returns:
- The values count.
-
getClazz
public java.lang.Class<?> getClazz()
Get the value class.- Specified by:
getClazzin interfaceIBeliefSet- 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:
modifiedin interfaceIBeliefSet
-
addBeliefSetListener
public <T> void addBeliefSetListener(IBeliefListener<T> listener)
Add a belief set listener.- Specified by:
addBeliefSetListenerin interfaceIBeliefSet- Parameters:
listener- The belief set listener.
-
removeBeliefSetListener
public <T> void removeBeliefSetListener(IBeliefListener<T> listener)
Remove a belief set listener.- Specified by:
removeBeliefSetListenerin interfaceIBeliefSet- Parameters:
listener- The belief set listener.
-
internalGetValues
protected java.util.List<java.lang.Object> internalGetValues()
-
-