Package aima.core.search.framework

Examples of aima.core.search.framework.DefaultGoalTest


    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() {
      public double h(Object state) {
        return 0; // Don't have one for this test
View Full Code Here


  @Test
  public void testAlreadyAtGoal() {
    MapEnvironment me = new MapEnvironment(aMap);
    LRTAStarAgent agent = new LRTAStarAgent(new OnlineSearchProblem(
        MapFunctionFactory.getActionsFunction(aMap),
        new DefaultGoalTest("A"), new MapStepCostFunction(aMap)),
        MapFunctionFactory.getPerceptToStateFunction(), hf);
    me.addAgent(agent, "A");
    me.addEnvironmentView(new TestEnvironmentView());
    me.stepUntilDone();
View Full Code Here

  @Test
  public void testNormalSearch() {
    MapEnvironment me = new MapEnvironment(aMap);
    LRTAStarAgent agent = new LRTAStarAgent(new OnlineSearchProblem(
        MapFunctionFactory.getActionsFunction(aMap),
        new DefaultGoalTest("F"), new MapStepCostFunction(aMap)),
        MapFunctionFactory.getPerceptToStateFunction(), hf);
    me.addAgent(agent, "A");
    me.addEnvironmentView(new TestEnvironmentView());
    me.stepUntilDone();
View Full Code Here

  @Test
  public void testNoPath() {
    MapEnvironment me = new MapEnvironment(aMap);
    LRTAStarAgent agent = new LRTAStarAgent(new OnlineSearchProblem(
        MapFunctionFactory.getActionsFunction(aMap),
        new DefaultGoalTest("G"), new MapStepCostFunction(aMap)),
        MapFunctionFactory.getPerceptToStateFunction(), hf);
    me.addAgent(agent, "A");
    me.addEnvironmentView(new TestEnvironmentView());
    // Note: Will search forever if no path is possible,
    // Therefore restrict the number of steps to something
View Full Code Here

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

    Search search = new GreedyBestFirstSearch(new TreeSearch(),
        new StraightLineDistanceHeuristicFunction(
View Full Code Here

  @Test
  public void testAIMA3eFigure3_23_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));

    Search search = new GreedyBestFirstSearch(new GraphSearch(),
        new StraightLineDistanceHeuristicFunction(
View Full Code Here

  @Test
  public void testAlreadyAtGoal() {
    MapEnvironment me = new MapEnvironment(aMap);
    OnlineDFSAgent agent = new OnlineDFSAgent(new OnlineSearchProblem(
        MapFunctionFactory.getActionsFunction(aMap),
        new DefaultGoalTest("A"), new MapStepCostFunction(aMap)),
        MapFunctionFactory.getPerceptToStateFunction());
    me.addAgent(agent, "A");
    me.addEnvironmentView(new TestEnvironmentView());
    me.stepUntilDone();
View Full Code Here

  @Test
  public void testNormalSearch() {
    MapEnvironment me = new MapEnvironment(aMap);
    OnlineDFSAgent agent = new OnlineDFSAgent(new OnlineSearchProblem(
        MapFunctionFactory.getActionsFunction(aMap),
        new DefaultGoalTest("G"), new MapStepCostFunction(aMap)),
        MapFunctionFactory.getPerceptToStateFunction());
    me.addAgent(agent, "A");
    me.addEnvironmentView(new TestEnvironmentView());
    me.stepUntilDone();
View Full Code Here

    aMap = new ExtendableMap();
    aMap.addBidirectionalLink("A", "B", 1.0);
    MapEnvironment me = new MapEnvironment(aMap);
    OnlineDFSAgent agent = new OnlineDFSAgent(new OnlineSearchProblem(
        MapFunctionFactory.getActionsFunction(aMap),
        new DefaultGoalTest("X"), new MapStepCostFunction(aMap)),
        MapFunctionFactory.getPerceptToStateFunction());
    me.addAgent(agent, "A");
    me.addEnvironmentView(new TestEnvironmentView());

    me.stepUntilDone();
View Full Code Here

    aMap.addBidirectionalLink("2,3", "1,3", 1.0);

    MapEnvironment me = new MapEnvironment(aMap);
    OnlineDFSAgent agent = new OnlineDFSAgent(new OnlineSearchProblem(
        MapFunctionFactory.getActionsFunction(aMap),
        new DefaultGoalTest("3,3"), new MapStepCostFunction(aMap)),
        MapFunctionFactory.getPerceptToStateFunction());
    me.addAgent(agent, "1,1");
    me.addEnvironmentView(new TestEnvironmentView());
    me.stepUntilDone();
View Full Code Here

TOP

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

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.