Package aima.core.search.framework

Examples of aima.core.search.framework.Problem


        agent.getInstrumentation().getProperty("nodesExpanded"));
  }

  @Test
  public void testDepthFirstUnSuccessfulSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(3),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new DepthFirstSearch(new GraphSearch());
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here


public class IterativeDeepeningSearchTest {

  @Test
  public void testIterativeDeepeningSearch() {
    try {
      Problem problem = new Problem(new NQueensBoard(8),
          NQueensFunctionFactory.getIActionsFunction(),
          NQueensFunctionFactory.getResultFunction(),
          new NQueensGoalTest());
      Search search = new IterativeDeepeningSearch();
      SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

public class DepthLimitedSearchTest {

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

        agent.getInstrumentation().getProperty("nodesExpanded"));
  }

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

    Assert.assertEquals(true, search.isCutOff(actions));
  }

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

      // EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]
      // {0,8,7,6,5,4,3,2,1});
      EightPuzzleBoard board = new EightPuzzleBoard(new int[] { 7, 1, 8,
          0, 4, 6, 2, 3, 5 });

      Problem problem = new Problem(board,
          EightPuzzleFunctionFactory.getActionsFunction(),
          EightPuzzleFunctionFactory.getResultFunction(),
          new EightPuzzleGoalTest());
      Search search = new AStarSearch(new GraphSearch(),
          new ManhattanHeuristicFunction());
View Full Code Here

  }

  @Test
  public void testAIMA3eFigure3_15() throws Exception {
    Map romaniaMap = new SimplifiedRoadMapOfPartOfRomania();
    Problem problem = new Problem(SimplifiedRoadMapOfPartOfRomania.SIBIU,
        MapFunctionFactory.getActionsFunction(romaniaMap),
        MapFunctionFactory.getResultFunction(), new DefaultGoalTest(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST),
        new MapStepCostFunction(romaniaMap));
View Full Code Here

  }

  @Test
  public void testAIMA3eFigure3_24() throws Exception {
    Map romaniaMap = new SimplifiedRoadMapOfPartOfRomania();
    Problem problem = new Problem(SimplifiedRoadMapOfPartOfRomania.ARAD,
        MapFunctionFactory.getActionsFunction(romaniaMap),
        MapFunctionFactory.getResultFunction(), new DefaultGoalTest(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST),
        new MapStepCostFunction(romaniaMap));
View Full Code Here

  }

  @Test
  public void testAIMA3eFigure3_24_using_GraphSearch() throws Exception {
    Map romaniaMap = new SimplifiedRoadMapOfPartOfRomania();
    Problem problem = new Problem(SimplifiedRoadMapOfPartOfRomania.ARAD,
        MapFunctionFactory.getActionsFunction(romaniaMap),
        MapFunctionFactory.getResultFunction(), new DefaultGoalTest(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST),
        new MapStepCostFunction(romaniaMap));
View Full Code Here

    map.addBidirectionalLink("b", "d", 2.0);
    map.addBidirectionalLink("c", "d", 4.0);
    map.addBidirectionalLink("c", "e", 1.0);
    map.addBidirectionalLink("d", "goal", 1.0);
    map.addBidirectionalLink("e", "goal", 5.0);
    Problem problem = new Problem("start",
        MapFunctionFactory.getActionsFunction(map),
        MapFunctionFactory.getResultFunction(), new DefaultGoalTest(
            "goal"), new MapStepCostFunction(map));

    HeuristicFunction hf = new HeuristicFunction() {
View Full Code Here

TOP

Related Classes of aima.core.search.framework.Problem

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.