public class IndexedBB extends ChainBBAdapter
E.g. in a .mas2j project file:
agents: bob beliefBaseClass jason.bb.IndexedBB("student(key,_)", "depot(_,_,_)")
The belief "student/2" has the first argument as its key, so the BB will never has
two students with the same key. Or, two students in the BB will have two different keys.
The belief "depot/3" has no key, so there will be always only one "depot" in the BB.
When some belief with the same key than another belief in BB is added,
the most recent remains in the BB and the older is removed.
nextBB
APercept, ASelf, TPercept, TSelf
Constructor and Description |
---|
IndexedBB() |
IndexedBB(BeliefBase next) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Literal bel)
Adds a belief in the end of the BB, returns true if succeed.
|
BeliefBase |
clone() |
void |
init(Agent ag,
java.lang.String[] args)
Called before the MAS execution with the agent that uses this
BB and the args informed in .mas2j project.
Example in .mas2j: agent BeliefBaseClass(1,bla); the init args will be ["1", "bla"]. |
abolish, add, clear, contains, getAll, getAsDOM, getCandidateBeliefs, getCandidateBeliefs, getLastBB, getNextAdapter, getPercepts, getRelevant, iterator, remove, setNext, size, stop, toString
public IndexedBB()
public IndexedBB(BeliefBase next)
public void init(Agent ag, java.lang.String[] args)
BeliefBase
agent BeliefBaseClass(1,bla);
init
in interface BeliefBase
init
in class ChainBBAdapter
public boolean add(Literal bel)
BeliefBase
add
in interface BeliefBase
add
in class ChainBBAdapter
public BeliefBase clone()
clone
in interface BeliefBase
clone
in class ChainBBAdapter