Skip to content

Action Types

Taha Doğan Güneş edited this page Oct 24, 2017 · 2 revisions

Actions that are supported in Stacked Alternating Offers Protocol:

  • Accept: is used to createFrom an action which symbolizes that an agent accepts an offer.
  • Offer: symbolizes the action to leave a negotiation.
  • EndNegotiation: symbolizes the action to leave a negotiation.

Checking the type of an action with instanceof:

if ( action instanceof Offer) {
   // action is an offer
   Offer offer = (Offer) action;
}

Getting the bid from an offer action:

if ((action instanceof Offer)) {
    lastBid = ((Offer) action).getBid();
}

Clone this wiki locally