Package cs227b.teamIago.resolver

Examples of cs227b.teamIago.resolver.Predicate


//    else
      res = new NotOp(parseExpression(s.members.get(0)));
  }
  // 2. Associations
  else {
    res = new Predicate(opt, parseExpList(s.members));
  }
  return res;
}
View Full Code Here


    assert(jointMove!=null);
    for(Entry<? extends RoleInterface<Term>, ? extends MoveInterface<Term>> entry:jointMove.entrySet()){
      ExpList doesArgs=new ExpList();
      doesArgs.add(entry.getKey().getTerm().getExpr());
      doesArgs.add(entry.getValue().getTerm().getExpr());
      movesList.add(new Predicate(new Atom("DOES"), doesArgs));
    }
    return movesList;
  }
View Full Code Here

      gameSim.SetGameState(state);
      ExpList expList=new ExpList();
      expList.add(role.getTerm().getExpr());
      expList.add(move.getTerm().getExpr());
      try {
        return gameSim.getTheory().findp(new Predicate(new Atom("LEGAL"),expList));
      } catch (InterruptedException e) {
        Logger logger=Logger.getLogger(Reasoner.class.getName());
        logger.severe("reasoner was interrupted during findp("+new Predicate(new Atom("LEGAL"),expList)+"):");
        logger.severe(e.getMessage());
        return false;
      }
    }
  }
View Full Code Here

    Collection<FluentInterface<Term>> fluents=new LinkedList<FluentInterface<Term>>();
    Iterator<ExpList> it=state.getMap().values().iterator();
    while(it.hasNext()){
      ExpList el=it.next();
      for(int i=0;i<el.size();i++){
        Predicate true_expr=(Predicate)el.get(i);
         fluents.add(new Fluent<Term>(new Term(true_expr.getOperands().get(0))));
      }
    }
    return fluents;
  }
View Full Code Here

   
    // surround with (true ...)
    Expression[] exps = new Expression[el.size()];
    for (int i = 0; i < el.size(); i++) {
      Expression e = el.get(i);
      exps[i] = new Predicate("true", new Expression[] {e});
    }
    // add to theory and extract the GameState
    Theory t = new Theory(true, false);
    t.setState(new ExpList(exps));
    GameState gs = t.getState();
View Full Code Here

    theoryObj.add(moves);
    ExpList seesArgs = new ExpList();
    seesArgs.add(player);
    seesArgs.add(vX);
    try {
      el = theoryObj.finds(vX, new Predicate(aSees,seesArgs));
    } catch (InterruptedException e) {
      wasInterrupted = true;
    }
    return el;
  }
View Full Code Here

    ExpList el = null;
    ExpList seesArgs = new ExpList();
    seesArgs.add(player);
    seesArgs.add(vX);
    try {
      el = theoryObj.finds(vX, new Predicate(aSeesXML,seesArgs));
    } catch (InterruptedException e) {
      wasInterrupted = true;
    }
    return el;
  }
View Full Code Here

  public ExpList GetLegalMoves(Expression player){
    ExpList roleVar = new ExpList();
    roleVar.add(player);
    roleVar.add(vX);
    try {
      return theoryObj.finds(new Predicate(aDoes, roleVar), new Predicate(aLegal,roleVar));
    } catch (InterruptedException e) {
      wasInterrupted = true;
      return null;
    }
  }
View Full Code Here

  public ExpList GetGoalValues(Expression player){
    ExpList roleVar = new ExpList();
    roleVar.add(player);
    roleVar.add(vX);
    try {
      return theoryObj.finds(vX,new Predicate(aGoal,roleVar));
    } catch (InterruptedException e) {
      wasInterrupted = true;
      return null;
    }
  }
View Full Code Here

    ExpList roleVar = new ExpList();
    roleVar.add(player);
    roleVar.add(vX);
    Expression e;
    try {
      e = theoryObj.findx(vX,new Predicate(aGoal,roleVar));
    } catch (InterruptedException ie) {
      wasInterrupted = true;
      e  = null;
    }
    if (e == null) return MIN_GOAL; // not sure what to do in this case
View Full Code Here

TOP

Related Classes of cs227b.teamIago.resolver.Predicate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.