public class RBeliefbase extends RElement implements IBeliefbase, IMapAccess
Modifier and Type | Class and Description |
---|---|
class |
RBeliefbase.RBelief
static: belief is evaluated once on init, afterwards set manually
pull: belief is reevaluated on each read access
push: reevaluates on each event and sets the new value and throws change event
polling/updaterate: reevaluates in intervals and and sets the new value and throws change event
|
class |
RBeliefbase.RBeliefSet |
Modifier and Type | Field and 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 and Description |
---|
RBeliefbase(IInternalAccess agent)
Create a new beliefbase.
|
Modifier and Type | Method and Description |
---|---|
void |
addBelief(RBeliefbase.RBelief bel)
Add a belief.
|
void |
addBeliefSet(RBeliefbase.RBeliefSet belset)
Add a beliefset.
|
boolean |
containsBelief(java.lang.String name)
Returns
|
boolean |
containsBeliefSet(java.lang.String name)
Returns
|
java.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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getModelElement
protected java.util.Map<java.lang.String,IBelief> beliefs
protected java.util.Map<java.lang.String,IBeliefSet> beliefsets
protected java.lang.String[] names
protected java.lang.String[] setnames
public RBeliefbase(IInternalAccess agent)
public void init()
public IBelief getBelief0(java.lang.String name)
name
- The belief name.public IBeliefSet getBeliefSet0(java.lang.String name)
name
- The belief set name.public IBelief getBelief(java.lang.String name)
getBelief
in interface IBeliefbase
name
- The belief name.public IBeliefSet getBeliefSet(java.lang.String name)
getBeliefSet
in interface IBeliefbase
name
- The belief set name.public boolean containsBelief(java.lang.String name)
containsBelief
in interface IBeliefbase
name
- the name of a belief.true
if contained, false
is not contained, or
the specified name refer to a belief set.containsBeliefSet(java.lang.String)
public boolean containsBeliefSet(java.lang.String name)
containsBeliefSet
in interface IBeliefbase
name
- the name of a belief set.true
if contained, false
is not contained, or
the specified name refer to a belief.containsBelief(java.lang.String)
public java.lang.String[] getBeliefNames()
getBeliefNames
in interface IBeliefbase
public java.lang.String[] getBeliefSetNames()
getBeliefSetNames
in interface IBeliefbase
public void addBelief(RBeliefbase.RBelief bel)
bel
- The belief.public void addBeliefSet(RBeliefbase.RBeliefSet belset)
bel
- The beliefset.public java.lang.Object get(java.lang.Object key)
get
in interface IMapAccess
key
- The key