bdi4jade.examples.blocksworld.plan

## Class TopLevelPlanBody

- java.lang.Object
- - jade.core.behaviours.Behaviour
  - - bdi4jade.plan.planbody.AbstractPlanBody
    - - bdi4jade.plan.planbody.BeliefGoalPlanBody
      - - bdi4jade.examples.blocksworld.plan.TopLevelPlanBody

- All Implemented Interfaces:
    GoalListener, PlanBody, java.io.Serializable, java.util.EventListener

      public class TopLevelPlanBody
      extends BeliefGoalPlanBody

  Author:
    Ingrid Nunes
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `jade.core.behaviours.Behaviour.RunnableChangedEvent`

  - ### Field Summary

    - ### Fields inherited from class jade.core.behaviours.Behaviour

      `myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TopLevelPlanBody()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `execute()` This method is a placeholder for subclasses that should implement the set of steps needed to achieve this plan body goal.
    `void` | `init()` This method is a placeholder for subclasses.
    `int` | `onEnd()` This method is invoked just once after this behaviour has ended.
    `void` | `setValue(java.util.Set<On> target)` This method sets the target block configuration to be achieved.

    - ### Methods inherited from class bdi4jade.plan.planbody.BeliefGoalPlanBody

      `action, getOutputBelief, isGoalAchieved, onStart`

    - ### Methods inherited from class bdi4jade.plan.planbody.AbstractPlanBody

      `dispatchGoal, dispatchSubgoal, dispatchSubgoalAndListen, done, getBeliefBase, getCapability, getEndState, getGoal, getGoalEvent, getGoalEvent, getGoalEvent, getPlan, goalPerformed, init, setEndState, start, stop`

    - ### Methods inherited from class jade.core.behaviours.Behaviour

      `actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, handle, handleBlockEvent, handleRestartEvent, isRunnable, reset, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState`

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

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

    - ### Methods inherited from interface bdi4jade.plan.planbody.PlanBody

      `block, reset, restart`

- - ### Constructor Detail

    - #### TopLevelPlanBody

          public TopLevelPlanBody()

  - ### Method Detail

    - #### execute

          public void execute()

      Description copied from class: `BeliefGoalPlanBody`
      This method is a placeholder for subclasses that should implement the set of steps needed to achieve this plan body goal.
      Specified by:
        `execute` in class `BeliefGoalPlanBody`

    - #### onEnd

          public int onEnd()

      Description copied from interface: `PlanBody`
      This method is invoked just once after this behaviour has ended. Therefore, it acts as an epilog for the task represented by this plan body. Note that onEnd is called after the plan body has already stopped its execution.
      Specified by:
        `onEnd` in interface `PlanBody`
      Overrides:
        `onEnd` in class `jade.core.behaviours.Behaviour`
      Returns:
        an integer code representing the termination value of the behaviour.
      See Also:
        `Behaviour.onEnd()`

    - #### init

          public void init()

      Description copied from class: `BeliefGoalPlanBody`
      This method is a placeholder for subclasses. It is invoked by the `BeliefGoalPlanBody.onStart()` method, after it performs some pre-processing.
      Overrides:
        `init` in class `BeliefGoalPlanBody`

    - #### setValue

          @Parameter(direction=IN,
                     mandatory=true)
          public void setValue(java.util.Set<On> target)

      This method sets the target block configuration to be achieved. It is given in the form of a set of `On` values, and the method organize these values in the order in which they should be stacked, from table to top. This organized configuration is set in the target array of this plan body.
      Parameters:
        `target` - the target to set.