Package aima.core.environment.eightpuzzle

Examples of aima.core.environment.eightpuzzle.ManhattanHeuristicFunction


      Problem problem = new Problem(boardWithThreeMoveSolution,
          EightPuzzleFunctionFactory.getActionsFunction(),
          EightPuzzleFunctionFactory.getResultFunction(),
          new EightPuzzleGoalTest());
      Search search = new GreedyBestFirstSearch(new GraphSearch(),
          new ManhattanHeuristicFunction());
      SearchAgent agent = new SearchAgent(problem, search);
      printActions(agent.getActions());
      printInstrumentation(agent.getInstrumentation());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


    try {
      Problem problem = new Problem(random1, EightPuzzleFunctionFactory
          .getActionsFunction(), EightPuzzleFunctionFactory
          .getResultFunction(), new EightPuzzleGoalTest());
      SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(
          new ManhattanHeuristicFunction());
      SearchAgent agent = new SearchAgent(problem, search);
      printActions(agent.getActions());
      System.out.println("Search Outcome=" + search.getOutcome());
      System.out.println("Final State=\n" + search.getLastSearchState());
      printInstrumentation(agent.getInstrumentation());
View Full Code Here

    try {
      Problem problem = new Problem(random1, EightPuzzleFunctionFactory
          .getActionsFunction(), EightPuzzleFunctionFactory
          .getResultFunction(), new EightPuzzleGoalTest());
      Search search = new AStarSearch(new GraphSearch(),
          new ManhattanHeuristicFunction());
      SearchAgent agent = new SearchAgent(problem, search);
      printActions(agent.getActions());
      printInstrumentation(agent.getInstrumentation());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      Problem problem = new Problem(board,
          EightPuzzleFunctionFactory.getActionsFunction(),
          EightPuzzleFunctionFactory.getResultFunction(),
          new EightPuzzleGoalTest());
      Search search = new AStarSearch(new GraphSearch(),
          new ManhattanHeuristicFunction());
      SearchAgent agent = new SearchAgent(problem, search);
      Assert.assertEquals(23, agent.getActions().size());
      Assert.assertEquals("926",
          agent.getInstrumentation().getProperty("nodesExpanded"));
      Assert.assertEquals("534",
View Full Code Here

      Problem problem = new Problem(board,
          EightPuzzleFunctionFactory.getActionsFunction(),
          EightPuzzleFunctionFactory.getResultFunction(),
          new EightPuzzleGoalTest());
      Search search = new GreedyBestFirstSearch(new GraphSearch(),
          new ManhattanHeuristicFunction());
      SearchAgent agent = new SearchAgent(problem, search);
      Assert.assertEquals(49, agent.getActions().size());
      Assert.assertEquals("197",
          agent.getInstrumentation().getProperty("nodesExpanded"));
      Assert.assertEquals("140",
View Full Code Here

TOP

Related Classes of aima.core.environment.eightpuzzle.ManhattanHeuristicFunction

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.