edu.udo.cs.ie.cowbots.bdi.brf.operators
Class IdentTableOperator

Package class diagram package IdentTableOperator
java.lang.Object
  extended by edu.udo.cs.ie.cowbots.bdi.brf.operators.IdentTableOperator
All Implemented Interfaces:
IdentTable, IKnowledgeOperator

public class IdentTableOperator
extends java.lang.Object
implements IKnowledgeOperator, IdentTable

this class is the default implementation of an IdentTable operator. it associates identifiers with the first term, and assures that each unique identifier is only stored once in the belief base.


Field Summary
(package private)  java.util.Set<java.lang.String> identifiers
           
(package private)  java.util.Set<java.lang.String> identPredicates
           
(package private)  java.util.Map<java.lang.String,java.util.List<java.lang.String>> termLookup
           
 
Constructor Summary
IdentTableOperator()
          default constructor
 
Method Summary
 java.util.List<java.lang.String> allIdentifiers(java.lang.String term)
          returns all known predicates associated with a term
 void deleteFacts(java.util.Set<ELPLiteral> toDel)
          the optional operation deleteFacts is not supported by this operator.
 ELP getStateProgram()
          method that returns an extended logical programm (or null) that is concatenated to the belief state, therefore bypassing any belief state construction.
 java.util.Set<java.lang.String> identPredicates()
          returns the set of functor names that represent all identifier predicates
 void init(org.w3c.dom.Element config)
          default initialization routine, will be called by the revision engine with a configuration description in xml
 boolean isKindOf(java.lang.String term, java.lang.String identPredicate)
          checks if a given term is true for a given identifier
 void processBeliefSet(BeliefSet bs, BeliefBase base)
          method that is called after the revision (asp call and answer set clearance) to add/delete beliefs to the belief set. the behavior depends on the implemented knowledge operator semantics.
 void reset()
          resets the knowledge operator, putting it back into a neutral state.
 boolean update(java.util.List<InformationObject> updates, BeliefBase bb)
          this method integrates information objects into the belief base.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identPredicates

java.util.Set<java.lang.String> identPredicates

identifiers

java.util.Set<java.lang.String> identifiers

termLookup

java.util.Map<java.lang.String,java.util.List<java.lang.String>> termLookup
Constructor Detail

IdentTableOperator

public IdentTableOperator()
default constructor

Method Detail

init

public void init(org.w3c.dom.Element config)
Description copied from interface: IKnowledgeOperator
default initialization routine, will be called by the revision engine with a configuration description in xml

Specified by:
init in interface IKnowledgeOperator
Parameters:
config - XML Element describing operator setup

update

public boolean update(java.util.List<InformationObject> updates,
                      BeliefBase bb)
Description copied from interface: IKnowledgeOperator
this method integrates information objects into the belief base.

Specified by:
update in interface IKnowledgeOperator
Parameters:
updates - new information objects
bb - operator's belief base
Returns:
true if something changed (false otherwise).

isKindOf

public boolean isKindOf(java.lang.String term,
                        java.lang.String identPredicate)
Description copied from interface: IdentTable
checks if a given term is true for a given identifier

Specified by:
isKindOf in interface IdentTable
Parameters:
term - argument to check
identPredicate - identifier predicate
Returns:
true if identPredicate(term,...) holds

allIdentifiers

public java.util.List<java.lang.String> allIdentifiers(java.lang.String term)
Description copied from interface: IdentTable
returns all known predicates associated with a term

Specified by:
allIdentifiers in interface IdentTable
Parameters:
term - term to lookup
Returns:
list of predicates like p(term,...)

deleteFacts

public void deleteFacts(java.util.Set<ELPLiteral> toDel)
the optional operation deleteFacts is not supported by this operator.

Specified by:
deleteFacts in interface IKnowledgeOperator
Parameters:
toDel - set of (head) literals to purge from the belief base

identPredicates

public java.util.Set<java.lang.String> identPredicates()
Description copied from interface: IdentTable
returns the set of functor names that represent all identifier predicates

Specified by:
identPredicates in interface IdentTable
Returns:
set of identifier functors

processBeliefSet

public void processBeliefSet(BeliefSet bs,
                             BeliefBase base)
Description copied from interface: IKnowledgeOperator
method that is called after the revision (asp call and answer set clearance) to add/delete beliefs to the belief set. the behavior depends on the implemented knowledge operator semantics.

Specified by:
processBeliefSet in interface IKnowledgeOperator

getStateProgram

public ELP getStateProgram()
Description copied from interface: IKnowledgeOperator
method that returns an extended logical programm (or null) that is concatenated to the belief state, therefore bypassing any belief state construction.

Specified by:
getStateProgram in interface IKnowledgeOperator
Returns:
null or elp to add to the belief state

reset

public void reset()
Description copied from interface: IKnowledgeOperator
resets the knowledge operator, putting it back into a neutral state.

Specified by:
reset in interface IKnowledgeOperator