/** * Plan that prints the time. */ @Plan(trigger=@Trigger(factchangeds="time")) protected void printTime() { System.out.println(formatter.format(time)); }
Class<?>[] gs = trigger.goals(); Class<?>[] gfs = trigger.goalfinisheds(); String[] fas = trigger.factaddeds(); String[] frs = trigger.factremoveds(); String[] fcs = trigger.factchangeds(); ServiceTrigger st = trigger.service();
Class<?>[] gs = trigger.goals(); Class<?>[] gfs = trigger.goalfinisheds(); String[] fas = trigger.factaddeds(); String[] frs = trigger.factremoveds(); String[] fcs = trigger.factchangeds(); ServiceTrigger st = trigger.service();
/** * Translate a word. Plan that translates. */ @Plan(trigger=@Trigger(goals=Translate.class)) protected String translateB(String eword) { System.out.println("Plan B"); return wordtable.get(eword); } }
/** * The plans responds to the goal being violated and shows a dialog, * that asks the user to move the mouse. */ @Plan(trigger=@Trigger(goals=InUpperLeftCorner.class)) void moveToCorner() { JOptionPane.showMessageDialog(null, "Please move the mouse to the upper left corner."); }
/** * Plan reacts to the automatically created * translation goal. * @param tg The translation goal. */ @Plan(trigger=@Trigger(goals=TranslationGoal.class)) public String translatePlan(String eword) { return wordtable.get(eword); }
/** * Inline plan method that reacts on count goal. */ @Plan(trigger=@Trigger(goals=CountGoal.class)) protected IFuture<Void> inc(CountGoal goal) { counter++; System.out.println("counter is: "+counter); return IFuture.DONE; }
/** * Translate a word. */ @Plan(trigger=@Trigger(goals=Translate.class)) protected String translate(String eword) { return wordtable.get(eword); } }
/** * */ @Plan(trigger=@Trigger(goals=ExternalPlanBDI.MyGoal.class)) public class ExternalPlan { @PlanBody public void body() { System.out.println("body"); } }
/** * Plan that reacts on the goals. */ @Plan(trigger=@Trigger(goals={AGoal.class, BGoal.class})) public String plan() { return "result"; } }
@Plan(trigger=@Trigger(goals=SomeGoal.class)) protected void planC(SomeGoal goal) { System.out.println("Plan C"); goal.plans.add("C"); }
@Plan(trigger=@Trigger(goals=SomeGoal.class)) protected void planD(SomeGoal goal) { System.out.println("Plan D"); goal.plans.add("D"); }
/** * Plan A. */ @Plan(trigger=@Trigger(goals=MyGoal.class)) protected void planA(MyGoal goal) { System.out.println("Plan A"); }
/** * Plan B. */ @Plan(trigger=@Trigger(goals=MyGoal.class)) protected void planB(MyGoal goal) { System.out.println("Plan B"); }
/** * Inline plan method that reacts on count goal. */ @Plan(trigger=@Trigger(goals=Count2Goal.class)) protected IFuture<Void> inc(Count2Goal goal) { counter++; System.out.println("counter is: "+counter); return IFuture.DONE; } }
/** * Removal plan that remove one entry. */ @Plan(trigger=@Trigger(goals=MaintainStorageGoal.class)) protected void removeEntry() { String key = wordtable.keySet().iterator().next(); String val = wordtable.remove(key); System.out.println("removed: "+key+" "+val+" "+ wordtable); }
/** * Translate a word. Plan that translates. */ @Plan(trigger=@Trigger(goals=Translate.class)) protected void translate(String eword) { System.out.println("Translated: "+eword+" "+wordtable.get(eword)); } }
/** * Inline plan method that reacts on count goal. */ @Plan(trigger=@Trigger(goals=Count2Goal.class)) protected IFuture<Void> inc(Count2Goal goal) { counter++; System.out.println("counter is: "+counter); return IFuture.DONE; } }
@Plan(trigger=@Trigger(goals=TestGoal.class)) protected class TestPlan { @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)); } } }
/** * */ @Plan(trigger=@Trigger(goals=AGoal.class)) protected String doubleP(String p) { return p+p; }