bdi4jade.core

## Class BDIAgent

- java.lang.Object
- - jade.core.Agent
  - - bdi4jade.core.BDIAgent

- All Implemented Interfaces:
    jade.core.TimerListener, java.io.Serializable, java.lang.Runnable
  Direct Known Subclasses:
    UtilityBasedBDIAgent

      public class BDIAgent
      extends jade.core.Agent

  This class is an extension of `Agent` that has a current set of goals, which are selected to become intentions, i.e. to tried to be achieve by means of the selection and execution of plans. It also have a set of `Capability`. It has a behavior that runs the BDI-interpreter. This agent also have a `MsgReceiver` behavior to receive all messages that the agent current plans can process.
  Author:
    ingrid
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class jade.core.Agent

      `jade.core.Agent.Interrupted`

  - ### Field Summary

    - ### Fields inherited from class jade.core.Agent

      `AP_ACTIVE, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_WAITING, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN, MSG_QUEUE_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BDIAgent()` Default constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCapability(Capability capability)` Adds a capability to this agent.
    `void` | `addGoal(Capability owner, Goal goal)` Adds a new goal to this agent to be achieved.
    `void` | `addGoal(Capability owner, Goal goal, GoalListener goalListener)` Adds a new goal to this agent to be achieved and adds a listener to observe its end.
    `void` | `addGoal(Goal goal)` Adds a new goal to this agent to be achieved.
    `void` | `addGoal(Goal goal, GoalListener goalListener)` Adds a new goal to this agent to be achieved and adds a listener to observe its end.
    `void` | `addSoftgoal(Softgoal softgoal)` Adds a new softgoal to this agent.
    `void` | `dropGoal(Goal goal)` Drops a given goal of this agent.
    `void` | `dropSoftoal(Softgoal softgoal)` Drops a given softgoal of this agent.
    `java.util.Collection<Belief<?>>` | `getAllBeliefs()` Returns a collection of all beliefs from all capabilities of this agent.
    `java.util.List<Capability>` | `getAllCapabilities()`
    `java.util.Set<Goal>` | `getAllGoals()` Gets all goals of this agent.
    `java.util.Set<Softgoal>` | `getAllSoftgoals()` Gets all softgoals of this agent.
    `BeliefRevisionStrategy` | `getBeliefRevisionStrategy()`
    `DeliberationFunction` | `getDeliberationFunction()`
    `java.util.Set<Intention>` | `getIntentions()`
    `OptionGenerationFunction` | `getOptionGenerationFunction()`
    `PlanSelectionStrategy` | `getPlanSelectionStrategy()`
    `Capability` | `getRootCapability()` Returns the root capability of this agent.
    `boolean` | `removeCapability(Capability capability)` Removes a capability from this agent.
    `void` | `setBeliefRevisionStrategy(BeliefRevisionStrategy beliefRevisionStrategy)`
    `void` | `setDeliberationFunction(DeliberationFunction deliberationFunction)`
    `void` | `setNoLongerDesired(Goal goal)` Sets a goal to be no longer desired.
    `void` | `setOptionGenerationFunction(OptionGenerationFunction optionGenerationFunction)`
    `void` | `setPlanSelectionStrategy(PlanSelectionStrategy planSelectionStrategy)`

    - ### Methods inherited from class jade.core.Agent

      `addBehaviour, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getBootProperties, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getProperty, getQueueSize, getState, here, isRestarting, join, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, removeTimer, restartLater, restore, restoreBufferedState, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setO2AManager, setQueueSize, waitUntilStarted, write`

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

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

- - ### Constructor Detail

    - #### BDIAgent

          public BDIAgent()

      Default constructor.

  - ### Method Detail

    - #### addCapability

          public void addCapability(Capability capability)

      Adds a capability to this agent.
      Parameters:
        `capability` - capability to be added.

    - #### addGoal

          public void addGoal(Goal goal)

      Adds a new goal to this agent to be achieved.
      Parameters:
        `goal` - the goal to be achieved.

    - #### addGoal

          public void addGoal(Goal goal,
                     GoalListener goalListener)

      Adds a new goal to this agent to be achieved and adds a listener to observe its end.
      Parameters:
        `goal` - the goal to be achieved.
        `goalListener` - the listener to be notified.

    - #### addGoal

          public void addGoal(Capability owner,
                     Goal goal)

      Adds a new goal to this agent to be achieved.
      Parameters:
        `owner` - the Capability that is owner of the goal.
        `goal` - the goal to be achieved.

    - #### addGoal

          public void addGoal(Capability owner,
                     Goal goal,
                     GoalListener goalListener)

      Adds a new goal to this agent to be achieved and adds a listener to observe its end. If this goal has a capability that owns it, only plans of this capability and its children capabilities will be considered to achieve this goal.
      Parameters:
        `owner` - the Capability that is owner of the goal.
        `goal` - the goal to be achieved.
        `goalListener` - the listener to be notified.

    - #### addSoftgoal

          public void addSoftgoal(Softgoal softgoal)

      Adds a new softgoal to this agent.
      Parameters:
        `softgoal` - the softgoal to be pursued.

    - #### dropGoal

          public void dropGoal(Goal goal)

      Drops a given goal of this agent. If the goal is not part of the agent's current goals, no action is performed.
      Parameters:
        `goal` - the goal to be dropped.

    - #### dropSoftoal

          public void dropSoftoal(Softgoal softgoal)

      Drops a given softgoal of this agent. If the softgoal is not part of the agent's current softgoals, no action is performed.
      Parameters:
        `softgoal` - the softgoal to be dropped.

    - #### getAllBeliefs

          public java.util.Collection<Belief<?>> getAllBeliefs()

      Returns a collection of all beliefs from all capabilities of this agent. It may have two equivalent beliefs, i.e. beliefs with the same name.
      Returns:
        the collection of all beliefs of this agent.

    - #### getAllCapabilities

          public java.util.List<Capability> getAllCapabilities()

      Returns:
        the capabilities

    - #### getAllGoals

          public java.util.Set<Goal> getAllGoals()

      Gets all goals of this agent. This goals are the ones in the goal set and the ones that are trying to be achieve in intentions.
      Returns:
        the set of goals.

    - #### getAllSoftgoals

          public java.util.Set<Softgoal> getAllSoftgoals()

      Gets all softgoals of this agent.
      Returns:
        the set of softgoals.

    - #### getBeliefRevisionStrategy

          public BeliefRevisionStrategy getBeliefRevisionStrategy()

      Returns:
        the beliefRevisionStrategy

    - #### getDeliberationFunction

          public DeliberationFunction getDeliberationFunction()

      Returns:
        the deliberationFunction

    - #### getIntentions

          public java.util.Set<Intention> getIntentions()

      Returns:
        the intentions

    - #### getOptionGenerationFunction

          public OptionGenerationFunction getOptionGenerationFunction()

      Returns:
        the optionGenerationFunction

    - #### getPlanSelectionStrategy

          public PlanSelectionStrategy getPlanSelectionStrategy()

      Returns:
        the planSelectionStrategy

    - #### getRootCapability

          public Capability getRootCapability()

      Returns the root capability of this agent.
      Returns:
        the rootCapability

    - #### removeCapability

          public boolean removeCapability(Capability capability)

      Removes a capability from this agent.
      Parameters:
        `capability` - capability to be removed.
      Returns:
        true if the capability exists and was removed.

    - #### setBeliefRevisionStrategy

          public void setBeliefRevisionStrategy(BeliefRevisionStrategy beliefRevisionStrategy)

      Parameters:
        `beliefRevisionStrategy` - the beliefRevisionStrategy to set

    - #### setDeliberationFunction

          public void setDeliberationFunction(DeliberationFunction deliberationFunction)

      Parameters:
        `deliberationFunction` - the deliberationFunction to set

    - #### setNoLongerDesired

          public void setNoLongerDesired(Goal goal)

      Sets a goal to be no longer desired.
      Parameters:
        `goal` - the goal to be no longer desired.

    - #### setOptionGenerationFunction

          public void setOptionGenerationFunction(OptionGenerationFunction optionGenerationFunction)

      Parameters:
        `optionGenerationFunction` - the optionGenerationFunction to set

    - #### setPlanSelectionStrategy

          public void setPlanSelectionStrategy(PlanSelectionStrategy planSelectionStrategy)

      Parameters:
        `planSelectionStrategy` - the planSelectionStrategy to set