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

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

public class MapUpdate
extends java.lang.Object
implements IKnowledgeOperator, MapOperator

a specialized operator for handling map updates. most parts of the map are empty or don't change at all, like obstacles. an inference would reject multiple those cell over and over, so it might be better to handle these things at the belief base level.


Field Summary
(package private)  java.util.List<InformationObject> bels
           
(package private)  java.util.Set<java.lang.String> fenceCoords
           
(package private)  GridMap map
           
(package private)  java.util.List<ELPLiteral> newExplorations
           
(package private)  java.util.Set<java.lang.String> switchCoords
           
 
Constructor Summary
MapUpdate()
           
 
Method Summary
 void assignMap(GridMap map)
          initialization routine, any operator has to accept the map instance provided as the first parameter
 void deleteFacts(java.util.Set<ELPLiteral> toDel)
          method that might ist called by the revision engine for facts occuring in the reject set of an inference operator. each knowledge operator is free to process or ignore the call.
 java.util.List<ELPLiteral> getExploredCells()
          returns the explorations an agent made at the current turn. respecting the massim scenario, an operator implementing this interface is expected to provide any cow seen the current turn, too.
 GridMap getGridMap()
          returns the gridmap associated with the knowledge operator implementing this interface
 ELP getStateProgram()
          method that returns an extended logical programm (or null) that is concatenated to the belief state, therefore bypassing any belief state construction.
 void init(org.w3c.dom.Element config)
          default initialization routine, will be called by the revision engine with a configuration description in xml
 void processBeliefSet(BeliefSet bs, BeliefBase bb)
          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

map

GridMap map

newExplorations

java.util.List<ELPLiteral> newExplorations

bels

java.util.List<InformationObject> bels

fenceCoords

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

switchCoords

java.util.Set<java.lang.String> switchCoords
Constructor Detail

MapUpdate

public MapUpdate()
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).

assignMap

public void assignMap(GridMap map)
Description copied from interface: MapOperator
initialization routine, any operator has to accept the map instance provided as the first parameter

Specified by:
assignMap in interface MapOperator
Parameters:
map - environment instance

deleteFacts

public void deleteFacts(java.util.Set<ELPLiteral> toDel)
Description copied from interface: IKnowledgeOperator
method that might ist called by the revision engine for facts occuring in the reject set of an inference operator. each knowledge operator is free to process or ignore the call.

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

getExploredCells

public java.util.List<ELPLiteral> getExploredCells()
Description copied from interface: MapOperator
returns the explorations an agent made at the current turn. respecting the massim scenario, an operator implementing this interface is expected to provide any cow seen the current turn, too.

Specified by:
getExploredCells in interface MapOperator
Returns:
list of new perceptions

processBeliefSet

public void processBeliefSet(BeliefSet bs,
                             BeliefBase bb)
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

getGridMap

public GridMap getGridMap()
Description copied from interface: MapOperator
returns the gridmap associated with the knowledge operator implementing this interface

Specified by:
getGridMap in interface MapOperator
Returns:
operator's gridmap instance

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