Package stanfordlogic.prover

Examples of stanfordlogic.prover.GroundFact


    }
   
    private Pair<Term, Integer> calculateTerminal(ProofContext context, int currentDepth)
    {
        // figure out my score in this outcome
        GroundFact myGoal = getAnAnswer(context, "goal", myRoleStr_, "?x");
       
        int myScore = Integer.MIN_VALUE;
       
        if (myGoal == null) {
            logger_.severe(gameId_ + ": No goal for me (" + myRoleStr_ + "); using Integer.MIN_VALUE");
        }
        else {
            try {
                myScore = Integer.parseInt(myGoal.getTerm(1).toString());
            }
            catch (NumberFormatException e) {
                logger_.severe(gameId_ + ": My goal (" + myRoleStr_ + ") was not a number; was: " + myGoal.getTerm(1));
            }
        }
       
        reportTerminal(myScore, currentDepth);
       
View Full Code Here


                    // Choose the action for the current state
                    action = RLGlue.RL_agent_step(r_o.getReward(),r_o.getObservation());
                }

                // Get the move from the rl-glue action
                GroundFact move_fact = moves.get(action.intArray[0]);
                Term move_term = move_fact.getTerm(1);
                move = new Triple<Term, String, String>(move_term,"Decicision tomada en RL-GLUE", "");

                // If the choosen move is legal, there is a positive reward
                // If it is not legal, a negative one, and the agent has to choose again
                if (contains(legal_moves, move_fact))
View Full Code Here

    /**
     * Should return a noop Triple.
     */
    private Triple<Term, String, String> createNoop()
    {
        GroundFact legalmoves = getAnAnswer(currentContext_, "legal", myRole_.toString(), "?x");
       
        if (legalmoves == null)
        {
            logger_.severe("No legal moves");
            return null;
        }
        else
        {
            // term 0 is the player, term 1 is the actual move
            Term action = legalmoves.getTerm(1);
            return new Triple<Term, String, String>(action, "Decicision tomada en RL-GLUE", "");
        }
    }
View Full Code Here

        for (TermObject role : roles_)
        {
            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

    }

    @Override
    protected Triple<Term, String, String> moveThink()
    { 
        GroundFact move = getAnAnswer(currentContext_, "legal", myRole_.toString(), "?x");
       
        if (move == null) {
            logger_.severe("No legal moves");
            return null;
        }
        else {
            // term 0 is the player, term 1 is the actual move
            Term action = move.getTerm(1);
           
            return new Triple<Term, String, String>(action, "I'm a silly legal player",
                                                    "I hope you can beat me");
        }
    }
View Full Code Here

        for(int i=0; i<prevMoves.getSize(); i++)
        {
            if (i >= roles_.size())
                break;
           
            previousMoves[i] = new GroundFact(
                    parser_.TOK_DOES,
                    roles_.get(i),
                    Term.buildFromGdl(prevMoves.getElement(i))
                );
        }
View Full Code Here

        for(TermObject role : roles_)
        {
            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.GroundFact

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.