AbstractPlanBody.html

767 lines | 38.811 kB Blame History Raw Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_20) on Mon Sep 22 13:06:34 BRT 2014 -->
<title>AbstractPlanBody</title>
<meta name="date" content="2014-09-22">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="AbstractPlanBody";
        }
    }
    catch(err) {
    }
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/AbstractPlanBody.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../bdi4jade/plan/planbody/BeliefGoalPlanBody.html" title="class in bdi4jade.plan.planbody"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?bdi4jade/plan/planbody/AbstractPlanBody.html" target="_top">Frames</a></li>
<li><a href="AbstractPlanBody.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.classes.inherited.from.class.jade.core.behaviours.Behaviour">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.jade.core.behaviours.Behaviour">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">bdi4jade.plan.planbody</div>
<h2 title="Class AbstractPlanBody" class="title">Class AbstractPlanBody</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>jade.core.behaviours.Behaviour</li>
<li>
<ul class="inheritance">
<li>bdi4jade.plan.planbody.AbstractPlanBody</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../bdi4jade/event/GoalListener.html" title="interface in bdi4jade.event">GoalListener</a>, <a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a>, java.io.Serializable, java.util.EventListener</dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../bdi4jade/plan/planbody/BeliefGoalPlanBody.html" title="class in bdi4jade.plan.planbody">BeliefGoalPlanBody</a>, <a href="../../../bdi4jade/plan/planbody/ParallelGoalPlanBody.html" title="class in bdi4jade.plan.planbody">ParallelGoalPlanBody</a>, <a href="../../../bdi4jade/plan/planbody/SequentialGoalPlanBody.html" title="class in bdi4jade.plan.planbody">SequentialGoalPlanBody</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">AbstractPlanBody</span>
extends jade.core.behaviours.Behaviour
implements <a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></pre>
<div class="block">This class provides an almost complete implementation of the <a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody"><code>PlanBody</code></a>
 interface. It represents a plan that has been instantiated to be executed.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Ingrid Nunes</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../serialized-form.html#bdi4jade.plan.planbody.AbstractPlanBody">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.jade.core.behaviours.Behaviour">
<!--   -->
</a>
<h3>Nested classes/interfaces inherited from class&nbsp;jade.core.behaviours.Behaviour</h3>
<code>jade.core.behaviours.Behaviour.RunnableChangedEvent</code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.jade.core.behaviours.Behaviour">
<!--   -->
</a>
<h3>Fields inherited from class&nbsp;jade.core.behaviours.Behaviour</h3>
<code>myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING</code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#AbstractPlanBody--">AbstractPlanBody</a></span>()</code>
<div class="block">Creates a new plan body.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#dispatchGoal-bdi4jade.goal.Goal-">dispatchGoal</a></span>(<a href="../../../bdi4jade/goal/Goal.html" title="interface in bdi4jade.goal">Goal</a>&nbsp;goal)</code>
<div class="block">Dispatches a goal to be achieved.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#dispatchSubgoal-bdi4jade.goal.Goal-">dispatchSubgoal</a></span>(<a href="../../../bdi4jade/goal/Goal.html" title="interface in bdi4jade.goal">Goal</a>&nbsp;subgoal)</code>
<div class="block">Dispatches a subgoal to be achieved.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#dispatchSubgoalAndListen-bdi4jade.goal.Goal-">dispatchSubgoalAndListen</a></span>(<a href="../../../bdi4jade/goal/Goal.html" title="interface in bdi4jade.goal">Goal</a>&nbsp;subgoal)</code>
<div class="block">Dispatches a subgoal to be achieved and registers itself as a listener to
 receive a notification of the end of execution of the goal.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#done--">done</a></span>()</code>
<div class="block">Indicates to the JADE platform that this behavior/plan body finished its
 execution.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../bdi4jade/belief/BeliefBase.html" title="class in bdi4jade.belief">BeliefBase</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getBeliefBase--">getBeliefBase</a></span>()</code>
<div class="block">Returns the belief base of the capability associated with the plan of
 this plan body.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../bdi4jade/core/Capability.html" title="class in bdi4jade.core">Capability</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getCapability--">getCapability</a></span>()</code>
