edu.udo.cs.ie.cowbots.bdi.brf
Class BeliefBase

Package class diagram package BeliefBase
java.lang.Object
  extended by edu.udo.cs.ie.cowbots.bdi.brf.BeliefBase

public class BeliefBase
extends java.lang.Object

This class holds the belief base from the Cowbot-BDI-model, in which the belief base consists of information objects. An information object is a pair of ELP and meta-information (usually time and agent source).


Field Summary
 ELPLiteral agIson
           
(package private)  Annotator annot
           
(package private)  java.util.List<ELP> bsetprograms
           
private  java.util.List<java.util.List<InformationObject>> ioList
           
(package private)  IdentTable itab
           
private  java.util.Map<IKnowledgeOperator,java.util.Set<ELPLiteral>> kopDeleteBuffer
           
private  java.util.Map<IKnowledgeOperator,java.util.List<InformationObject>> kopInputBuffer
           
private  java.util.List<IKnowledgeOperator> kopOrder
           
(package private)  MapOperator map
           
private  java.util.Map<IKnowledgeOperator,java.util.List<InformationObject>> opDomain
           
private  java.util.Queue<Message> pendingMessages
           
private  java.util.List<InformationObject> programs
           
(package private)  UpdatePolicy upol
           
(package private)  java.util.Map<java.lang.String,ELP> userprograms
           
 
Constructor Summary
BeliefBase()
          default constructor
 
Method Summary
 void addBeliefSetProgram(ELP program)
          adds a program that operates on the belief set of an agent. those programs are concatenated at the belief state.
 void addFacts(java.util.Collection<ELPLiteral> facts, java.lang.String source)
          adds facts from a given source to the belief base
 void addMessage(Message m)
          this functions stores an unprocessed message in the agents belief base
 void addProgram(ELP program, java.lang.String source, int time)
          adds a program from a given source into the belief base. if no source is given, the source is set to the agent itself.
 void addProgram(InformationObject program)
           
 void addUserProgram(java.lang.String name, ELP program)
          adds a program with a given name that is only stored, but not used by the revision.
 void clear()
          this method deletes all information object stored in the belief base.
 void deleteFacts(java.util.Set<ELPLiteral> factsToDelete)
          delete facts from the belief base.
 java.util.List<InformationObject> getAllIO()
          returns a list with all information objects in the belief base.
 Annotator getAnnotator()
          this method returns the annotator associated with this belief base
 java.util.List<ELP> getBeliefSetPrograms()
          returns a collection of programs that should be part of the belief state, but are not part of a revision process. these programs are used to perform calculations over an answer set, and the user has to take care the head alphabets of programs are consistent with ordinary programs in the beliefs of an agent.
 IdentTable getIdentifiers()
          returns the identifier table associated with this belief base (optional element)
 java.util.List<IKnowledgeOperator> getKnowledgeOperators()
          this method returns the list of all knowledge operators in order defined in the update policy.
 MapOperator getMapOperator()
          returns the map operator associated with the belief base. in any belief base, only one map operator may exist.
 java.util.Queue<Message> getMessages()
          this function returns the queue of all unprocessed messages.
 java.util.List<InformationObject> getOperatorIO(IKnowledgeOperator op)
          returns the area of information objects within the belief base associated with a knowledge operator
 ELP getProgram(java.lang.String name)
          returns a uniquely-named program that is stored in the belief base of an agent.
 UpdatePolicy getUpdatePolicy()
           
 void registerKnowledgeOperator(IKnowledgeOperator kop)
          registers a knowledge operator to the belief base. this method is responsible for setting up a domain of information objects for new (unknown) operators
 void reset()
          resets the belief base
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ioList

private java.util.List<java.util.List<InformationObject>> ioList

programs

private java.util.List<InformationObject> programs

opDomain

private java.util.Map<IKnowledgeOperator,java.util.List<InformationObject>> opDomain

pendingMessages

