Package stanfordlogic.prover

Examples of stanfordlogic.prover.TermObject


        // Informations are the game description
        GdlList content = GameManager.getParser().parse(informations);
        content = (GdlList) content.getElement(0);
       
        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())
View Full Code Here


        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);
       
        return gamer;
    }
View Full Code Here

    {
        Substitution s = new Substitution();
       
        TermVariable v1 = TermVariable.makeTermVariable();
        TermVariable v2 = TermVariable.makeTermVariable();
        TermObject t = TermObject.makeTermObject(256);
       
        s.addMapping( v1, v2 );
        s.addMapping( v2, t );
       
        assertEquals(2, s.numMappings() );
View Full Code Here

        {
            return 0;
        }
        else
        {
            TermObject score = (TermObject) goal.getTerm(1);
            // 0   loose
            // 50  draw match
            // 100 win
            return Integer.parseInt(score.toString());
        }
    }
View Full Code Here

   
    private void findRoleIndex()
    {
        for (int i = 0; i < roles_.size(); i++)
        {
            TermObject role = roles_.get(i);
           
            if (role.equals(myRole_)) {
                myRoleIndex_ = i;
                return;
            }
        }
       
View Full Code Here

        {
            int payoff = 0;
            try
            {
                GroundFact goal = getAnAnswer(currentContext_, "goal", role.toString(), "?x");
                TermObject score = (TermObject) goal.getTerm(1);
                payoff = Integer.parseInt(score.toString());
            }
            catch(Exception e)
            {
                payoff = -1;
            }
View Full Code Here

        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);
       
        return gamer;
    }
View Full Code Here

        List<List<GroundFact>> otherMoves = new ArrayList<List<GroundFact>>();
        List<GroundFact> myMoves = null;
       
        for (int i = 0; i < roles_.size(); i++)
        {
            TermObject role = roles_.get(i);
            List<GroundFact> roleMoves = getAllAnswers(context, "legal", role.toString(), "?x");
           
            if (roleMoves.size() == 0) {
                logger_.severe(gameId_ + ": role " + role.toString() + " had no legal moves!");
            }
           
            if (i == myRoleIndex_) {
                myMoves = roleMoves;
               
View Full Code Here

        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);
       
        return gamer;
    }
View Full Code Here

        {
            int payoff = 0;
            try
            {
                GroundFact goal = getAnAnswer(currentContext_, "goal",role.toString(), "?x");
                TermObject score = (TermObject) goal.getTerm(1);
                payoff = Integer.parseInt(score.toString());
            }
            catch (Exception e)
            {
                payoff = -1;
            }
View Full Code Here

TOP

Related Classes of stanfordlogic.prover.TermObject

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.