/** * Test if it is the iterated contract-net version. * @return True, if is is the iterated version. */ protected boolean isIterated() { return ((Boolean)getParameter("iterated").getValue()).booleanValue(); }
/** * Test if it is the iterated contract-net version. * @return True, if is is the iterated version. */ protected boolean isIterated() { return ((Boolean)getParameter("iterated").getValue()).booleanValue(); }
public void customResultAvailable(Object result) { ret.setResult((Integer)goal.getParameter("proposal").getValue()); } });
/** * The body method is called on the * instantiated plan instance from the scheduler. */ public void body() { ISpaceObject disaster = (ISpaceObject)getParameter("disaster").getValue(); IClearChemicalsService force = (IClearChemicalsService)getParameter("rescueforce").getValue(); cc = force.clearChemicals(disaster.getId()); cc.get(Timeout.NONE); // hack??? clearing chemicals may take longer than default timeout }
/** * The body method is called on the * instantiated plan instance from the scheduler. */ public void body() { ISpaceObject disaster = (ISpaceObject)getParameter("disaster").getValue(); IExtinguishFireService force = (IExtinguishFireService)getParameter("rescueforce").getValue(); // System.out.println("Calling forces to handle fire: " + disaster); ef = force.extinguishFire(disaster.getId()); ef.get(Timeout.NONE); // hack??? extinguishing fire may take longer than default timeout }
/** * The body method is called on the * instantiated plan instance from the scheduler. */ public void body() { ISpaceObject disaster = (ISpaceObject)getParameter("disaster").getValue(); ITreatVictimsService force = (ITreatVictimsService)getParameter("rescueforce").getValue(); tv = force.treatVictims(disaster.getId()); tv.get(Timeout.NONE); // hack??? treating victims may take longer than default timeout }
/** * The plan body. */ public void body() { Double maxprice = (Double)getBeliefbase().getBelief("max_price").getFact(); Double price = (Double)getParameter("cfp").getValue(); getParameter("accept").setValue(Boolean.valueOf(price.doubleValue() <= maxprice.doubleValue())); } }
/** * The plan body. */ public void body() { Double maxprice = (Double)getBeliefbase().getBelief("max_price").getFact(); Double price = (Double)getParameter("cfp").getValue(); Boolean accept = Boolean.valueOf(price.doubleValue() <= maxprice.doubleValue()); //System.out.println(getAgentName()+" accept="+accept+" price="+price+" max="+maxprice); getParameter("accept").setValue(accept); } }
/** * When move to location or eat food finally failed, * add food to forbidden food. */ public void failed() { getBeliefbase().getBeliefSet("forbidden_food") .addFact(getParameter("food").getValue()); } }
/** * The plan body. */ public void body() { boolean participate = ((Boolean)getBeliefbase().getBelief("participate").getFact()).booleanValue(); getLogger().info(getComponentName()+" deciding on participation in auction " +((AuctionDescription)getParameter("auction_description").getValue()).getTopic()+" "+participate); getParameter("participate").setValue(Boolean.valueOf(participate)); } }
public void body() { IMessageEvent updateMsg = (IMessageEvent) getReason(); IGoal handleUpdate = createGoal("sp_handle_update"); handleUpdate.getParameter("subscription_id").setValue(updateMsg.getParameter(SFipa.CONVERSATION_ID).getValue()); handleUpdate.getParameter("update").setValue(updateMsg.getParameter(SFipa.CONTENT).getValue()); dispatchTopLevelGoal(handleUpdate); } }
/** * The plan body. */ public void body() { IOfferGenerator gen = (IOfferGenerator)getParameter("cfp_info").getValue(); gen.setNextRound(); // Use offer only when limit was not reached yet. if(!gen.getLimitOffer().equals(gen.getLastOffer())) getParameter("cfp").setValue(gen.getCurrentOffer()); }
/** * The plan body. */ public void body() { IOfferGenerator gen = (IOfferGenerator)getParameter("cfp_info").getValue(); gen.setNextRound(); // Use offer only when limit was not reached yet. if(!gen.getLimitOffer().equals(gen.getLastOffer())) getParameter("cfp").setValue(gen.getCurrentOffer()); } }
/** * The plan body. */ public void body() { RequestEat re = new RequestEat((Creature)getBeliefbase().getBelief("my_self").getFact(), (WorldObject)getParameter("object").getValue()); requestAction(re); } }
/** * The plan body. */ public void body() { IEnvironment environment = (IEnvironment)getBeliefbase().getBelief("environment").getFact(); Waste waste = (Waste)getParameter("waste").getValue(); boolean success = environment.pickUpWaste(waste); if(!success) throw new PlanFailureException(); } }
/** * The plan body. */ public void body() { IGoal igoal = createGoal((String)getParameter("goaltype").getValue()); igoal.getParameter("message").setValue(getReason()); dispatchTopLevelGoal(igoal); } }
/** * The plan body. */ public void body() { //System.out.println(getAgentName()+" wants to move: "+getRootGoal().getParameter("direction").getValue()); RequestMove rm = new RequestMove((Creature)getBeliefbase().getBelief("my_self").getFact(), (String)getParameter("direction").getValue()); requestAction(rm); } }
/** * The plan body. */ public void body() { RequestVision rv = new RequestVision((Creature)getBeliefbase().getBelief("my_self").getFact()); IGoal result = requestAction(rv); //Done done = (Done)result.getGoal().getResult(); Done done = (Done)result.getParameter("result").getValue(); getParameter("vision").setValue(((RequestVision)done.getAction()).getVision()); } }