Package jadex.bdiv3x.runtime
Class RBeliefbase
- java.lang.Object
-
- jadex.bdiv3.runtime.impl.RElement
-
- jadex.bdiv3x.runtime.RBeliefbase
-
- All Implemented Interfaces:
IBeliefbase
,IElement
,IMapAccess
public class RBeliefbase extends jadex.bdiv3.runtime.impl.RElement implements IBeliefbase, IMapAccess
Runtime element for storing beliefs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
RBeliefbase.RBelief
Deprecated.class
RBeliefbase.RBeliefSet
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,IBelief>
beliefs
The beliefs.protected java.util.Map<java.lang.String,IBeliefSet>
beliefsets
The belief sets.protected java.lang.String[]
names
The local belief names (cached on first access).protected java.lang.String[]
setnames
The local belief set names (cached on first access).
-
Constructor Summary
Constructors Constructor Description RBeliefbase(IInternalAccess agent)
Create a new beliefbase.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBelief(RBeliefbase.RBelief bel)
Add a belief.void
addBeliefSet(RBeliefbase.RBeliefSet belset)
Add a beliefset.boolean
containsBelief(java.lang.String name)
Returnsboolean
containsBeliefSet(java.lang.String name)
Returnsjava.lang.Object
get(java.lang.Object key)
Get an object from the map.IBelief
getBelief(java.lang.String name)
Get a belief for a name.IBelief
getBelief0(java.lang.String name)
Get a belief for a name.java.lang.String[]
getBeliefNames()
Returns the names of all beliefs.IBeliefSet
getBeliefSet(java.lang.String name)
Get a belief set for a name.IBeliefSet
getBeliefSet0(java.lang.String name)
Get a belief set for a name.java.lang.String[]
getBeliefSetNames()
Returns the names of all belief sets.void
init()
Init the beliefbase.-
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
-
Methods inherited from interface jadex.bdiv3x.runtime.IElement
getCount, getId, getModelElement
-
-
-
-
Field Detail
-
beliefs
protected java.util.Map<java.lang.String,IBelief> beliefs
The beliefs.
-
beliefsets
protected java.util.Map<java.lang.String,IBeliefSet> beliefsets
The belief sets.
-
names
protected java.lang.String[] names
The local belief names (cached on first access).
-
setnames
protected java.lang.String[] setnames
The local belief set names (cached on first access).
-
-
Constructor Detail
-
RBeliefbase
public RBeliefbase(IInternalAccess agent)
Create a new beliefbase.
-
-
Method Detail
-
init
public void init()
Init the beliefbase.
-
getBelief0
public IBelief getBelief0(java.lang.String name)
Get a belief for a name.- Parameters:
name
- The belief name.
-
getBeliefSet0
public IBeliefSet getBeliefSet0(java.lang.String name)
Get a belief set for a name.- Parameters:
name
- The belief set name.
-
getBelief
public IBelief getBelief(java.lang.String name)
Get a belief for a name.- Specified by:
getBelief
in interfaceIBeliefbase
- Parameters:
name
- The belief name.
-
getBeliefSet
public IBeliefSet getBeliefSet(java.lang.String name)
Get a belief set for a name.- Specified by:
getBeliefSet
in interfaceIBeliefbase
- Parameters:
name
- The belief set name.
-
containsBelief
public boolean containsBelief(java.lang.String name)
Returns- Specified by:
containsBelief
in interfaceIBeliefbase
- Parameters:
name
- the name of a belief.- Returns:
true
if contained,false
is not contained, or the specified name refer to a belief set.- See Also:
containsBeliefSet(java.lang.String)
-
containsBeliefSet
public boolean containsBeliefSet(java.lang.String name)
Returns- Specified by:
containsBeliefSet
in interfaceIBeliefbase
- Parameters:
name
- the name of a belief set.- Returns:
true
if contained,false
is not contained, or the specified name refer to a belief.- See Also:
containsBelief(java.lang.String)
-
getBeliefNames
public java.lang.String[] getBeliefNames()
Returns the names of all beliefs.- Specified by:
getBeliefNames
in interfaceIBeliefbase
- Returns:
- the names of all beliefs.
-
getBeliefSetNames
public java.lang.String[] getBeliefSetNames()
Returns the names of all belief sets.- Specified by:
getBeliefSetNames
in interfaceIBeliefbase
- Returns:
- the names of all belief sets.
-
addBelief
public void addBelief(RBeliefbase.RBelief bel)
Add a belief.- Parameters:
bel
- The belief.
-
addBeliefSet
public void addBeliefSet(RBeliefbase.RBeliefSet belset)
Add a beliefset.- Parameters:
bel
- The beliefset.
-
get
public java.lang.Object get(java.lang.Object key)
Get an object from the map.- Specified by:
get
in interfaceIMapAccess
- Parameters:
key
- The key- Returns:
- The value.
-
-