<div class="block">Returns the capability associated with the plan of this plan body.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../bdi4jade/plan/Plan.EndState.html" title="enum in bdi4jade.plan">Plan.EndState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getEndState--">getEndState</a></span>()</code>
<div class="block">Returns the end state of plan.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../bdi4jade/goal/Goal.html" title="interface in bdi4jade.goal">Goal</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getGoal--">getGoal</a></span>()</code>
<div class="block">Returns the goal to be achieved by this plan instance.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../bdi4jade/event/GoalEvent.html" title="class in bdi4jade.event">GoalEvent</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getGoalEvent--">getGoalEvent</a></span>()</code>
<div class="block">Returns a goal event from the queue.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../bdi4jade/event/GoalEvent.html" title="class in bdi4jade.event">GoalEvent</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getGoalEvent-boolean-">getGoalEvent</a></span>(boolean&nbsp;block)</code>
<div class="block">Returns a goal event from the queue.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../bdi4jade/event/GoalEvent.html" title="class in bdi4jade.event">GoalEvent</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getGoalEvent-long-">getGoalEvent</a></span>(long&nbsp;ms)</code>
<div class="block">Returns a goal event from the queue.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../bdi4jade/plan/Plan.html" title="interface in bdi4jade.plan">Plan</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getPlan--">getPlan</a></span>()</code>
<div class="block">Returns the <a href="../../../bdi4jade/plan/Plan.html" title="interface in bdi4jade.plan"><code>Plan</code></a> that is associated with this plan body.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#goalPerformed-bdi4jade.event.GoalEvent-">goalPerformed</a></span>(<a href="../../../bdi4jade/event/GoalEvent.html" title="class in bdi4jade.event">GoalEvent</a>&nbsp;event)</code>
<div class="block">Receives the notification that a goal event has occurred.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#init-bdi4jade.plan.Plan-bdi4jade.core.Intention-">init</a></span>(<a href="../../../bdi4jade/plan/Plan.html" title="interface in bdi4jade.plan">Plan</a>&nbsp;plan,
    <a href="../../../bdi4jade/core/Intention.html" title="class in bdi4jade.core">Intention</a>&nbsp;intention)</code>
<div class="block">Initializes this plan body.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#setEndState-bdi4jade.plan.Plan.EndState-">setEndState</a></span>(<a href="../../../bdi4jade/plan/Plan.EndState.html" title="enum in bdi4jade.plan">Plan.EndState</a>&nbsp;endState)</code>
<div class="block">Sets the end state of plan.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#start--">start</a></span>()</code>
<div class="block">Starts the plan body, by adding it as to the agent as a <code>Behaviour</code>
 .</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#stop--">stop</a></span>()</code>
<div class="block">Stops the plan body execution.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.jade.core.behaviours.Behaviour">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;jade.core.behaviours.Behaviour</h3>
<code>action, actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, handle, handleBlockEvent, handleRestartEvent, isRunnable, onEnd, onStart, reset, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.bdi4jade.plan.planbody.PlanBody">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;bdi4jade.plan.planbody.<a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></h3>
<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#block--">block</a>, <a href="../../../bdi4jade/plan/planbody/PlanBody.html#onEnd--">onEnd</a>, <a href="../../../bdi4jade/plan/planbody/PlanBody.html#onStart--">onStart</a>, <a href="../../../bdi4jade/plan/planbody/PlanBody.html#reset--">reset</a>, <a href="../../../bdi4jade/plan/planbody/PlanBody.html#restart--">restart</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="AbstractPlanBody--">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>AbstractPlanBody</h4>
<pre>public&nbsp;AbstractPlanBody()</pre>
<div class="block">Creates a new plan body.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="dispatchGoal-bdi4jade.goal.Goal-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dispatchGoal</h4>
<pre>public&nbsp;boolean&nbsp;dispatchGoal(<a href="../../../bdi4jade/goal/Goal.html" title="interface in bdi4jade.goal">Goal</a>&nbsp;goal)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchGoal-bdi4jade.goal.Goal-">PlanBody</a></code></span></div>
<div class="block">Dispatches a goal to be achieved. It is added as a top level agent goal,
 that is, the dispatched goal is independent of the goal that this plan
 body is trying to achieve.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchGoal-bdi4jade.goal.Goal-">dispatchGoal</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>goal</code> - the goal to be dispatched.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the goal could be dispatched, false otherwise.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchGoal-bdi4jade.goal.Goal-"><code>PlanBody.dispatchGoal(Goal)</code></a></dd>
