Package stanfordlogic.knowledge

Examples of stanfordlogic.knowledge.GameInformation


        GdlAtom roleAtom = (GdlAtom) content.getElement(2);
        TermObject role_term = (TermObject) TermObject.buildFromGdl(roleAtom);
        my_role = role_term.toString();
       
        GdlList game_description = (GdlList) content.getElement(3);
        GameInformation gameInfo = new MetaGdl(GameManager.getParser()).examineGdl(game_description);
        all_roles = new ArrayList<String>();
        for(TermObject t : gameInfo.getRoles())
        {
            all_roles.add(t.toString());
        }  
        reasoner = new GameReasoner(gameInfo);
       
View Full Code Here


    {
        Parser parser = GameManager.getParser();
       
        Gamer gamer = makeGamer(gameId, parser);
       
        GameInformation gameInfo = new MetaGdl(parser).examineGdl(description);
       
        KnowledgeBase staticKb = new BasicKB();
        staticKb.loadWithFacts(gameInfo.getAllGrounds());
       
        AbstractReasoner reasoner = new BasicReasoner(staticKb, gameInfo.getIndexedRules(), parser);
       
        TermObject myRole = (TermObject) TermObject.buildFromGdl(role);
       
        gamer.initializeGame(myRole, playClock, gameInfo, reasoner);
       
View Full Code Here

    {
        Parser parser = GameManager.getParser();
       
        Gamer gamer = new RandomGamer(gameId, parser);
       
        GameInformation gameInfo = new MetaGdl(parser).examineGdl(description);
       
        KnowledgeBase staticKb = new BasicKB();
        staticKb.loadWithFacts(gameInfo.getAllGrounds());
       
        AbstractReasoner reasoner = new BasicReasoner(staticKb, gameInfo.getIndexedRules(), parser);
       
        TermObject myRole = (TermObject) TermObject.buildFromGdl(role);
       
        gamer.initializeGame(myRole, playClock, gameInfo, reasoner);
       
View Full Code Here

  private GdlList rules;

  public Reasoner(String gameDescription, Parser parser){
    this.parser=parser;
    rules=parser.parse(gameDescription);
        GameInformation gameInfo = new MetaGdl(parser).examineGdl(rules);
        KnowledgeBase staticKb = new BasicKB();
        staticKb.loadWithFacts(gameInfo.getAllGrounds());
        this.stanfordlogicReasoner = new BasicReasoner(staticKb, gameInfo.getIndexedRules(), parser);
    queryTerminal=makeQuery("terminal");
    queryNext=makeQuery("next", "?f");
    queryTrue=makeQuery("true", "?f");
    queryInit=makeQuery("init", "?f");
    trueProcessor=new RelationNameProcessor(parser.TOK_TRUE);
View Full Code Here

    public String env_init()
    {
        GdlAtom roleAtom = (GdlAtom) start_content.getElement(2);
        role = (TermObject) TermObject.buildFromGdl(roleAtom);
        GdlList game_description = (GdlList) start_content.getElement(3);
        GameInformation gameInfo = new MetaGdl(GameManager.getParser()).examineGdl(game_description);
        roles = gameInfo.getRoles();
        reasoner = new GameReasoner(gameInfo);
        state = new GDLState(reasoner);
       
        return start_content.toString();
    }
View Full Code Here

            System.setProperties(p);
           
            RRLAlgorithm algorithm = (RRLAlgorithm)AgentProperties.getAlgorithmClass().newInstance();
            algorithm.load();
           
            GameInformation game_infos = GameReasoner.createGameInfo(path_to_gdl);
           
            List<Agent> agents = new ArrayList<Agent>();
            for(TermObject t : game_infos.getRoles())
            {
                agents.add(new GDLAlgorithmAgent(t.toString()));
            }
           
            GameReasoner reasoner = new GameReasoner(game_infos);
View Full Code Here

    {
        Parser parser = GameManager.getParser();
       
        Gamer gamer = new LegalGamer(gameId, parser);
       
        GameInformation gameInfo = new MetaGdl(parser).examineGdl(description);
       
        KnowledgeBase staticKb = new BasicKB();
        staticKb.loadWithFacts(gameInfo.getAllGrounds());
       
        AbstractReasoner reasoner = new BasicReasoner(staticKb, gameInfo.getIndexedRules(), parser);
       
        TermObject myRole = (TermObject) TermObject.buildFromGdl(role);
       
        gamer.initializeGame(myRole, playClock, gameInfo, reasoner);
       
View Full Code Here

//        assertNull(f);
    }
   
    public void testSpecificMove()
    {
        GameInformation info = MetaGdl.examineGame("game-defs/tictactoe.kif", parser_);
        List<Implication> rules = info.getRules();
       
        assertEquals(26, rules.size());
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_);
       
View Full Code Here

        assertEquals(3, results.size());
    }
   
    public void testMoreTicTacToe() throws IOException
    {
        GameInformation info = MetaGdl.examineGame("game-defs/tictactoe.kif", parser_);
        List<Implication> rules = info.getRules();
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_);
       
        GdlList facts = parser_.parse("(true (cell 1 1 x))(true (cell 1 2 o))(true (cell 1 3 x))(true (cell 2 1 o))(true (cell 2 2 x))(true (cell 2 3 b))(true (cell 3 1 b))(true (cell 3 2 b))(true (cell 3 3 b))(true (control oplayer))");
        addFacts(facts);
       
View Full Code Here

        assertEquals(10, results.size());
    }
   
    public void testTicTacToe() throws IOException
    {
        GameInformation info = MetaGdl.examineGame("game-defs/tictactoe.kif", parser_);
       
        KnowledgeBase staticKb = new BasicKB();
        staticKb.loadWithFacts(info.getAllGrounds());
       
        AbstractReasoner r = new BasicReasoner(staticKb, info.getIndexedRules(), parser_);
       
       
        Fact initQuestion = Fact.fromExpression(parser_.parse("init ?x"));
       
        // Compute the initial state
View Full Code Here

TOP

Related Classes of stanfordlogic.knowledge.GameInformation

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.