br.pucrio.inf.les.bdijade.core
Class Capability

java.lang.Object
  extended by br.pucrio.inf.les.bdijade.core.Capability

public class Capability
extends java.lang.Object

This capability represents a component that aggregates the mental attitudes defined by the BDI architecture. It has a belief base with the associated beliefs (knowledge) and a plan library. *

Author:
ingrid

Field Summary
protected  BeliefBase beliefBase
           
protected  java.lang.String id
           
protected  BDIAgent myAgent
           
protected  PlanLibrary planLibrary
           
private static long serialVersionUID
           
private  boolean start
           
 
Constructor Summary
Capability()
          Creates a new capability.
Capability(BeliefBase beliefBase, PlanLibrary planLibrary)
          Creates a new capability.
Capability(java.lang.String id)
          Creates a new capability.
Capability(java.lang.String id, BeliefBase beliefBase, PlanLibrary planLibrary)
          Creates a new capability.
 
Method Summary
 boolean canProcess(jade.lang.acl.ACLMessage msg)
          Checks if this capability has a plan that can process the given message.
 BeliefBase getBeliefBase()
           
 java.lang.String getId()
           
 BDIAgent getMyAgent()
           
 PlanLibrary getPlanLibrary()
           
 void setMyAgent(BDIAgent myAgent)
           
protected  void setup()
          This is an empty holder for being overridden by subclasses.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

beliefBase

protected final BeliefBase beliefBase

id

protected final java.lang.String id

myAgent

protected BDIAgent myAgent

planLibrary

protected final PlanLibrary planLibrary

start

private boolean start
Constructor Detail

Capability

public Capability()
Creates a new capability. It uses BeliefBase and PlanLibrary as belief base and plan library respectively.


Capability

public Capability(BeliefBase beliefBase,
                  PlanLibrary planLibrary)
Creates a new capability.

Parameters:
beliefBase - the belief base of this capability.
planLibrary - the plan library of this capability.

Capability

public Capability(java.lang.String id)
Creates a new capability. It uses BeliefBase and PlanLibrary as belief base and plan library respectively.

Parameters:
id - the capability id. If it is null, the class name is going to be used.

Capability

public Capability(java.lang.String id,
                  BeliefBase beliefBase,
                  PlanLibrary planLibrary)
Creates a new capability.

Parameters:
id - the capability id. If it is null, the class name is going to be used.
beliefBase - the belief base of this capability.
planLibrary - the plan library of this capability.
Method Detail

canProcess

public boolean canProcess(jade.lang.acl.ACLMessage msg)
Checks if this capability has a plan that can process the given message.

Parameters:
msg - the message to be checked.
Returns:
true if this capability has at least a plan that can process the message.

getBeliefBase

public BeliefBase getBeliefBase()
Returns:
the beliefBase

getId

public java.lang.String getId()
Returns:
the id

getMyAgent

public BDIAgent getMyAgent()
Returns:
the agent that this capability is associated with.

getPlanLibrary

public PlanLibrary getPlanLibrary()
Returns:
the planLibrary

setMyAgent

public void setMyAgent(BDIAgent myAgent)
Parameters:
myAgent - the myAgent to set

setup

protected void setup()
This is an empty holder for being overridden by subclasses. Initializes the capability. This method is invoked by the constructor. It may be used to add initial plans and beliefs. The reasoning strategies of this capability are initialized in the constructor with default strategies. This method may also customize them.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()