/** * Test if it is the iterated contract-net version. * @return True, if is is the iterated version. */ protected boolean isIterated() { return ((Boolean)getParameter("iterated").getValue()).booleanValue(); }
/** * Test if it is the iterated contract-net version. * @return True, if is is the iterated version. */ protected boolean isIterated() { return ((Boolean)getParameter("iterated").getValue()).booleanValue(); }
/** * Get protocol abbrev name. * @return The protocol abbrev name. */ protected String getShortProtocolName() { String ret; if(SFipa.PROTOCOL_REQUEST.equals(getParameter("protocol").getValue())) ret = "rp"; else ret = "qp"; return ret; } }
/** * Get protocol abbrev name. * @return The protocol abbrev name. */ protected String getShortProtocolName() { String ret; if(SFipa.PROTOCOL_REQUEST.equals(getParameter("protocol").getValue())) ret = "rp"; else ret = "qp"; return ret; } }
/** * Called when the plan is finished, i.e. when * the interaction is completed. */ public void passed() { if(hasParameter("interaction_state")) { InteractionState state = (InteractionState)getParameter("interaction_state").getValue(); if(InteractionState.INTERACTION_RUNNING.equals(state.getInteractionState())) { state.setInteractionState(InteractionState.INTERACTION_FINISHED); } } }
public void body() { IMessageEvent updateMsg = (IMessageEvent) getReason(); IGoal handleUpdate = createGoal("sp_handle_update"); handleUpdate.getParameter("subscription_id").setValue(updateMsg.getParameter(SFipa.CONVERSATION_ID).getValue()); handleUpdate.getParameter("update").setValue(updateMsg.getParameter(SFipa.CONTENT).getValue()); dispatchTopLevelGoal(handleUpdate); } }
/** * Plan body. */ public void body() { Object cfp = getParameter("cfp").getValue(); Object cfp_info = getParameter("cfp_info").getValue(); NegotiationRecord[] history = (NegotiationRecord[])getParameterSet("history").getValues(); ParticipantProposal[] proposals = (ParticipantProposal[])getParameterSet("proposals").getValues(); IProposalEvaluator evaluator = (IProposalEvaluator)cfp_info; ParticipantProposal[] acceptables = evaluator.evaluateProposals(cfp, cfp_info, history, proposals); getParameterSet("acceptables").addValues(acceptables); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSShutdownPlatform sd = (CMSShutdownPlatform)getParameter("action").getValue(); dispatchSubgoalAndWait(createGoal("cms_shutdown_platform")); getParameter("result").setValue(new Done(sd)); } }
/** * The plan body. */ public void body() { IGoal igoal = createGoal((String)getParameter("goaltype").getValue()); igoal.getParameter("message").setValue(getReason()); dispatchTopLevelGoal(igoal); } }
public void body() { IMessageEvent msg = (IMessageEvent) getReason(); IMessageEvent reply = getEventbase().createReply(msg, "sp_agree"); sendMessage(reply); IGoal startSub = createGoal("sp_start_subscription"); startSub.getParameter("initiator").setValue(msg.getParameter(SFipa.SENDER).getValue()); startSub.getParameter("subscription_id").setValue(msg); startSub.getParameter("subscription").setValue(msg.getParameter(SFipa.CONTENT).getValue()); dispatchSubgoalAndWait(startSub); } }
/** * Execute a plan. */ public void body() { IComponentIdentifier aid = (IComponentIdentifier)getParameter("componentidentifier").getValue(); IFuture ret = ((IComponentManagementService)getServiceContainer().getRequiredService("cms").get(this)).resumeComponent(aid); IComponentDescription desc = (IComponentDescription) ret.get(this); getParameter("componentdescription").setValue(desc); }
/** * Execute the plan. */ public void body() { IMessageEvent rep = getEventbase().createReply((IMessageEvent)getReason(), "not_understood"); rep.getParameter(SFipa.CONTENT).setValue(((IParameterElement)getReason()).getParameter(SFipa.CONTENT).getValue()); sendMessage(rep); // sendMessage(((IMessageEvent)getReason()).createReply( // "not_understood", getReason().getParameter(SFipa.CONTENT).getValue())); } }
/** * Execute a plan. */ public void body() { IComponentIdentifier cid = (IComponentIdentifier)getParameter("componentidentifier").getValue(); IFuture ret =((IComponentManagementService)getServiceContainer().getRequiredService("cms").get(this)).suspendComponent(cid); IComponentDescription desc = (IComponentDescription)ret.get(this); getParameter("componentdescription").setValue(desc); } }
/** * Execute the request. * @param request The request. * @param initiator The requesting agent. * @return The result. */ public Object executeRequest(Object request, IComponentIdentifier initiator) { IGoal execute_request = createGoal(getShortProtocolName()+"_execute_request"); execute_request.getParameter("action").setValue(request); execute_request.getParameter("initiator").setValue(initiator); dispatchSubgoalAndWait(execute_request); return execute_request.getParameter("result").getValue(); }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSSuspendComponent sa = (CMSSuspendComponent)getParameter("action").getValue(); IGoal sag = createGoal("cms_suspend_component"); sag.getParameter("componentidentifier").setValue(sa.getComponentIdentifier()); dispatchSubgoalAndWait(sag); getParameter("result").setValue(new Done(sa)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSResumeComponent ra = (CMSResumeComponent)getParameter("action").getValue(); IGoal rag = createGoal("cms_suspend_component"); rag.getParameter("componentidentifier").setValue(ra.getComponentIdentifier()); dispatchSubgoalAndWait(rag); getParameter("result").setValue(new Done(ra)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSDestroyComponent da = (CMSDestroyComponent)getParameter("action").getValue(); IGoal dag = createGoal("cms_destroy_component"); dag.getParameter("componentidentifier").setValue(da.getComponentIdentifier()); dispatchSubgoalAndWait(dag); getParameter("result").setValue(new Done(da)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { DFDeregister de = (DFDeregister)getParameter("action").getValue(); IGoal dreg = createGoal("df_deregister"); dreg.getParameter("description").setValue(de.getComponentDescription()); dispatchSubgoalAndWait(dreg); getParameter("result").setValue(new Done(de)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSShutdownPlatform sp = new CMSShutdownPlatform(); IGoal req = createGoal("rp_initiate"); req.getParameter("receiver").setValue(getParameter("cms").getValue()); req.getParameter("action").setValue(sp); req.getParameter("ontology").setValue(SFipa.COMPONENT_MANAGEMENT_ONTOLOGY_NAME); dispatchSubgoalAndWait(req); } }