bdi4jade.plan

## Interface Plan

- All Superinterfaces:
    MetadataElement
  All Known Implementing Classes:
    AbstractPlan, DefaultPlan

      public interface Plan
      extends MetadataElement

  This interfaces represents the plan abstraction. It defines the goals that the plan can achieve, in which context, and it able to create an instance of plan body to be executed.
  Author:
    Ingrid Nunes

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `Plan.EndState` This enumeration represents the possible end states of a plan execution.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canAchieve(Goal goal)` Verifies if a given goal can be achieved by this plan.
    `boolean` | `canProcess(jade.lang.acl.ACLMessage message)` Verifies if the message can be processed by this plan.
    `PlanBody` | `createPlanBody()` Instantiate the plan body of this plan, which is an implementation of the `PlanBody` interface.
    `java.lang.String` | `getId()` Returns the id of this plan.
    `PlanLibrary` | `getPlanLibrary()` Returns the plan library with which this plan is associated.
    `boolean` | `isContextApplicable(Goal goal)` Verifies if the current context is valid for this plan execution.
    `void` | `setPlanLibrary(PlanLibrary planLibrary)` Sets the plan library with which this plan is associated.

    - ### Methods inherited from interface bdi4jade.core.MetadataElement

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

- - ### Method Detail

    - #### canAchieve

          boolean canAchieve(Goal goal)

      Verifies if a given goal can be achieved by this plan.
      Parameters:
        `goal` - the goal to be verified.
      Returns:
        true if the given goal can be achieved by this plan, false otherwise.

    - #### canProcess

          boolean canProcess(jade.lang.acl.ACLMessage message)

      Verifies if the message can be processed by this plan.
      Parameters:
        `message` - the message to be checked.
      Returns:
        true if this plan can process the message, false otherwise.

    - #### createPlanBody

          PlanBody createPlanBody()
                                  throws PlanInstantiationException

      Instantiate the plan body of this plan, which is an implementation of the `PlanBody` interface.
      Returns:
        the instantiated plan body.
      Throws:
        `PlanInstantiationException` - if an error occurred during the instantiation process.

    - #### getId

          java.lang.String getId()

      Returns the id of this plan.
      Returns:
        the id

    - #### getPlanLibrary

          PlanLibrary getPlanLibrary()

      Returns the plan library with which this plan is associated.
      Returns:
        the planLibrary.

    - #### isContextApplicable

          boolean isContextApplicable(Goal goal)

      Verifies if the current context is valid for this plan execution.
      Parameters:
        `goal` - the goal to be achieved whose conditions may be tested to verify the applicability of this plan.
      Returns:
        true if the plan can be executed in the current context, false otherwise.

    - #### setPlanLibrary

          void setPlanLibrary(PlanLibrary planLibrary)

      Sets the plan library with which this plan is associated.
      Parameters:
        `planLibrary` - the planLibrary to set.