/** * 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 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() { 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() { 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 plan body. */ public void body() { Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); Vision v = env.getCompleteVision(); RequestCompleteVision rcv = (RequestCompleteVision)getParameter("action").getValue(); rcv.setVision(v); Done done = new Done(); done.setAction(rcv); getParameter("result").setValue(done); }
/** * The plan body. */ public void body() { RequestVision rv = (RequestVision)getParameter("action").getValue(); Cleaner cl = rv.getCleaner(); Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); Vision v = env.getVision(cl); rv.setVision(v); Done done = new Done(); done.setAction(rv); getParameter("result").setValue(done); } }
/** * The plan body. */ public void body() { RequestPickUpWaste op = (RequestPickUpWaste)getParameter("action").getValue(); Waste waste = op.getWaste(); Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); boolean success = env.pickUpWaste(waste); if(!success) fail(); Done done = new Done(); done.setAction(op); getParameter("result").setValue(done); }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { DFRegister re = (DFRegister)getParameter("action").getValue(); IGoal reg = createGoal("df_register"); reg.getParameter("description").setValue(re.getComponentDescription()); dispatchSubgoalAndWait(reg); re.setResult((IDFComponentDescription)reg.getParameter("result").getValue()); getParameter("result").setValue(new Done(re)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { DFModify mo = (DFModify)getParameter("action").getValue(); IGoal reg = createGoal("df_modify"); reg.getParameter("description").setValue(mo.getComponentDescription()); dispatchSubgoalAndWait(reg); mo.setResult((IDFComponentDescription)reg.getParameter("result").getValue()); getParameter("result").setValue(new Done(mo)); } }
Done done = new Done(); done.setAction(re); getParameter("result").setValue(done);
/** * The plan body. */ public void body() { // System.out.println("a) move: "+getComponentName()); RequestMove rm = (RequestMove)getParameter("action").getValue(); Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); TaskInfo ti = env.addMoveTask(rm.getCreature(), rm.getDirection()); // Wait until all tasks are processed by the environment. waitForCondition("notasks"); // System.out.println("b) move: "+getComponentName()); // Result is null, when creature died and action was not executed. if(ti.getResult()!=null && ((Boolean)ti.getResult()).booleanValue()) { Done done = new Done(); done.setAction(rm); getParameter("result").setValue(done); } else { fail(); } } }
/** * The plan body. */ public void body() { RequestDropWaste op = (RequestDropWaste)getParameter("action").getValue(); Waste waste = op.getWaste(); String wastebinname = op.getWastebinname(); Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); Wastebin wb = env.getWastebin(wastebinname); boolean success = env.dropWasteInWastebin(waste, wb); if(!success) fail(); Done done = new Done(); done.setAction(op); getParameter("result").setValue(op); }
/** * The plan body. */ public void body() { // System.out.println("Env: dispatching vision!!!"); RequestVision rv = (RequestVision)getParameter("action").getValue(); Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); Vision v = env.getVision(rv.getCreature()); rv.setVision(v); Done done = new Done(); done.setAction(rv); getParameter("result").setValue(done); /*IMessageEvent req = (IMessageEvent)getInitialEvent(); RequestVision rv = (RequestVision)req.getContent(); Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); Vision v = env.getVision(rv.getCreature()); rv.setVision(v); Done done = new Done(); done.setAction(rv); sendMessage(req.createReply("inform_done", done));*/ } }
/** * The plan body. */ public void body() { /*IMessageEvent req = (IMessageEvent)getInitialEvent(); RequestWorldSize rws = (RequestWorldSize)req.getContent(); Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); rws.setWidth(env.getWidth()); rws.setHeight(env.getHeight()); Done done = new Done(); done.setAction(rws); sendMessage(req.createReply("inform_done", done));*/ RequestWorldSize rws = (RequestWorldSize)getParameter("action").getValue(); Environment env = (Environment)getBeliefbase().getBelief("environment").getFact(); rws.setWidth(env.getWidth()); rws.setHeight(env.getHeight()); Done done = new Done(); done.setAction(rws); getParameter("result").setValue(done); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSSearchComponents sa = (CMSSearchComponents)getParameter("action").getValue(); IGoal sag = createGoal("cms_search_components"); sag.getParameter("description").setValue(sa.getComponentDescription()); sag.getParameter("constraints").setValue(sa.getSearchConstraints()); sag.getParameter("remote").setValue(sa.isRemote()? Boolean.TRUE: Boolean.FALSE); dispatchSubgoalAndWait(sag); sa.setComponentDescriptions((IComponentDescription[])sag.getParameterSet("result").getValues()); getParameter("result").setValue(new Done(sa)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { DFSearch sa = (DFSearch)getParameter("action").getValue(); IGoal sag = createGoal("df_search"); sag.getParameter("description").setValue(sa.getComponentDescription()); sag.getParameter("constraints").setValue(sa.getSearchConstraints()); sag.getParameter("remote").setValue(sa.isRemote()? Boolean.TRUE: Boolean.FALSE); dispatchSubgoalAndWait(sag); sa.setResults((IDFComponentDescription[])sag.getParameterSet("result").getValues()); getParameter("result").setValue(new Done(sa)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSCreateComponent ca = (CMSCreateComponent)getParameter("action").getValue(); IGoal cag = createGoal("cms_create_component"); cag.getParameter("name").setValue(ca.getName()); cag.getParameter("type").setValue(ca.getType()); cag.getParameter("configuration").setValue(ca.getConfiguration()); cag.getParameter("arguments").setValue(ca.getArguments()); cag.getParameter("suspend").setValue(Boolean.valueOf(ca.isSuspend())); cag.getParameter("master").setValue(Boolean.valueOf(ca.isMaster())); cag.getParameter("parent").setValue(ca.getParent()); cag.getParameter("rid").setValue(ca.getResourceIdentifier()); dispatchSubgoalAndWait(cag); ca.setComponentIdentifier((IComponentIdentifier)cag.getParameter("componentidentifier").getValue()); getParameter("result").setValue(new Done(ca)); } }
Done done = new Done(rj);
msg.getParameter(SFipa.CONTENT).setValue(new Done(rb)); getLogger().info("sending bet to the dealer ... waiting for cardSet"); sendMessage(msg);