Class DAInitiatorPlan
- java.lang.Object
- 
- jadex.bdiv3x.runtime.Plan
- 
- jadex.bdi.planlib.protocols.AbstractInitiatorPlan
- 
- jadex.bdi.planlib.protocols.dutchauction.DAInitiatorPlan
 
 
 
- 
 public class DAInitiatorPlan extends AbstractInitiatorPlan This plan implements the initiator of the "FIPA Dutch Auction Interaction Protocol Specification" (XC00032 - Experimental) A dutch auction is one where the auctioneer starts with a high start price and continually lowers it until the first bidder accepts the price.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class jadex.bdiv3x.runtime.PlanPlan.PlanWaitAbstraction
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected IMessageEventstartThe initial message.
 - 
Constructor SummaryConstructors Constructor Description DAInitiatorPlan()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaborted()Called when the plan is aborted, i.e., when the corresponding interaction goal is dropped.protected voidannounceAuction(java.lang.Object auctiondesc, java.util.List receivers, java.lang.String convid)Announce the planned auction.protected voidannounceAuctionEnd(java.util.List receivers, java.lang.String convid, java.lang.Object winning_offer, IComponentIdentifier winner)Announce the end of the auction to all participants that did not leave the auction.voidbody()The plan body.protected java.lang.Object[]decideIteration(java.lang.Object cfp_info, java.lang.Object[] history)Decide about the next iteration.protected voidevaluateAuctionResults(AuctionDescription auctiondesc, java.lang.Object cfp_info, java.lang.Object[] history, IComponentIdentifier winner, java.lang.Object winning_offer)Evaluate the auction results and decide about participation.voidfailed()The failed method is called on plan failure/abort.protected IMessageEventgetInitialMessage()Get the initial message.voidpassed()The passed method is called on plan success.protected voidsendCFP(java.lang.Object cfp, java.lang.String convid, java.util.List receivers)Send cfps to all receivers.protected voidwaitForAuctionStart(AuctionDescription auctiondesc, java.util.List receivers)Wait for the auction start time.protected IComponentIdentifierwaitForProposals(java.lang.Object cfp, long roundtimeout, java.util.List receivers)Wait for proposals of participants.- 
Methods inherited from class jadex.bdi.planlib.protocols.AbstractInitiatorPlangetTimeout
 - 
Methods inherited from class jadex.bdiv3x.runtime.PlancheckNotInAtomic, createExpression, createGoal, createInternalEvent, createMessageEvent, dispatchInternalEvent, dispatchSubgoal, dispatchSubgoalAndWait, dispatchSubgoalAndWait, dispatchTopLevelGoal, endAtomic, fail, fail, fail, getAgent, getBeliefbase, getClock, getComponentDescription, getComponentIdentifier, getComponentName, getDispatchedElement, getEventbase, getException, getExpression, getExpressionbase, getExternalAccess, getGoalbase, getLogger, getParameter, getParameters, getParameterSet, getParameterSets, getPlanbase, getPlanElement, getReason, getRPlan, getScope, getTime, getWaitqueue, hasParameter, hasParameterSet, killAgent, sendMessage, sendMessageAndWait, sendMessageAndWait, startAtomic, toString, waitFor, waitForCondition, waitForCondition, waitForCondition, waitForConditionInline, waitForConditionInline, waitForEver, waitForFactAdded, waitForFactAdded, waitForFactChanged, waitForFactChanged, waitForFactRemoved, waitForFactRemoved, waitForGoalFinished, waitForGoalFinished, waitForGoalFinished, waitForGoalFinished, waitForInternalEvent, waitForInternalEvent, waitForMessageEvent, waitForMessageEvent, waitForReply, waitForReply, waitForReply, waitForReply, waitForTick
 
- 
 
- 
- 
- 
Field Detail- 
startprotected IMessageEvent start The initial message.
 
- 
 - 
Method Detail- 
bodypublic void body() The plan body.- Overrides:
- bodyin class- AbstractInitiatorPlan
 
 - 
passedpublic void passed() Description copied from class:PlanThe passed method is called on plan success.
 - 
failedpublic void failed() Description copied from class:PlanThe failed method is called on plan failure/abort.
 - 
abortedpublic void aborted() Description copied from class:AbstractInitiatorPlanCalled when the plan is aborted, i.e., when the corresponding interaction goal is dropped. Terminates the interaction using the FIPA-Cancel-Meta-Protocol.- Overrides:
- abortedin class- AbstractInitiatorPlan
 
 - 
announceAuctionprotected void announceAuction(java.lang.Object auctiondesc, java.util.List receivers, java.lang.String convid)Announce the planned auction.- Parameters:
- auctiondesc- the auction description.
- receivers- The receivers.
- convid- The conversation id.
 
 - 
waitForAuctionStartprotected void waitForAuctionStart(AuctionDescription auctiondesc, java.util.List receivers) Wait for the auction start time.- Parameters:
- auctiondesc- The auction description.
- receivers- The receivers.
 
 - 
sendCFPprotected void sendCFP(java.lang.Object cfp, java.lang.String convid, java.util.List receivers)Send cfps to all receivers.- Parameters:
- cfp- The cfp.
- convid- The conversation id.
- receivers- The receivers.
 
 - 
decideIterationprotected java.lang.Object[] decideIteration(java.lang.Object cfp_info, java.lang.Object[] history)Decide about the next iteration.- Parameters:
- cfp_info- The cfp info.
- history- The history.
- Returns:
- The new cfp and cfp_info as an object array.
 
 - 
waitForProposalsprotected IComponentIdentifier waitForProposals(java.lang.Object cfp, long roundtimeout, java.util.List receivers) Wait for proposals of participants.- Parameters:
- cfp- the cfp.
- roundtimeout- The round timeout.
- receivers- The receivers.
- Returns:
- The message of the winner.
 
 - 
evaluateAuctionResultsprotected void evaluateAuctionResults(AuctionDescription auctiondesc, java.lang.Object cfp_info, java.lang.Object[] history, IComponentIdentifier winner, java.lang.Object winning_offer) Evaluate the auction results and decide about participation.- Parameters:
- auctiondesc- The auction description.
- cfp_info- The cfp info.
- history- The historz of cfps.
- winner- the winner.
- winning_offer- The winning offer.
 
 - 
announceAuctionEndprotected void announceAuctionEnd(java.util.List receivers, java.lang.String convid, java.lang.Object winning_offer, IComponentIdentifier winner)Announce the end of the auction to all participants that did not leave the auction.- Parameters:
- receivers- The receivers.
- convid- The conversation id.
- winning_offer- The winning offer.
 
 - 
getInitialMessageprotected IMessageEvent getInitialMessage() Get the initial message.- Specified by:
- getInitialMessagein class- AbstractInitiatorPlan
 
 
- 
 
-