Package aima.core.search.uninformed

Examples of aima.core.search.uninformed.DepthLimitedSearch


    try {
      Problem problem = new Problem(new NQueensBoard(8),
          NQueensFunctionFactory.getIActionsFunction(),
          NQueensFunctionFactory.getResultFunction(),
          new NQueensGoalTest());
      Search search = new DepthLimitedSearch(8);
      SearchAgent agent = new SearchAgent(problem, search);
      printActions(agent.getActions());
      printInstrumentation(agent.getInstrumentation());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


    System.out.println("\nEightPuzzleDemo recursive DLS (9) -->");
    try {
      Problem problem = new Problem(boardWithThreeMoveSolution, EightPuzzleFunctionFactory
          .getActionsFunction(), EightPuzzleFunctionFactory
          .getResultFunction(), new EightPuzzleGoalTest());
      Search search = new DepthLimitedSearch(9);
      SearchAgent agent = new SearchAgent(problem, search);
      printActions(agent.getActions());
      printInstrumentation(agent.getInstrumentation());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public void testSuccesfulDepthLimitedSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(8),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new DepthLimitedSearch(8);
    SearchAgent agent = new SearchAgent(problem, search);
    List<Action> actions = agent.getActions();
    assertCorrectPlacement(actions);
    Assert.assertEquals("113",
        agent.getInstrumentation().getProperty("nodesExpanded"));
View Full Code Here

  public void testCutOff() throws Exception {
    Problem problem = new Problem(new NQueensBoard(8),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    DepthLimitedSearch search = new DepthLimitedSearch(1);
    SearchAgent agent = new SearchAgent(problem, search);
    List<Action> actions = agent.getActions();
    Assert.assertEquals(true, search.isCutOff(actions));
  }
View Full Code Here

  public void testFailure() throws Exception {
    Problem problem = new Problem(new NQueensBoard(3),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    DepthLimitedSearch search = new DepthLimitedSearch(5);
    SearchAgent agent = new SearchAgent(problem, search);
    List<Action> actions = agent.getActions();
    Assert.assertEquals(true, search.isFailure(actions));
  }
View Full Code Here

TOP

Related Classes of aima.core.search.uninformed.DepthLimitedSearch

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.