/** * Create a new goal whenever sayhello belief is changed. */ @GoalCreationCondition(beliefs="sayhello") // public HelloGoal(@Event("sayhello") String text) public HelloGoal(String text) { this.text = text; }
@GoalCreationCondition(beliefs="elems") public TestGoal(int[] elems) { this.elems = elems; }
/** * Create a new translate goal. */ @GoalCreationCondition(beliefs="eword") public Translate(String eword) { this.eword = eword; }
/** * Create a new goal whenever sayhello belief is changed. */ @GoalCreationCondition//(beliefs="sayhello") // public HelloGoal(@Event("sayhello") String text) public HelloGoal(String text) { this.text = text; if("first".equals(sayhello)) sayhello = "second"; }
/** * Create a new AGoal. */ // todo: support me @GoalCreationCondition//(beliefs="str") public AGoal(String str) { System.out.println("Created goal: "+str); this.str = str; } }
@GoalCreationCondition public static boolean preCheckNumber(SelectiveBeliefChangeBDI agent) { System.out.println("checking: "+agent.number); return agent.number > 20.0; }
/** * Create a new goal whenever sayhello belief is changed. */ @GoalCreationCondition public HelloGoal(@Event(type=ChangeEvent.FACTCHANGED, value="sayhello") Object val) { this.val = val; }
/** * Create a new goal whenever sayhello belief is changed. */ @GoalCreationCondition public HelloGoal(@Event("sayhello") String text) { this.text = text; }
/** * Create a new HandleDisaster. */ @GoalCreationCondition(rawevents=@RawEvent(value=ChangeEvent.FACTADDED, second="disasters")) public HandleDisaster(ISpaceObject disaster) { this.disaster = disaster; }
/** * Create a new goal whenever sayhello belief is changed. */ @GoalCreationCondition public HelloGoal(@Event(type=ChangeEvent.FACTCHANGED, value="sayhello") Object val) { this.val = val; }
/** * Create a new goal whenever sayhello belief is changed. */ @GoalCreationCondition public HelloGoal(@Event("sayhello") String text) { // System.out.println("New HelloGoal: "+text); this.text = text; } }
/** * Create a new goal whenever sayhello belief is changed. */ @GoalCreationCondition public HelloGoal(@Event("sayhello") String text) { this.text = text; }
/** * Create a new goal whenever sayhello belief is changed. */ @GoalCreationCondition public HelloGoal(@Event("sayhello") String text) { this.text = text; }
/** * Creation condition for creating a goal for every alarm. */ @GoalCreationCondition(beliefs="alarms") public static AlarmGoal checkCreate(Alarm alarm) { return alarm!=null ? new AlarmGoal(alarm) : null; }
/** * Create a new goal. */ // @GoalCreationCondition(beliefs="wastes") // Must not create achieve goals for null wastes (e.g. when the whole set is initialized to a hashset) // @GoalCreationCondition(rawevents={@RawEvent(value=ChangeEvent.FACTADDED, second="wastes")}) // public AchieveCleanup(Waste waste) @GoalCreationCondition(beliefs="wastes") public AchieveCleanup(@CheckNotNull Waste waste) { // System.out.println("chargestate: "+my_chargestate); // if(waste==null) // System.out.println("new achieve cleanup: "+waste); this.waste = waste; }
/** * Create a new Move. */ @GoalCreationCondition(beliefs="missionend") public static boolean checkCreate(MovementCapability capa) { return capa.missionend && !capa.myself.getProperty("position").equals(capa.getHomebasePosition()); }
/** * */ // todo: support directly factadded etc. // @GoalCreationCondition(beliefs="garbages") @GoalCreationCondition(rawevents=@RawEvent(value=ChangeEvent.FACTADDED, second="garbages")) // public static Burn checkCreate(GarbageBurnerBDI outer, ISpaceObject garbage, IEvent event) public static Burn checkCreate(GarbageBurnerBDI outer, ISpaceObject garbage, ChangeEvent event) { // System.out.println("event: "+event.getType()); return garbage==null? null: new Burn(outer, garbage); }
/** * */ // todo: support directly factadded etc. @GoalCreationCondition(beliefs="movecapa.mytargets") public static AnalyzeTarget checkCreate(SentryBDI outer, ISpaceObject target, ChangeEvent event) { if(target==null)// || outer.getMoveCapa().isMissionend()) return null; // System.out.println(":: "+event); AnalyzeTarget ret = null; if(target.getProperty("state").equals("unknown")) ret = new AnalyzeTarget(outer, target); return ret; }
/** * */ // todo: support directly factadded etc. // @GoalCreationCondition(beliefs="garbages") @GoalCreationCondition(rawevents=@RawEvent(value=ChangeEvent.FACTADDED, second="garbages")) // public static boolean checkCreate(GarbageCollectorBDI outer, ISpaceObject garbage, IEvent event) public static boolean checkCreate(GarbageCollectorBDI outer, ISpaceObject garbage, ChangeEvent event) { boolean ret = outer.isDirty() && outer.getEnvironment().getSpaceObjectsByGridPosition(outer.getPosition(), "burner")==null; // if(ret) // System.out.println("collector creating new take goal for: "+garbage); return ret; }
/** * Create a new Move. */ @GoalCreationCondition(rawevents=@RawEvent(ChangeEvent.GOALDROPPED)) public static GoHome checkCreate(FireBrigadeBDI ag) { MovementCapa capa = ag.getMoveCapa(); // System.out.println("check create go home: "+capa.getCapability().getAgent().getGoals().size()+" "+capa.getCapability().getAgent().getAgentName()); if(capa.getCapability().getAgent().getComponentFeature(IBDIAgentFeature.class).getGoals().size()==0 && capa.getHomePosition()!=null && capa.getPosition()!=null && capa.getEnvironment().getDistance(capa.getHomePosition(), capa.getPosition()).getAsDouble()>0.001) { return new GoHome(capa.getHomePosition()); } else { return null; } }