bdi4jade.core

## Class Capability

- java.lang.Object
- - bdi4jade.core.Capability

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    DefaultCapability

      public class Capability
      extends java.lang.Object
      implements java.io.Serializable

  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
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `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.
    `Capability(java.lang.String id, Capability parent)` Creates a new capability.
    `Capability(java.lang.String id, Capability parent, BeliefBase beliefBase, PlanLibrary planLibrary)` Creates a new capability.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChild(Capability capability)`
    `boolean` | `canProcess(jade.lang.acl.ACLMessage msg)` Checks if this capability has a plan that can process the given message.
    `BeliefBase` | `getBeliefBase()`
    `java.util.Set<Capability>` | `getChildren()`
    `java.lang.String` | `getId()`
    `BDIAgent` | `getMyAgent()`
    `Capability` | `getParent()`
    `PlanLibrary` | `getPlanLibrary()`
    `boolean` | `hasChildren()`
    `boolean` | `removeChild(Capability capability)`
    `void` | `setMyAgent(BDIAgent myAgent)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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.

    - #### Capability

          public Capability(java.lang.String id,
                    Capability parent)

      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.
        `parent` - the parent of this capability.

    - #### Capability

          public Capability(java.lang.String id,
                    Capability parent,
                    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.
        `parent` - the parent of this capability.
        `beliefBase` - the belief base of this capability.
        `planLibrary` - the plan library of this capability.

  - ### Method Detail

    - #### addChild

          public void addChild(Capability capability)

    - #### 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

    - #### getChildren

          public java.util.Set<Capability> getChildren()

      Returns:
        the children

    - #### getId

          public java.lang.String getId()

      Returns:
        the id

    - #### getMyAgent

          public BDIAgent getMyAgent()

      Returns:
        the agent that this capability is associated with.

    - #### getParent

          public Capability getParent()

      Returns:
        the parent

    - #### getPlanLibrary

          public PlanLibrary getPlanLibrary()

      Returns:
        the planLibrary

    - #### hasChildren

          public boolean hasChildren()

    - #### removeChild

          public boolean removeChild(Capability capability)

    - #### setMyAgent

          public void setMyAgent(BDIAgent myAgent)

      Parameters:
        `myAgent` - the myAgent to set

    - #### toString

          public java.lang.String toString()

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