Package stanfordlogic.knowledge

Examples of stanfordlogic.knowledge.BasicKB


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


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

  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");
View Full Code Here

  /* (non-Javadoc)
   * @see tud.gamecontroller.game.jocular.ReasonerInterface#getInitialState()
   */
  public synchronized ProofContext getInitialState() {
        KnowledgeBase kb = new BasicKB();
        Iterable<GroundFact> inits = stanfordlogicReasoner.getAllAnswers(queryInit);
        for (GroundFact init : inits) {
          kb.setTrue(trueProcessor.processFact(init));
        }
        return new ProofContext(kb, parser);
  }
View Full Code Here

    for(Entry<? extends RoleInterface<Term>, ? extends MoveInterface<Term>> entry:jointMove.entrySet()){
      GroundFact moveFact=new GroundFact(parser.TOK_DOES, entry.getKey().getTerm().getExpr(), entry.getValue().getTerm().getExpr());
          state.getVolatileKb().setTrue(moveFact);
        }
    Iterable<GroundFact> nextFacts=stanfordlogicReasoner.getAllAnswersIterable(queryNext, state);
        KnowledgeBase kb = new BasicKB();
        for (GroundFact fact : nextFacts) {
          kb.setTrue(trueProcessor.processFact(fact));
        }
    return new ProofContext(kb, parser);
  }
View Full Code Here

    public GameReasoner(GameInformation gameInfo)
    {
        super(GameManager.getParser());
       
        game_information = gameInfo;
        KnowledgeBase staticKb = new BasicKB();
        staticKb.loadWithFacts(gameInfo.getAllGrounds());
        reasoner_ = new BasicReasoner(staticKb, gameInfo.getIndexedRules(), parser_);
    }
View Full Code Here

        return facts;
    }
   
    public ProofContext getContext()
    {
        KnowledgeBase kb = new BasicKB();
        for(GroundFact fact : facts)
        {
            kb.setTrue(fact);
        }
        return new ProofContext(kb, GameManager.getParser());
    }
View Full Code Here

        // We now have playClock-2 seconds to finish our search.
       
        Pair<Term, Integer> searchResult;
       
        // Construct the root search state
        KnowledgeBase rootState = new BasicKB();
        for (GroundFact ground : currentState_.getIterable()) {
            rootState.setTrue(ground);
        }
        // ... and the proof contex to go with it
        ProofContext rootContext = new ProofContext(rootState, parser_);
       
        // Run the minimax search.
View Full Code Here

       
        // Figure out what is true in the new state
        Iterable<GroundFact> nexts = reasoner_.getAllAnswersIterable(QUERY_NEXT, context);
       
        // FIXME: this should create a knowledge base of the same type as the current one
        KnowledgeBase newState = new BasicKB();
       
        for (GroundFact next: nexts) {
            newState.setTrue(trueProcessor_.processFact(next));
        }
       
        ProofContext newContext = new ProofContext(newState, parser_);
       
        // Run the recursive search
View Full Code Here

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

TOP

Related Classes of stanfordlogic.knowledge.BasicKB

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.