Package cs227b.teamIago.resolver

Examples of cs227b.teamIago.resolver.Expression


      return new Variable(new Atom((String)_s));
    return new Atom((String)_s);
  }
  Statement s = (Statement) _s;
  String opt = s.operator.toUpperCase();
  Expression res=null;
 
  // TYPES OF EXPRESSIONS
  // 1. Implication
  if (opt.equals("<=")){ // type implication
    Expression consequence = parseExpression(s.members.get(0));
    ExpList premises = parseExpList(s.members.subList(1, s.members.size()));
    res = new Implication(consequence, premises);
  } else if (opt.equals("=>")){ // type implication
    Expression consequence = parseExpression(s.members.get(s.members.size()-1));
    ExpList premises = parseExpList(s.members.subList(0, s.members.size()-1));
    res = new Implication(consequence, premises);
  }
  else if (opt.equals("OR") && s.members.size() >= 2)
  {
View Full Code Here


 
  public Collection<Term> getSeesXMLTerms(GameState state, RoleInterface<Term> role) {
    ExpList el = null;
    synchronized (gameSim) {
      gameSim.SetGameState(state);
      Expression r = role.getTerm().getExpr();
      el = gameSim.getSeesXMLTerms(r);
    }
    Collection<Term> terms;
    if (el != null) {
      terms = new Vector<Term>(el.size());
View Full Code Here

    ExpList el = ParserAdapter.parseExpressionList(state);
   
    // 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));
View Full Code Here

    int i;
    for (i = 0; i < roles.size(); i++)
    {

      Expression player = roles.get(i);

      System.out.println("Player " + player.toString());
      legalMoves =  myGGP.GetLegalMoves(player);
      if (legalMoves == null)
        System.out.println("No legal moves found.");
      else
        System.out.println("Legal moves: " + legalMoves.toString());
View Full Code Here

 
  public int GetGoalValue(Expression player) {
    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
    return Integer.parseInt(e.toString());
  }
View Full Code Here

TOP

Related Classes of cs227b.teamIago.resolver.Expression

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.