private java.util.Queue<Message> pendingMessages

itab

IdentTable itab

map

MapOperator map

annot

Annotator annot

upol

UpdatePolicy upol

kopInputBuffer

private java.util.Map<IKnowledgeOperator,java.util.List<InformationObject>> kopInputBuffer

kopDeleteBuffer

private java.util.Map<IKnowledgeOperator,java.util.Set<ELPLiteral>> kopDeleteBuffer

kopOrder

private java.util.List<IKnowledgeOperator> kopOrder

userprograms

java.util.Map<java.lang.String,ELP> userprograms

bsetprograms

java.util.List<ELP> bsetprograms

agIson

public ELPLiteral agIson
Constructor Detail

BeliefBase

public BeliefBase()
default constructor

Method Detail

getAnnotator

public Annotator getAnnotator()
this method returns the annotator associated with this belief base

Returns:
instance of an annotator

getUpdatePolicy

public UpdatePolicy getUpdatePolicy()

registerKnowledgeOperator

public void registerKnowledgeOperator(IKnowledgeOperator kop)
registers a knowledge operator to the belief base. this method is responsible for setting up a domain of information objects for new (unknown) operators

Parameters:
kop - knowledge operator to register

getOperatorIO

public java.util.List<InformationObject> getOperatorIO(IKnowledgeOperator op)
returns the area of information objects within the belief base associated with a knowledge operator

Parameters:
op - knowledge operator
Returns:
list of information objects which belong to knowledge operator op

getAllIO

public java.util.List<InformationObject> getAllIO()
returns a list with all information objects in the belief base.

Returns:
list of all information objects

addMessage

public void addMessage(Message m)
this functions stores an unprocessed message in the agents belief base

Parameters:
m - message to store

getMessages

public java.util.Queue<Message> getMessages()
this function returns the queue of all unprocessed messages.

Returns:

clear

public void clear()
this method deletes all information object stored in the belief base.


getIdentifiers

public IdentTable getIdentifiers()
returns the identifier table associated with this belief base (optional element)

Returns:
IdentTable instance

getMapOperator

public MapOperator getMapOperator()
returns the map operator associated with the belief base. in any belief base, only one map operator may exist.

Returns:
map operator

addProgram

public void addProgram(InformationObject program)

addProgram

public void addProgram(ELP program,
                       java.lang.String source,
                       int time)
adds a program from a given source into the belief base. if no source is given, the source is set to the agent itself.

Parameters:
program -
source -
time -

addFacts

public void addFacts(java.util.Collection<ELPLiteral> facts,
                     java.lang.String source)
adds facts from a given source to the belief base

Parameters:
facts - literals to add
source - source of literals (null for an agent itself)

deleteFacts

public void deleteFacts(java.util.Set<ELPLiteral> factsToDelete)
delete facts from the belief base.

Parameters:
factsToDelete -

getProgram

public ELP getProgram(java.lang.String name)
returns a uniquely-named program that is stored in the belief base of an agent.

Parameters:
name - progam name
Returns:
logical program

addUserProgram

public void addUserProgram(java.lang.String name,
                           ELP program)
adds a program with a given name that is only stored, but not used by the revision.

Parameters:
name - program name
program - logical program

addBeliefSetProgram

public void addBeliefSetProgram(ELP program)
adds a program that operates on the belief set of an agent. those programs are concatenated at the belief state.

Parameters:
program -

getBeliefSetPrograms

public java.util.List<ELP> getBeliefSetPrograms()
returns a collection of programs that should be part of the belief state, but are not part of a revision process. these programs are used to perform calculations over an answer set, and the user has to take care the head alphabets of programs are consistent with ordinary programs in the beliefs of an agent.

Returns:

getKnowledgeOperators

public java.util.List<IKnowledgeOperator> getKnowledgeOperators()
this method returns the list of all knowledge operators in order defined in the update policy.

Returns:
list of knowledge operators

reset

public void reset()
resets the belief base