예제 #1
0
파일: EnvHello.java 프로젝트: rlucca/Maro
 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;
 }
예제 #2
0
  @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;
  }
예제 #3
0
 public OperatorImpl(String declaration) {
   super(Structure.parse(declaration));
   this.preconds = new ArrayList<Proposition>();
   this.effects = new ArrayList<Proposition>();
 }