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>
facts
The 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> 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, 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:
addFact
in interfaceIBeliefSet
- Parameters:
fact
- The new fact.
-
removeFact
public void removeFact(java.lang.Object fact)
Remove a fact to a belief.- Specified by:
removeFact
in interfaceIBeliefSet
- Parameters:
fact
- The new fact.
-
addFacts
public void addFacts(java.lang.Object[] facts)
Add facts to a parameter set.- Specified by:
addFacts
in interfaceIBeliefSet
-
removeFacts
public void removeFacts()
Remove all facts from a belief.- Specified by:
removeFacts
in interfaceIBeliefSet
-
getFact
public java.lang.Object getFact(java.lang.Object oldval)
Get a value equal to the given object.- Specified by:
getFact
in 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:
containsFact
in 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:
getFacts
in interfaceIBeliefSet
- Returns:
- The facts.
-
size
public int size()
Get the number of values currently contained in this set.- Specified by:
size
in interfaceIBeliefSet
- Returns:
- The values count.
-
getClazz
public java.lang.Class<?> getClazz()
Get the value class.- Specified by:
getClazz
in 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:
modified
in interfaceIBeliefSet
-
addBeliefSetListener
public <T> void addBeliefSetListener(IBeliefListener<T> listener)
Add a belief set listener.- Specified by:
addBeliefSetListener
in interfaceIBeliefSet
- Parameters:
listener
- The belief set listener.
-
removeBeliefSetListener
public <T> void removeBeliefSetListener(IBeliefListener<T> listener)
Remove a belief set listener.- Specified by:
removeBeliefSetListener
in interfaceIBeliefSet
- Parameters:
listener
- The belief set listener.
-
internalGetValues
protected java.util.List<java.lang.Object> internalGetValues()
-
-