/** * The body method is called on the * instantiated plan instance from the scheduler. */ @PlanBody public abstract void body();
/** * The plan body. */ @PlanBody public String translateEnglishGerman() { // throw new PlanFailureException(); return wordtable.get(gword); }
@PlanBody protected void walk() { System.out.println("Walked to Uni."); } }
@PlanBody public void body() { System.out.println("body"); } }
@PlanBody protected IFuture<Void> body() { System.out.println("Plan C"); res += "C"; return IFuture.DONE; } }
@PlanBody protected IFuture<Void> body() { System.out.println("Plan D"); res += "D"; return IFuture.DONE; } }
/** * Plan body invoke once when plan is activated. */ @PlanBody public void translateEnglishGerman() { String eword = "dog"; String gword = wordtable.get(eword); System.out.println("Translated: "+eword+" - "+gword); } }
/** * Plan body invoke once when plan is activated. */ @PlanBody public void translateEnglishGerman() { String eword = "dog"; String gword = wordtable.get(eword); System.out.println("Translated: "+eword+" - "+gword); } }
@PlanBody protected void body(final IPlan plan) { testArrayList.add(new int[5]); int[] arr = new int[]{5}; System.out.println("plan end: "+Arrays.toString(arr)); } }
/** * * @param eword * @return */ @PlanBody // public void body(String eword) public String body(Object[] params) { String eword = (String)params[0]; String gword = wordtable.get(eword); System.out.println("Translated with internal dictionary dictionary: "+eword+" - "+gword); return gword; } }
/** * The body method is called on the * instantiated plan instance from the scheduler. */ @PlanBody public void body() { allocateForces("clearchemicalsservices", "chemicals"); } }
/** * The body method is called on the * instantiated plan instance from the scheduler. */ @PlanBody public void body() { allocateForces("extinguishfireservices", "fire"); } }
/** * The plan body. */ @PlanBody public IFuture<Void> body() { return moveToTarget(); }
/** * The body method is called on the * instantiated plan instance from the scheduler. */ @PlanBody public void body() { allocateForces("treatvictimservices", "victims"); } }
@PlanBody public void body() throws Exception { gui.setSlogan("Best joke ever"); // blocks until user feedback is received }
@PlanBody public void body() throws Exception { URLConnection con = new URL("http://tambal.azurewebsites.net/joke/random").openConnection(); InputStream is = con.getInputStream(); String json = new String(SUtil.readStream(is)); String joke = json.substring(json.lastIndexOf(":")+2, json.length()-2); is.close(); gui.setSlogan(joke); // blocks until user feedback is received System.out.println("plan end: "+this); }
@PlanBody public void body() { if(slogans.size()==0) throw new PlanFailureException(); int idx = r.nextInt(slogans.size()); String slogan = slogans.remove(idx); gui.setSlogan(slogan); // blocks until user feedback is received System.out.println("plan end: "+this); }
/** * The plan body. */ @PlanBody public String translateEnglishGerman() { System.out.println("Plan started."); plan.waitFor(10000).get(); System.out.println("Plan resumed."); return wordtable.get(gword); }
@PlanBody protected void takeTrain(IPlan plan) { System.out.println("Trying to take train to Uni."); plan.dispatchSubgoal(new TakeXGoal(TakeXGoal.Type.TRAIN)).get(); System.out.println("Took train to Uni."); } }
@PlanBody protected IFuture<Void> body() { System.out.println("Plan A"); res += "A"; return new Future<Void>(new PlanFailureException()); // return IFuture.DONE; } }