Package aima.core.environment.map

Examples of aima.core.environment.map.MapStepCostFunction


    Map romaniaMap = new SimplifiedRoadMapOfPartOfRomania();
    Problem problem = new Problem(SimplifiedRoadMapOfPartOfRomania.SIBIU,
        MapFunctionFactory.getActionsFunction(romaniaMap),
        MapFunctionFactory.getResultFunction(), new DefaultGoalTest(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST),
        new MapStepCostFunction(romaniaMap));

    Search search = new UniformCostSearch();
    SearchAgent agent = new SearchAgent(problem, search);

    List<Action> actions = agent.getActions();
View Full Code Here


    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));

    Search search = new UniformCostSearch();
    SearchAgent agent = new SearchAgent(problem, search);

    List<Action> actions = agent.getActions();
View Full Code Here

    Problem problem = new Problem(SimplifiedRoadMapOfPartOfRomania.ARAD,
        MapFunctionFactory.getActionsFunction(romaniaMap),
        MapFunctionFactory.getResultFunction(), new DualMapGoalTest(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST,
            SimplifiedRoadMapOfPartOfRomania.HIRSOVA),
        new MapStepCostFunction(romaniaMap));

    Search search = new BreadthFirstSearch(new GraphSearch());

    SearchAgent agent = new SearchAgent(problem, search);
    Assert.assertEquals(
View Full Code Here

    aMap.addBidirectionalLink("A", "C", 6.0);
    aMap.addBidirectionalLink("B", "C", 4.0);
    aMap.addBidirectionalLink("C", "D", 7.0);
    aMap.addUnidirectionalLink("B", "E", 14.0);

    mscf = new MapStepCostFunction(aMap);
  }
View Full Code Here

    Map romaniaMap = new SimplifiedRoadMapOfPartOfRomania();
    Problem problem = new Problem(SimplifiedRoadMapOfPartOfRomania.SIBIU,
        MapFunctionFactory.getActionsFunction(romaniaMap),
        MapFunctionFactory.getResultFunction(), new DefaultGoalTest(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST),
        new MapStepCostFunction(romaniaMap));

    Search search = new AStarSearch(new GraphSearch(),
        new StraightLineDistanceHeuristicFunction(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST, romaniaMap));
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

    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 AStarSearch(new TreeSearch(),
        new StraightLineDistanceHeuristicFunction(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST, romaniaMap));
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

    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 AStarSearch(new GraphSearch(),
        new StraightLineDistanceHeuristicFunction(
            SimplifiedRoadMapOfPartOfRomania.BUCHAREST, romaniaMap));
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

    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

TOP

Related Classes of aima.core.environment.map.MapStepCostFunction

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.