コード例 #1
0
  // Test
  public void pickMoveHanoi() {
    ExpressionList gameRules = Parser.parseFile("./testdata/games/Hanoi.kif");
    logger.info("" + gameRules);
    game = manager.getGameByGDL(gameRules.toString());
    singlePlayerFuzzySearch = new SinglePlayerSearch(game, "player");
    logger.info("=== Hanoi ===");
    Expression aMove = singlePlayerFuzzySearch.pickMove(game.getInitialNode());

    assertNotNull(aMove);
    assertTrue(aMove instanceof Predicate);
    logger.info("picked move: " + aMove);
    // Atom light = (Atom) ((Predicate) aMove).getOperands().get( 1 );
    // assertEquals  ( aA, light );

  }
コード例 #2
0
  // Test
  public void pickMoveButtonsLights() {
    ExpressionList gameRules = Parser.parseFile("./testdata/buttons_lights.kif");
    logger.info("" + gameRules);
    game = manager.getGameByGDL(gameRules.toString());
    singlePlayerFuzzySearch =
        new SinglePlayerFuzzySearch(game, "robot", new StubMixin(), new TimerFlag());

    logger.info("=== Button lights ===");
    Expression aMove = singlePlayerFuzzySearch.pickMove(game.getInitialNode());

    assertNotNull(aMove);
    assertTrue(aMove instanceof Predicate);
    Atom light = (Atom) ((Predicate) aMove).getOperands().get(1);
    assertEquals(aA, light);

    logger.info(aMove);
  }