jadex.bdi.planlib.protocols.contractnet
Class CNPReceiverPlan

java.lang.Object
  extended by jadex.bdi.runtime.impl.AbstractPlan
      extended by jadex.bdi.runtime.Plan
          extended by jadex.bdi.planlib.protocols.AbstractReceiverPlan
              extended by jadex.bdi.planlib.protocols.contractnet.CNPReceiverPlan
All Implemented Interfaces:
ISuspendable, java.io.Serializable

public class CNPReceiverPlan
extends AbstractReceiverPlan

Receive a contract net protocol (cnp) and answer it.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jadex.bdi.runtime.Plan
Plan.SyncResultListener
 
Field Summary
 
Fields inherited from class jadex.bdi.runtime.Plan
lis
 
Fields inherited from class jadex.bdi.runtime.impl.AbstractPlan
interpreter, planinit
 
Constructor Summary
CNPReceiverPlan()
           
 
Method Summary
 void body()
          The body method is called on the instatiated plan instance from the scheduler.
 java.lang.Object executeTask(java.lang.Object proposal, java.lang.Object proposal_info, IComponentIdentifier initiator)
          Execute the task.
protected  java.lang.String getShortProtocolName()
          Get protocol abbrev name.
protected  boolean isIterated()
          Test if it is the iterated contract-net version.
 java.lang.Object[] makeProposal(java.lang.Object cfp, IComponentIdentifier initiator)
          Make a proposal based on the task description.
 
Methods inherited from class jadex.bdi.planlib.protocols.AbstractReceiverPlan
failed, passed
 
Methods inherited from class jadex.bdi.runtime.Plan
aborted, createWaitAbstraction, dispatchSubgoalAndWait, dispatchSubgoalAndWait, getMonitor, isEventRegisteredInWaitqueue, resume, sendMessageAndWait, sendMessageAndWait, suspend, waitFor, waitForCondition, waitForCondition, waitForEver, waitForExternalCondition, waitForExternalCondition, waitForFactAdded, waitForFactAdded, waitForFactAddedOrRemoved, waitForFactAddedOrRemoved, waitForFactChanged, waitForFactChanged, waitForFactRemoved, waitForFactRemoved, waitForGoal, waitForGoal, waitForGoal, waitForGoal, waitForInternalEvent, waitForInternalEvent, waitForMessageEvent, waitForMessageEvent, waitForReply, waitForReply, waitForTick, waitForWaitAbstraction, waitForWaitAbstraction
 
Methods inherited from class jadex.bdi.runtime.impl.AbstractPlan
createComponentIdentifier, createComponentIdentifier, createComponentIdentifier, createExpression, createExpression, createGoal, createInternalEvent, createMessageEvent, dispatchInternalEvent, dispatchSubgoal, dispatchTopLevelGoal, endAtomic, fail, fail, fail, getBeliefbase, getBody, getClock, getComponentIdentifier, getComponentName, getDispatchedElement, getEventbase, getException, getExpression, getExpressionbase, getExternalAccess, getFlyweight, getGoalbase, getInterpreter, getLifecycleState, getLogger, getParameter, getParameters, getParameterSet, getParameterSets, getPlanbase, getPlanElement, getPropertybase, getRCapability, getReason, getRPlan, getScope, getState, getTime, getType, getWaitqueue, hasParameter, hasParameterSet, killAgent, sendMessage, startAtomic, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CNPReceiverPlan

public CNPReceiverPlan()
Method Detail

body

public void body()
The body method is called on the instatiated plan instance from the scheduler.

Specified by:
body in class Plan

isIterated

protected boolean isIterated()
Test if it is the iterated contract-net version.

Returns:
True, if is is the iterated version.

getShortProtocolName

protected java.lang.String getShortProtocolName()
Get protocol abbrev name.

Returns:
The protocol abbrev name.

makeProposal

public java.lang.Object[] makeProposal(java.lang.Object cfp,
                                       IComponentIdentifier initiator)
Make a proposal based on the task description.

Parameters:
cfp - The cfp including the task to execute.
Returns:
The proposal for executing the task.

executeTask

public java.lang.Object executeTask(java.lang.Object proposal,
                                    java.lang.Object proposal_info,
                                    IComponentIdentifier initiator)
Execute the task.

Parameters:
proposal - The proposal.
proposal_info - The proposal info.
Returns:
The result of the task.


Copyright © 2010. All Rights Reserved.