</dl>
</li>
</ul>
<a name="dispatchSubgoal-bdi4jade.goal.Goal-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dispatchSubgoal</h4>
<pre>public&nbsp;boolean&nbsp;dispatchSubgoal(<a href="../../../bdi4jade/goal/Goal.html" title="interface in bdi4jade.goal">Goal</a>&nbsp;subgoal)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchSubgoal-bdi4jade.goal.Goal-">PlanBody</a></code></span></div>
<div class="block">Dispatches a subgoal to be achieved. Dispatched subgoals are goals of an
 agent as long as the plan body that dispatched it is being executed.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchSubgoal-bdi4jade.goal.Goal-">dispatchSubgoal</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>subgoal</code> - the subgoal to be dispatched.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the goal could be dispatched, false otherwise.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchSubgoal-bdi4jade.goal.Goal-"><code>PlanBody.dispatchSubgoal(Goal)</code></a></dd>
</dl>
</li>
</ul>
<a name="dispatchSubgoalAndListen-bdi4jade.goal.Goal-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dispatchSubgoalAndListen</h4>
<pre>public&nbsp;boolean&nbsp;dispatchSubgoalAndListen(<a href="../../../bdi4jade/goal/Goal.html" title="interface in bdi4jade.goal">Goal</a>&nbsp;subgoal)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchSubgoalAndListen-bdi4jade.goal.Goal-">PlanBody</a></code></span></div>
<div class="block">Dispatches a subgoal to be achieved and registers itself as a listener to
 receive a notification of the end of execution of the goal.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchSubgoalAndListen-bdi4jade.goal.Goal-">dispatchSubgoalAndListen</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>subgoal</code> - the subgoal to be dispatched.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the goal could be dispatched, false otherwise.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../bdi4jade/plan/planbody/PlanBody.html#dispatchSubgoalAndListen-bdi4jade.goal.Goal-"><code>PlanBody.dispatchSubgoalAndListen(Goal)</code></a></dd>
</dl>
</li>
</ul>
<a name="done--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>done</h4>
<pre>public final&nbsp;boolean&nbsp;done()</pre>
<div class="block">Indicates to the JADE platform that this behavior/plan body finished its
 execution. If <a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getEndState--"><code>getEndState()</code></a> returns null, it returns false, as
 the plan body has not reached a final state. It returns true otherwise.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>done</code>&nbsp;in class&nbsp;<code>jade.core.behaviours.Behaviour</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>false if <a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getEndState--"><code>getEndState()</code></a> returns null, true otherwise.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>Behaviour.done()</code></dd>
</dl>
</li>
</ul>
<a name="getBeliefBase--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBeliefBase</h4>
<pre>public&nbsp;<a href="../../../bdi4jade/belief/BeliefBase.html" title="class in bdi4jade.belief">BeliefBase</a>&nbsp;getBeliefBase()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getBeliefBase--">PlanBody</a></code></span></div>
<div class="block">Returns the belief base of the capability associated with the plan of
 this plan body.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getBeliefBase--">getBeliefBase</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the belief base containing the capability beliefs.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getBeliefBase--"><code>PlanBody.getBeliefBase()</code></a></dd>
</dl>
</li>
</ul>
<a name="getCapability--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCapability</h4>
<pre>public&nbsp;<a href="../../../bdi4jade/core/Capability.html" title="class in bdi4jade.core">Capability</a>&nbsp;getCapability()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getCapability--">PlanBody</a></code></span></div>
<div class="block">Returns the capability associated with the plan of this plan body.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getCapability--">getCapability</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the capability.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getCapability--"><code>PlanBody.getCapability()</code></a></dd>
</dl>
</li>
</ul>
<a name="getEndState--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEndState</h4>
<pre>public&nbsp;<a href="../../../bdi4jade/plan/Plan.EndState.html" title="enum in bdi4jade.plan">Plan.EndState</a>&nbsp;getEndState()</pre>
<div class="block">Returns the end state of plan. A null value means that the plan is still
 executing.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getEndState--">getEndState</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the end state of the plan.</dd>
</dl>
</li>
</ul>
<a name="getGoal--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGoal</h4>
<pre>public final&nbsp;<a href="../../../bdi4jade/goal/Goal.html" title="interface in bdi4jade.goal">Goal</a>&nbsp;getGoal()</pre>
<div class="block">Returns the goal to be achieved by this plan instance.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getGoal--">getGoal</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the goal.</dd>
</dl>
</li>
</ul>
<a name="getGoalEvent--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGoalEvent</h4>
<pre>public&nbsp;<a href="../../../bdi4jade/event/GoalEvent.html" title="class in bdi4jade.event">GoalEvent</a>&nbsp;getGoalEvent()</pre>
<div class="block">Returns a goal event from the queue. If the queue is empty, the plan body
 execution is blocked.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getGoalEvent--">getGoalEvent</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the goal event or null if the queue is empty.</dd>
</dl>
</li>
</ul>
<a name="getGoalEvent-boolean-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGoalEvent</h4>
<pre>public&nbsp;<a href="../../../bdi4jade/event/GoalEvent.html" title="class in bdi4jade.event">GoalEvent</a>&nbsp;getGoalEvent(boolean&nbsp;block)</pre>
<div class="block">Returns a goal event from the queue. If the queue is empty, the plan body
 execution is blocked if the parameter passed to this method is true.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getGoalEvent-boolean-">getGoalEvent</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>block</code> - true if the plan body must be blocked if the queue is empty.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the goal event or null if the queue is empty.</dd>
</dl>
</li>
</ul>
<a name="getGoalEvent-long-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGoalEvent</h4>
<pre>public&nbsp;<a href="../../../bdi4jade/event/GoalEvent.html" title="class in bdi4jade.event">GoalEvent</a>&nbsp;getGoalEvent(long&nbsp;ms)</pre>
<div class="block">Returns a goal event from the queue. If the queue is empty, the plan body
 execution is blocked for the specified milliseconds.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getGoalEvent-long-">getGoalEvent</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>ms</code> - the maximum amount of time that the behavior must be blocked.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the goal event or null if the queue is empty.</dd>
</dl>
</li>
</ul>
<a name="getPlan--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPlan</h4>
<pre>public final&nbsp;<a href="../../../bdi4jade/plan/Plan.html" title="interface in bdi4jade.plan">Plan</a>&nbsp;getPlan()</pre>
<div class="block">Returns the <a href="../../../bdi4jade/plan/Plan.html" title="interface in bdi4jade.plan"><code>Plan</code></a> that is associated with this plan body.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#getPlan--">getPlan</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the plan.</dd>
</dl>
</li>
</ul>
<a name="goalPerformed-bdi4jade.event.GoalEvent-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>goalPerformed</h4>
<pre>public&nbsp;void&nbsp;goalPerformed(<a href="../../../bdi4jade/event/GoalEvent.html" title="class in bdi4jade.event">GoalEvent</a>&nbsp;event)</pre>
<div class="block">Receives the notification that a goal event has occurred. If the event
 has a finished status, it is added to the event queue, which can be
 retrieved by invoking the <a href="../../../bdi4jade/plan/planbody/AbstractPlanBody.html#getGoalEvent--"><code>getGoalEvent()</code></a> method, and restarts
 the plan body execution.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/event/GoalListener.html#goalPerformed-bdi4jade.event.GoalEvent-">goalPerformed</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/event/GoalListener.html" title="interface in bdi4jade.event">GoalListener</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>event</code> - the goal event that occurred.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../bdi4jade/event/GoalListener.html#goalPerformed-bdi4jade.event.GoalEvent-"><code>GoalListener.goalPerformed(bdi4jade.event.GoalEvent)</code></a></dd>
