Class EAInitiatorPlan


  • public class EAInitiatorPlan
    extends AbstractInitiatorPlan
    This plan implements the initiator of the "FIPA English Auction Interaction Protocol Specification" (XC00031 - Experimental). An English auction is one where bidders continously can increase the current offer until no one is willing to increase any more.
    • Constructor Detail

      • EAInitiatorPlan

        public EAInitiatorPlan()
    • Method Detail

      • passed

        public void passed()
        Description copied from class: Plan
        The passed method is called on plan success.
        Overrides:
        passed in class Plan
      • failed

        public void failed()
        Description copied from class: Plan
        The failed method is called on plan failure/abort.
        Overrides:
        failed in class Plan
      • aborted

        public void aborted()
        Description copied from class: AbstractInitiatorPlan
        Called when the plan is aborted, i.e., when the corresponding interaction goal is dropped. Terminates the interaction using the FIPA-Cancel-Meta-Protocol.
        Overrides:
        aborted in class AbstractInitiatorPlan
      • announceAuction

        protected 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.
      • waitForAuctionStart

        protected void waitForAuctionStart​(AuctionDescription auctiondesc,
                                           java.util.List receivers)
        Wait for the auction start time.
        Parameters:
        auctiondesc - The auction description.
        receivers - The receivers.
      • sendCFP

        protected 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.
      • decideIteration

        protected 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.
      • waitForProposals

        protected 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.
      • evaluateAuctionResults

        protected 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.
      • announceAuctionEnd

        protected 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.
        winner - The winner.