|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.ie.cowbots.bdi.brf.BeliefSet
public class BeliefSet
This class holds the belief set from the Cowbot-BDI-model. Beside simple set-container functionality, the cowbot belief set allows to search for beliefs that matches a given predicate symbol.
Field Summary | |
---|---|
protected java.util.Set<ELPLiteral> |
bels
|
protected IdentTable |
idents
|
protected java.util.Map<java.lang.String,java.util.List<ELPLiteral>> |
indexedBels
|
Constructor Summary | |
---|---|
BeliefSet(java.util.Set<ELPLiteral> bel,
IdentTable ids)
constructs a new belief set with given beliefs |
Method Summary | |
---|---|
void |
addBelief(ELPLiteral l)
adds a belief to the belief set (doesn't neccessary means that it was added to the belief base before, or it will survive the next revision cycle). |
void |
deleteBelief(ELPLiteral l)
removes a literal from the belief set |
java.util.List<ELPLiteral> |
findAll(java.lang.String functor)
returns a list of all literals matching a given functor |
ELPLiteral |
findFirst(java.lang.String functor)
returns the first predicate found in the belief set starting with a matching functor |
java.util.Set<ELPLiteral> |
getBeliefs()
|
java.util.List<ELPLiteral> |
getBeliefsByPredicate(java.lang.String predicate)
returns all beliefs that starts with a predicate |
IdentTable |
getIdentifiers()
returns an IdentTable lookup instance or null (optional operation). |
protected void |
indexBeliefs()
auxiliary function that indexes all beliefs by their predicate symbol |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Set<ELPLiteral> bels
protected IdentTable idents
protected java.util.Map<java.lang.String,java.util.List<ELPLiteral>> indexedBels
Constructor Detail |
---|
public BeliefSet(java.util.Set<ELPLiteral> bel, IdentTable ids)
bel
- initial beliefsMethod Detail |
---|
protected void indexBeliefs()
public java.util.Set<ELPLiteral> getBeliefs()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<ELPLiteral> getBeliefsByPredicate(java.lang.String predicate)
predicate
- functor name to look for
public void deleteBelief(ELPLiteral l)
l
- literal to deletepublic void addBelief(ELPLiteral l)
l
- literal to addpublic IdentTable getIdentifiers()
public ELPLiteral findFirst(java.lang.String functor)
functor
- literal with functor name to search for
public java.util.List<ELPLiteral> findAll(java.lang.String functor)
functor
- predicate symbol to look for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |