public void exceptionOccurred(Exception exception) { // todo: what if meta-level reasoning fails?! pae.planFinished(ia, rgoal); } });
public void resultAvailable(Void result) { RPLANS.set(null); ip.getCapability().removePlan(rplan); Object reason = rplan.getReason(); if(reason instanceof RProcessableElement) ((RProcessableElement)reason).planFinished(ia, rplan); }
/** * Called when a plan has finished. */ public void planFinished(IInternalAccess ia, RPlan rplan) { super.planFinished(ia, rplan); finished = true; if(rplan!=null) { PlanLifecycleState state = rplan.getLifecycleState(); if(state.equals(RPlan.PlanLifecycleState.FAILED)) { setException(rplan.getException()); } } notifyListeners(); }
public void customResultAvailable(Void result) { // System.out.println("find applicable candidates 2: "+element+" "+apl); if(apl.isEmpty()) { element.setState(RProcessableElement.State.NOCANDIDATES); element.planFinished(ia, null); // element.reason(ia); } else { element.setState(RProcessableElement.State.APLAVAILABLE); ia.getExternalAccess().scheduleStep(new SelectCandidatesAction(element)); } ret.setResult(null); } }));
public void resultAvailable(Void result) { Object res = RGoal.getGoalResult(rgoal, ia.getClassLoader()); if(mgoal.isMetagoal()) { // Execute selected plans if was metagoal // APL is automatically kept uptodate for(ICandidateInfo ci: (ICandidateInfo[])res) { RPlan.executePlan((RPlan)ci.getPlan(), ia); } } else { pae.planFinished(ia, rgoal); // Set goal result on parent goal if(pagoal!=null) pagoal.setGoalResult(res, ia.getClassLoader(), null, null, rgoal); } }
element.planFinished(ia, null);
public void customResultAvailable(Void result) { if(apl.isEmpty()) { // if(element.toString().indexOf("go_home")!=-1) // System.out.println("find applicable candidates 2a: "+element.getId()+" "+apl); element.setState(RProcessableElement.State.NOCANDIDATES); element.planFinished(ia, null); // element.reason(ia); } else { // if(element.toString().indexOf("go_home")!=-1) // System.out.println("find applicable candidates 2b: "+element.getId()+" "+apl); element.setState(RProcessableElement.State.APLAVAILABLE); ia.getComponentFeature(IExecutionFeature.class).scheduleStep(new SelectCandidatesAction(element)); } ret.setResult(null); } public void exceptionOccurred(Exception exception)
ia.getLogger().severe("Plan '"+cand+"' threw exception: "+sw); element.planFinished(ia, new IInternalPlan() if(allcands.size()==1) element.planFinished(ia, null); ret.setResult(null); return ret; element.planFinished(ia, null);
if(rplan.getReason() instanceof RProcessableElement) ((RProcessableElement)rplan.getReason()).planFinished(rplan.getAgent(), null);
super.planFinished(ia, rplan); childplan = null;