Package aima.core.environment.map

Examples of aima.core.environment.map.MapStepCostFunction


  @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


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