public boolean executeAction(String agName, Structure act) { String actName = act.getFunctor(); System.out.println("Action " + actName + " received!"); if (actName.equals("hello")) { Literal l = Literal.parseLiteral("world[source(lucca)]"); addPercept(l); } if (actName.equals("clean")) { clearPercepts(); } return true; }
@Override public boolean executeAction(String agName, Structure action) { logger.info("executing: " + action + " (" + agName + ")"); // select the external action boolean result = false; String functor = action.getFunctor(); List<Term> terms = action.getTerms(); if (functor.equals("sendNLU")) { result = this.model.sendNlu(agName, terms); } else if (functor.equals("sendUser")) { result = this.model.sendUser(terms.get(0).toString()); } else if (functor.equals("findTravel")) { result = this.model.findTravel(agName, terms); return true; } else { logger.info(action + " was not implemented."); } return result; }
public OperatorImpl(String declaration) { super(Structure.parse(declaration)); this.preconds = new ArrayList<Proposition>(); this.effects = new ArrayList<Proposition>(); }