/** * Announce the planned auction. * @param auctiondesc the auction description. * @param receivers The receivers. * @param convid The conversation id. */ protected void announceAuction(Object auctiondesc, List receivers, String convid) { // Send the inform_start_auction-message to all receivers. start = getEventbase().createMessageEvent("ea_inform_start_auction"); start.getParameterSet(SFipa.RECEIVERS).addValues(receivers.toArray()); start.getParameter(SFipa.CONTENT).setValue(auctiondesc); start.getParameter(SFipa.CONVERSATION_ID).setValue(convid); getLogger().info(getComponentName() + ":\tinform_start_auction"); getWaitqueue().addReply(start); sendMessage(start); }
/** * Announce the planned auction. * @param auctiondesc the auction description. * @param receivers The receivers. * @param convid The conversation id. */ protected void announceAuction(Object auctiondesc, List receivers, String convid) { // Send the inform_start_auction-message to all receivers. start = getEventbase().createMessageEvent("da_inform_start_auction"); start.getParameterSet(SFipa.RECEIVERS).addValues(receivers.toArray()); start.getParameter(SFipa.CONTENT).setValue(auctiondesc); start.getParameter(SFipa.CONVERSATION_ID).setValue(convid); getLogger().info(getComponentName() + ": inform_start_auction"); getWaitqueue().addReply(start); sendMessage(start); }
getWaitqueue().addReply(dummy);
try getWaitqueue().addReply(cancel); sendMessage(cancel); while(rec.size()>0)
getWaitqueue().addReply(dummy);
msg.getParameter(SFipa.CONTENT).setValue(rb); msg.getParameterSet(SFipa.RECEIVERS).addValue(player.getAgentID()); getWaitqueue().addReply(msg); IMessageEvent betmsg = sendMessageAndWait(msg, timeout);
getWaitqueue().addReply(request); IMessageEvent event = sendMessageAndWait(request, getTimeout()); event = handleFirstAnswer(event);
/** * Send the cfp message. * @param nr The current negotation record. * @param convid The conversation id. */ protected void sendCFP(NegotiationRecord nr, String convid) { startAtomic(); if(me!=null) { getWaitqueue().removeReply(me); } me = createMessageEvent(getShortProtocolName()+"_cfp"); me.getParameterSet(SFipa.RECEIVERS).addValues(nr.getParticipants()); me.getParameter(SFipa.CONVERSATION_ID).setValue(convid); me.getParameter(SFipa.CONTENT).setValue(nr.getCFP()); if(getParameter(SFipa.LANGUAGE).getValue()!=null) me.getParameter(SFipa.LANGUAGE).setValue(getParameter(SFipa.LANGUAGE).getValue()); if(getParameter(SFipa.ONTOLOGY).getValue()!=null) me.getParameter(SFipa.ONTOLOGY).setValue(getParameter(SFipa.ONTOLOGY).getValue()); getWaitqueue().addReply(me); endAtomic(); getLogger().info(getComponentName()+" (I)CNPPlan initiated: "+convid); sendMessage(me); }
public void body() { IMessageEvent subReq = createMessageEvent("sp_subscribe"); subReq.getParameter(SFipa.CONTENT).setValue(getParameter("subscription").getValue()); subReq.getParameterSet("receivers").addValue(getParameter("receiver").getValue()); if(getParameter("language").getValue()!=null) subReq.getParameter("language").setValue(getParameter("language").getValue()); if(getParameter("ontology").getValue()!=null) subReq.getParameter("ontology").setValue(getParameter("ontology").getValue()); if(getParameter("conversation_id").getValue()!=null) subReq.getParameter("conversation_id").setValue(getParameter("conversation_id").getValue()); getParameter("subscription_id").setValue(subReq.getParameter(SFipa.CONVERSATION_ID)); getWaitqueue().addReply(subReq); IMessageEvent reply = sendMessageAndWait(subReq); if (!SFipa.AGREE.equals(reply.getParameter(SFipa.PERFORMATIVE).getValue())) fail(); } }