</dl>
</li>
</ul>
<a name="init-bdi4jade.plan.Plan-bdi4jade.core.Intention-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>public final&nbsp;void&nbsp;init(<a href="../../../bdi4jade/plan/Plan.html" title="interface in bdi4jade.plan">Plan</a>&nbsp;plan,
                       <a href="../../../bdi4jade/core/Intention.html" title="class in bdi4jade.core">Intention</a>&nbsp;intention)
                throws <a href="../../../bdi4jade/exception/PlanInstantiationException.html" title="class in bdi4jade.exception">PlanInstantiationException</a></pre>
<div class="block">Initializes this plan body. It associates this plan body with a plan
 definition (<a href="../../../bdi4jade/plan/Plan.html" title="interface in bdi4jade.plan"><code>Plan</code></a>) and an <a href="../../../bdi4jade/core/Intention.html" title="class in bdi4jade.core"><code>Intention</code></a>. If this plan body has
 already been initialized, this method throws a
 <a href="../../../bdi4jade/exception/PlanInstantiationException.html" title="class in bdi4jade.exception"><code>PlanInstantiationException</code></a>. It also sets up the plan input
 parameters based on the goal input parameters.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#init-bdi4jade.plan.Plan-bdi4jade.core.Intention-">init</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>plan</code> - the plan associated this this plan body.</dd>
<dd><code>intention</code> - the intention that this plan instance have to achieve.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../bdi4jade/exception/PlanInstantiationException.html" title="class in bdi4jade.exception">PlanInstantiationException</a></code> - if this plan body has already been initialized.</dd>
</dl>
</li>
</ul>
<a name="setEndState-bdi4jade.plan.Plan.EndState-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setEndState</h4>
<pre>protected final&nbsp;void&nbsp;setEndState(<a href="../../../bdi4jade/plan/Plan.EndState.html" title="enum in bdi4jade.plan">Plan.EndState</a>&nbsp;endState)</pre>
<div class="block">Sets the end state of plan. A null value means that the plan is still
 executing.
 
 If the plan body has come to an end state, it invokes the method to set
 the output parameters of the goal, in case the plan body implements the
 <a href="../../../bdi4jade/plan/planbody/OutputPlanBody.html" title="interface in bdi4jade.plan.planbody"><code>OutputPlanBody</code></a> interface (this is invoked only once), or sets up
 the goal inputs parameters based on the plan body output parameters. If
 an error occurs during this setting process, a warn is shown, but no
 exception is thrown.
 
 If the plan body has come to an end state, it drops all subgoals, in case
 they are still trying to be achieved.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>endState</code> - the endState to set.</dd>
</dl>
</li>
</ul>
<a name="start--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre>public final&nbsp;void&nbsp;start()</pre>
<div class="block">Starts the plan body, by adding it as to the agent as a <code>Behaviour</code>
 .</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#start--">start</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
</dl>
</li>
</ul>
<a name="stop--">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>stop</h4>
<pre>public final&nbsp;void&nbsp;stop()</pre>
<div class="block">Stops the plan body execution. It drops all plan body subgoals. If the
 body implements the <a href="../../../bdi4jade/plan/planbody/DisposablePlanBody.html" title="interface in bdi4jade.plan.planbody"><code>DisposablePlanBody</code></a>, it invokes the method to
 about the plan body, so it can perform finalizations.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../bdi4jade/plan/planbody/PlanBody.html#stop--">stop</a></code>&nbsp;in interface&nbsp;<code><a href="../../../bdi4jade/plan/planbody/PlanBody.html" title="interface in bdi4jade.plan.planbody">PlanBody</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/AbstractPlanBody.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../bdi4jade/plan/planbody/BeliefGoalPlanBody.html" title="class in bdi4jade.plan.planbody"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?bdi4jade/plan/planbody/AbstractPlanBody.html" target="_top">Frames</a></li>
<li><a href="AbstractPlanBody.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.classes.inherited.from.class.jade.core.behaviours.Behaviour">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.jade.core.behaviours.Behaviour">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>