bdi4jade.util.plan

## Class SimplePlan

- java.lang.Object
- - bdi4jade.util.MetadataElement
  - - bdi4jade.plan.Plan
    - - bdi4jade.util.plan.SimplePlan

-     public class SimplePlan
      extends Plan

  This class represents a plan whose plan body is a class that can be instantiated by invoking the @likn `Class.newInstance()` method. A class that has the `Behaviour` class as superclass is provides and it is instantiates in the `createPlanBody()` method.
  Author:
    ingrid

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class bdi4jade.plan.Plan

      `Plan.DefaultMetadata`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimplePlan(java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)` Creates a new Simple Plan.
    `SimplePlan(java.lang.Class<? extends Goal> goalClass, java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)` Creates a new Simple Plan.
    `SimplePlan(java.lang.Class<? extends Goal> goalClass, jade.lang.acl.MessageTemplate messageTemplate, java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)` Creates a new Simple Plan.
    `SimplePlan(jade.lang.acl.MessageTemplate messageTemplate, java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)` Creates a new Simple Plan.
    `SimplePlan(java.lang.String id, java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)` Creates a new Simple Plan.
    `SimplePlan(java.lang.String id, java.lang.Class<? extends Goal> goalClass, java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)` Creates a new Simple Plan.
    `SimplePlan(java.lang.String id, java.lang.Class<? extends Goal> goalClass, jade.lang.acl.MessageTemplate messageTemplate, java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)` Creates a new Simple Plan.
    `SimplePlan(java.lang.String id, jade.lang.acl.MessageTemplate messageTemplate, java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)` Creates a new Simple Plan.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `jade.core.behaviours.Behaviour` | `createPlanBody()` Creates a new instance of the plan body.
    `java.lang.Class<? extends jade.core.behaviours.Behaviour>` | `getPlanBodyClass()`

    - ### Methods inherited from class bdi4jade.plan.Plan

      `addGoal, addMessageTemplate, canAchieve, canProcess, equals, getId, getPlanLibrary, hashCode, setPlanLibrary, toString`

    - ### Methods inherited from class bdi4jade.util.MetadataElement

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SimplePlan

          public SimplePlan(java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)

      Creates a new Simple Plan. It is a plan whose body is the specified class and its id is the plan body class name. The class must also implement the `PlanBody` interface, otherwise an exception is going to be thrown during the instantiation process.
      Parameters:
        `planBodyClass` - the class of the plan body. It must have the Behavior as super class and implement the `PlanBody` interface.

    - #### SimplePlan

          public SimplePlan(java.lang.Class<? extends Goal> goalClass,
                    java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)

      Creates a new Simple Plan. It is a plan whose body is the specified class and its id is the plan body class name. The class must also implement the `PlanBody` interface, otherwise an exception is going to be thrown during the instantiation process. It sets that this plan can achieve the specified goal class, but more goals can be specified by overriding the initGoals() method.
      Parameters:
        `goalClass` - the goal that this plan can achieve.
        `planBodyClass` - the class of the plan body. It must have the Behavior as super class and implement the `PlanBody` interface.

    - #### SimplePlan

          public SimplePlan(java.lang.Class<? extends Goal> goalClass,
                    jade.lang.acl.MessageTemplate messageTemplate,
                    java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)

      Creates a new Simple Plan. It is a plan whose body is the specified class and its id is the plan body class name. The class must also implement the `PlanBody` interface, otherwise an exception is going to be thrown during the instantiation process. It sets that this plan can achieve the specified goal class, but more goals can be specified by overriding the initGoals() method. The message templates is initialized with the provided template.
      Parameters:
        `goalClass` - the goal that this plan can achieve.
        `messageTemplate` - the template of messages that this plan can process.
        `planBodyClass` - the class of the plan body. It must have the Behavior as super class and implement the `PlanBody` interface.

    - #### SimplePlan

          public SimplePlan(jade.lang.acl.MessageTemplate messageTemplate,
                    java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)

      Creates a new Simple Plan. It is a plan whose body is the specified class and its id is the plan body class name. The class must also implement the `PlanBody` interface, otherwise an exception is going to be thrown during the instantiation process. The message templates is initialized with the provided template.
      Parameters:
        `messageTemplate` - the template of messages that this plan can process.
        `planBodyClass` - the class of the plan body. It must have the Behavior as super class and implement the `PlanBody` interface.

    - #### SimplePlan

          public SimplePlan(java.lang.String id,
                    java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)

      Creates a new Simple Plan. It is a plan that has the provided id and whose body is the specified class. The class must also implement the `PlanBody` interface, otherwise an exception is going to be thrown during the instantiation process.
      Parameters:
        `id` - the id of this plan.
        `planBodyClass` - the class of the plan body. It must have the Behavior as super class and implement the `PlanBody` interface.

    - #### SimplePlan

          public SimplePlan(java.lang.String id,
                    java.lang.Class<? extends Goal> goalClass,
                    java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)

      Creates a new Simple Plan. It is a plan that has the provided id and whose body is the specified class. The class must also implement the `PlanBody` interface, otherwise an exception is going to be thrown during the instantiation process. It sets that this plan can achieve the specified goal class, but more goals can be specified by overriding the initGoals() method.
      Parameters:
        `id` - the id of this plan.
        `goalClass` - the goal that this plan can achieve.
        `planBodyClass` - the class of the plan body. It must have the Behavior as super class and implement the `PlanBody` interface.

    - #### SimplePlan

          public SimplePlan(java.lang.String id,
                    java.lang.Class<? extends Goal> goalClass,
                    jade.lang.acl.MessageTemplate messageTemplate,
                    java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)

      Creates a new Simple Plan. It is a plan that has the provided id and whose body is the specified class. The class must also implement the `PlanBody` interface, otherwise an exception is going to be thrown during the instantiation process. It sets that this plan can achieve the specified goal class, but more goals can be specified by overriding the initGoals() method. The message templates is initialized with the provided template.
      Parameters:
        `id` - the id of this plan.
        `messageTemplate` - the template of messages that this plan can process.
        `goalClass` - the goal that this plan can achieve.
        `planBodyClass` - the class of the plan body. It must have the Behavior as super class and implement the `PlanBody` interface.

    - #### SimplePlan

          public SimplePlan(java.lang.String id,
                    jade.lang.acl.MessageTemplate messageTemplate,
                    java.lang.Class<? extends jade.core.behaviours.Behaviour> planBodyClass)

      Creates a new Simple Plan. It is a plan that has the provided id and whose body is the specified class. The class must also implement the `PlanBody` interface, otherwise an exception is going to be thrown during the instantiation process. The message templates is initialized with the provided template.
      Parameters:
        `id` - the id of this plan.
        `messageTemplate` - the template of messages that this plan can process.
        `planBodyClass` - the class of the plan body. It must have the Behavior as super class and implement the `PlanBody` interface.

  - ### Method Detail

    - #### createPlanBody

          public jade.core.behaviours.Behaviour createPlanBody()
                                                        throws PlanInstantiationException

      Creates a new instance of the plan body. It invokes the method newInstance() from the plan body class.
      Specified by:
        `createPlanBody` in class `Plan`
      Returns:
        the instantiated plan body.
      Throws:
        `PlanInstantiationException` - if an error occurred during the instantiation process.
      See Also:
        `Plan.createPlanBody()`

    - #### getPlanBodyClass

          public java.lang.Class<? extends jade.core.behaviours.Behaviour> getPlanBodyClass()

      Returns:
        the planBodyClass