Package cs227b.teamIago.resolver

Examples of cs227b.teamIago.resolver.ExpList


  String strContent = Axioms.loadStringFromFile(filename);
  Axioms a = new Axioms();
  a.parseFromString(strContent);
  ArrayList stmts = a.Statements;
 
  ExpList explist = parseExpList(stmts);
  return explist;
}
View Full Code Here


public static ExpList parseDesc(String desc){
  Axioms a = new Axioms();
  a.parseFromString(desc);
  ArrayList stmts = a.Statements;
 
  ExpList explist = parseExpList(stmts);
  return explist;
}
View Full Code Here

  ExpList explist = parseExpList(stmts);
  return explist;
}

static ExpList parseExpList(List stmts){
  ExpList res=new ExpList();
  for (int i=0;i<stmts.size();i++)
    res.add(parseExpression(stmts.get(i)))
  return res;
}
View Full Code Here

        gdl = gdl.substring(1, gdl.length()-1).trim();
  Axioms a = new Axioms();
  a.parseFromString(gdl);
  ArrayList stmts = a.Statements;
 
  ExpList explist = parseExpList(stmts);
  return explist;
   
   
    /*
  gdl = gdl.trim();
View Full Code Here

 
  // 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)
  {
//    if (s.members.size() < 2)
View Full Code Here

  public List<TermInterface> getArgs() {
    if(nativeTerm instanceof Connective){
      return new TermList(((Connective)nativeTerm).getOperands());
    }else{
      return new TermList(new ExpList());
    }
  }
View Full Code Here

      return gameSim.IsTerminal();
    }
  }

  public List<? extends RoleInterface<Term>> getRoles() {
    ExpList expList;
    synchronized (gameSim) {
      expList=gameSim.GetRoles();
    }
    List<Role<Term>> roles=new ArrayList<Role<Term>>();
    for(int i=0;i<expList.size();i++){
      roles.add(new Role<Term>(new Term(expList.get(i))));
    }
    return roles;
  }
View Full Code Here

    }
    return roles;
  }

  public GameState getSuccessorState(GameState state, JointMoveInterface<Term> jointMove) {
    ExpList movesList = getMovesListForJointMove(jointMove);
    synchronized (gameSim) {
      gameSim.SetGameState(state);
      gameSim.SimulateStep(movesList);
      return gameSim.GetGameState();
    }
View Full Code Here

      return gameSim.GetGameState();
    }
  }

  private static ExpList getMovesListForJointMove(JointMoveInterface<Term> jointMove) {
    ExpList movesList=new ExpList();
    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

  }
 
  public boolean isLegal(GameState state, RoleInterface<Term> role, MoveInterface<Term> move) {
    synchronized (gameSim) {
      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)+"):");
View Full Code Here

TOP

Related Classes of cs227b.teamIago.resolver.ExpList

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.