getWaitqueue().addReply(dummy); getParameter("result").setValue(new Object[]{winning_offer, auction_wo}); getWaitqueue().removeReply(dummy);
int counter = 0; int todetect = 5; // adding 5 facts getWaitqueue().addFactAdded("beliefSetToAddFacts"); try
goals[i].getParameter("player").setValue(players[i]); getWaitqueue().addGoalFinished(goals[i]); dispatchSubgoal(goals[i]); getLogger().info("Playing with player: "+players[i]);
getWaitqueue().addInternalEvent("gui_closed");
try getWaitqueue().addReply(cancel); sendMessage(cancel); while(rec.size()>0) getWaitqueue().removeReply(cancel);
getWaitqueue().addReply(request); Object[] answers = getWaitqueue().getElements(); getWaitqueue().removeReply(request); getWaitqueue().addReply(request); getWaitqueue().removeReply(request);
msg.getParameter(SFipa.CONTENT).setValue(rb); msg.getParameterSet(SFipa.RECEIVERS).addValue(player.getAgentID()); getWaitqueue().addReply(msg); IMessageEvent betmsg = sendMessageAndWait(msg, timeout); getWaitqueue().removeReply(msg);
getWaitqueue().addReply(dummy); getParameter("result").setValue(new Object[]{winning_offer, auction_wo}); getWaitqueue().removeReply(dummy);
getWaitqueue().addInternalEvent("someevent"); getWaitqueue().addInternalEvent("someevent");
getWaitqueue().addMessageEvent("inform_reports"); getWaitqueue().removeMessageEvent("inform_reports"); List reports = (List)msg.getParameter(SFipa.CONTENT).getValue();
getWaitqueue().removeReply(start);
getWaitqueue().addReply(request); IMessageEvent event = sendMessageAndWait(request, getTimeout()); event = handleFirstAnswer(event); getWaitqueue().removeReply(request);
/** * 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); }
getWaitqueue().addMessageEvent("inform_reports"); getWaitqueue().removeMessageEvent("inform_reports"); List<?> reports = (List<?>)msg.getParameter(SFipa.CONTENT).getValue(); for(int i=0; i<reports.size(); i++) getWaitqueue().removeMessageEvent("inform_reports"); reports = (List<?>)msg.getParameter(SFipa.CONTENT).getValue(); for(int i=0; i<reports.size(); i++)
getWaitqueue().removeReply(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("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); }
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(); } }
@Override public void failed() { if(start!=null) { getWaitqueue().removeReply(start); } super.failed(); }
@Override public void failed() { if(me!=null) { getWaitqueue().removeReply(me); } super.failed(); }