/** * Drop condition. * @return True if should be dropped. */ @GoalDropCondition(beliefs="missionend") public boolean checkDrop() { return missionend; } }
c.beliefs(), c.rawevents(), c.parameters(), model, m, cl);
c.beliefs(), c.rawevents(), c.parameters(), model, m, cl); mgoal.addCondition(MGoal.CONDITION_DROP, mcond);
@GoalDropCondition(parameters="order") public boolean checkDrop() { return order.getState().equals(Order.FAILED); }
/** * Called whenever the counter belief changes. */ @GoalDropCondition protected boolean drop(@Event("counter") int cnt) { return cnt==drop; } }
@GoalDropCondition(parameters="order") public boolean checkDrop() { return order.getState().equals(Order.FAILED); }
/** * */ @GoalDropCondition(beliefs="movecapa.missionend") public boolean checkDrop() { return movecapa.isMissionend(); }
/** * */ @GoalDropCondition(beliefs="movecapa.missionend") public boolean checkDrop() { return movecapa.isMissionend(); }
/** * Called whenever the counter belief changes. */ @GoalDropCondition protected boolean drop(@Event("counter") int cnt) { return cnt==drop; }
/** * Called whenever the counter belief changes. */ @GoalDropCondition protected boolean drop(@Event("counter") int cnt) { return cnt==drop; } }
/** * Drop the goal when waste is not seen * anymore and the agent agent does not carry it. */ @GoalDropCondition(beliefs={"carriedwaste", "wastes"}) public boolean checkDrop() { // System.out.println("drop triggerd: "+getWaste()); return getCarriedWaste()==null && !getWastes().contains(waste); }
/** * */ @GoalDropCondition(beliefs="movecapa.missionend") public boolean checkDrop() { // System.out.println("dropping: "+this+" "+outer.getMoveCapa().isMissionend()); return outer.getMoveCapa().isMissionend(); }
/** * */ @GoalDropCondition(beliefs="garbages") public boolean checkDrop() { boolean ret = !isDirty() && !hasGarbage(); // if(ret) // System.out.println("drop pick: "+isDirty()+", "+hasGarbage()+" "+myself.getProperty(Space2D.PROPERTY_POSITION)); return ret; //!$beliefbase.is_dirty && !$beliefbase.has_garbage } }
/** * Drop if there is another goal. */ @GoalDropCondition(rawevents={@RawEvent(ChangeEvent.GOALADOPTED), @RawEvent(ChangeEvent.GOALDROPPED)}) public boolean checkDrop(FireBrigadeBDI ag) { MovementCapa capa = ag.getMoveCapa(); boolean ret = capa.getCapability().getAgent().getComponentFeature(IBDIAgentFeature.class).getGoals().size()>1; // System.out.println("check drop fire brigade: "+this+" "+capa.getCapability().getAgent().getGoals()); return ret; }
/** * Drop if this goal is only option and there are others. */ @GoalDropCondition(rawevents={@RawEvent(value=ChangeEvent.GOALOPTION, secondc=TreatVictims.class)}) public boolean checkDrop(AmbulanceBDI ag, IGoal goal) { MovementCapa capa = ag.getMoveCapa(); boolean ret = GoalLifecycleState.OPTION.equals(goal.getLifecycleState()) && capa.getCapability().getAgent().getComponentFeature(IBDIAgentFeature.class).getGoals(TreatVictims.class).size()>1; if(ret) System.out.println("dropping treat victim: "+disaster); return ret; } }
/** * Drop if there is another goal. */ @GoalDropCondition(rawevents={@RawEvent(ChangeEvent.GOALADOPTED), @RawEvent(ChangeEvent.GOALDROPPED)}) public boolean checkDrop(AmbulanceBDI ag) { MovementCapa capa = ag.getMoveCapa(); boolean ret = capa.getCapability().getAgent().getComponentFeature(IBDIAgentFeature.class).getGoals().size()>1; // System.out.println("dropping: "+this); return ret; }
/** * Drop if this goal is only option and there are others. */ @GoalDropCondition(rawevents={@RawEvent(ChangeEvent.GOALOPTION), @RawEvent(ChangeEvent.GOALADOPTED)}) public boolean checkDrop(FireBrigadeBDI ag, IGoal goal) { MovementCapa capa = ag.getMoveCapa(); boolean ret = GoalLifecycleState.OPTION.equals(goal.getLifecycleState()) && capa.getCapability().getAgent().getComponentFeature(IBDIAgentFeature.class).getGoals(ExtinguishFire.class).size()>1; // if(ret) // System.out.println("dropping ext fire: "+disaster); return ret; }
/** * Drop if this goal is only option and there are others. */ @GoalDropCondition(rawevents={@RawEvent(ChangeEvent.GOALOPTION), @RawEvent(ChangeEvent.GOALADOPTED)}) public boolean checkDrop(FireBrigadeBDI ag, IGoal goal) { MovementCapa capa = ag.getMoveCapa(); boolean ret = GoalLifecycleState.OPTION.equals(goal.getLifecycleState()) && capa.getCapability().getAgent().getComponentFeature(IBDIAgentFeature.class).getGoals(ClearChemicals.class).size()>1; // if(ret) // System.out.println("dropping clear chemicals: "+disaster); return ret; }