Package aima.core.search.framework

Examples of aima.core.search.framework.SearchAgent


        new MapStepCostFunction(romaniaMap));

    Search search = new AStarSearch(new TreeSearch(),
        new StraightLineDistanceHeuristicFunction(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST, romaniaMap));
    SearchAgent agent = new SearchAgent(problem, search);
    Assert.assertEquals(
        "[Action[name==moveTo, location==Sibiu], Action[name==moveTo, location==RimnicuVilcea], Action[name==moveTo, location==Pitesti], Action[name==moveTo, location==Bucharest]]",
        agent.getActions().toString());
    Assert.assertEquals(4, agent.getActions().size());
    Assert.assertEquals("5",
        agent.getInstrumentation().getProperty("nodesExpanded"));
    Assert.assertEquals("10",
        agent.getInstrumentation().getProperty("queueSize"));
    Assert.assertEquals("11",
        agent.getInstrumentation().getProperty("maxQueueSize"));
  }
View Full Code Here


        new MapStepCostFunction(romaniaMap));

    Search search = new AStarSearch(new GraphSearch(),
        new StraightLineDistanceHeuristicFunction(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST, romaniaMap));
    SearchAgent agent = new SearchAgent(problem, search);
    Assert.assertEquals(
        "[Action[name==moveTo, location==Sibiu], Action[name==moveTo, location==RimnicuVilcea], Action[name==moveTo, location==Pitesti], Action[name==moveTo, location==Bucharest]]",
        agent.getActions().toString());
    Assert.assertEquals(4, agent.getActions().size());
    Assert.assertEquals("5",
        agent.getInstrumentation().getProperty("nodesExpanded"));
    Assert.assertEquals("4",
        agent.getInstrumentation().getProperty("queueSize"));
    Assert.assertEquals("6",
        agent.getInstrumentation().getProperty("maxQueueSize"));
  }
View Full Code Here

      public double h(Object state) {
        return 0; // Don't have one for this test
      }
    };
    Search search = new AStarSearch(new GraphSearch(), hf);
    SearchAgent agent = new SearchAgent(problem, search);

    List<Action> actions = agent.getActions();

    Assert.assertEquals(
        "[Action[name==moveTo, location==b], Action[name==moveTo, location==d], Action[name==moveTo, location==goal]]",
        actions.toString());
    Assert.assertEquals("5.5",
View Full Code Here

          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",
          agent.getInstrumentation().getProperty("queueSize"));
      Assert.assertEquals("141",
          agent.getInstrumentation().getProperty("maxQueueSize"));
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("Exception thrown.");
    }
  }
View Full Code Here

        new MapStepCostFunction(romaniaMap));

    Search search = new GreedyBestFirstSearch(new TreeSearch(),
        new StraightLineDistanceHeuristicFunction(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST, romaniaMap));
    SearchAgent agent = new SearchAgent(problem, search);
    Assert.assertEquals(
        "[Action[name==moveTo, location==Sibiu], Action[name==moveTo, location==Fagaras], Action[name==moveTo, location==Bucharest]]",
        agent.getActions().toString());
    Assert.assertEquals(3, agent.getActions().size());
    Assert.assertEquals("3",
        agent.getInstrumentation().getProperty("nodesExpanded"));
    Assert.assertEquals("6",
        agent.getInstrumentation().getProperty("queueSize"));
    Assert.assertEquals("7",
        agent.getInstrumentation().getProperty("maxQueueSize"));
  }
View Full Code Here

        new MapStepCostFunction(romaniaMap));

    Search search = new GreedyBestFirstSearch(new GraphSearch(),
        new StraightLineDistanceHeuristicFunction(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST, romaniaMap));
    SearchAgent agent = new SearchAgent(problem, search);
    Assert.assertEquals(
        "[Action[name==moveTo, location==Sibiu], Action[name==moveTo, location==Fagaras], Action[name==moveTo, location==Bucharest]]",
        agent.getActions().toString());
    Assert.assertEquals(3, agent.getActions().size());
    Assert.assertEquals("3",
        agent.getInstrumentation().getProperty("nodesExpanded"));
    Assert.assertEquals("4",
        agent.getInstrumentation().getProperty("queueSize"));
    Assert.assertEquals("5",
        agent.getInstrumentation().getProperty("maxQueueSize"));
  }
View Full Code Here

TOP

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

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.