Examples of addAgent()


Examples of aima.core.agent.Environment.addAgent()

    a = new ModelBasedReflexVacuumAgent();
    // a = new ReflexVacuumAgent();
    // a = new SimpleReflexVacuumAgent();
    // a = new TableDrivenVacuumAgent();
   
    env.addAgent(a);
    env.step(16);
    env.notifyViews("Performance=" + env.getPerformanceMeasure(a));
  }
}
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

        return;
      }
      MapEnvironment env = scenario.getEnv();
      String goal = destinations.get(0);
      MapAgent agent = new MapAgent(env.getMap(), env, search, new String[] { goal });
      env.addAgent(agent, scenario.getInitAgentLocation());
    }
  }

  /**
   * Returns always the heuristic value 0.
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

    aMap.addUnidirectionalLink("E", "D", 5.0);

    MapEnvironment me = new MapEnvironment(aMap);
    MapAgent ma = new MapAgent(me.getMap(), me, bidirectionalSearch,
        new String[] { "E" });
    me.addAgent(ma, "A");
    me.addEnvironmentView(new BDSEnvironmentView());
    me.stepUntilDone();

    Assert.assertEquals(
        "CurrentLocation=In(A), Goal=In(E):Action[name==NoOp]:METRIC[pathCost]=0.0:METRIC[maxQueueSize]=2:METRIC[queueSize]=0:METRIC[nodesExpanded]=8:Action[name==NoOp]:",
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

    aMap.addUnidirectionalLink("B", "H", 5.0);

    MapEnvironment me = new MapEnvironment(aMap);
    MapAgent ma = new MapAgent(me.getMap(), me, bidirectionalSearch,
        new String[] { "H" });
    me.addAgent(ma, "A");
    me.addEnvironmentView(new BDSEnvironmentView());
    me.stepUntilDone();

    Assert.assertEquals(
        "CurrentLocation=In(A), Goal=In(H):Action[name==moveTo, location==B]:Action[name==moveTo, location==H]:METRIC[pathCost]=10.0:METRIC[maxQueueSize]=3:METRIC[queueSize]=3:METRIC[nodesExpanded]=8:Action[name==NoOp]:",
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

    aMap.addUnidirectionalLink("E", "A", 5.0);

    MapEnvironment me = new MapEnvironment(aMap);
    MapAgent ma = new MapAgent(me.getMap(), me, bidirectionalSearch,
        new String[] { "F" });
    me.addAgent(ma, "A");
    me.addEnvironmentView(new BDSEnvironmentView());
    me.stepUntilDone();

    Assert.assertEquals(
        "CurrentLocation=In(A), Goal=In(F):Action[name==moveTo, location==B]:Action[name==moveTo, location==C]:Action[name==moveTo, location==D]:Action[name==moveTo, location==E]:Action[name==moveTo, location==F]:METRIC[pathCost]=25.0:METRIC[maxQueueSize]=3:METRIC[queueSize]=3:METRIC[nodesExpanded]=8:Action[name==NoOp]:",
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

    aMap.addBidirectionalLink("D", "F", 5.0);

    MapEnvironment me = new MapEnvironment(aMap);
    MapAgent ma = new MapAgent(me.getMap(), me, bidirectionalSearch,
        new String[] { "F" });
    me.addAgent(ma, "A");
    me.addEnvironmentView(new BDSEnvironmentView());
    me.stepUntilDone();

    Assert.assertEquals(
        "CurrentLocation=In(A), Goal=In(F):Action[name==moveTo, location==B]:Action[name==moveTo, location==C]:Action[name==moveTo, location==D]:Action[name==moveTo, location==F]:METRIC[pathCost]=20.0:METRIC[maxQueueSize]=4:METRIC[queueSize]=3:METRIC[nodesExpanded]=8:Action[name==NoOp]:",
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

    ExtendableMap aMap = new ExtendableMap();

    MapEnvironment me = new MapEnvironment(aMap);
    MapAgent ma = new MapAgent(me.getMap(), me, bidirectionalSearch,
        new String[] { "A" });
    me.addAgent(ma, "A");
    me.addEnvironmentView(new BDSEnvironmentView());
    me.stepUntilDone();

    Assert.assertEquals(
        "CurrentLocation=In(A), Goal=In(A):Action[name==NoOp]:METRIC[pathCost]=0.0:METRIC[maxQueueSize]=2:METRIC[queueSize]=0:METRIC[nodesExpanded]=2:Action[name==NoOp]:",
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

    aMap.addBidirectionalLink("B", "C", 5.0);

    MapEnvironment me = new MapEnvironment(aMap);
    MapAgent ma = new MapAgent(me.getMap(), me, bidirectionalSearch,
        new String[] { "A" });
    me.addAgent(ma, "A");
    me.addEnvironmentView(new BDSEnvironmentView());
    me.stepUntilDone();

    Assert.assertEquals(
        "CurrentLocation=In(A), Goal=In(A):Action[name==NoOp]:METRIC[pathCost]=0.0:METRIC[maxQueueSize]=2:METRIC[queueSize]=2:METRIC[nodesExpanded]=2:Action[name==NoOp]:",
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

    aMap.addBidirectionalLink("A", "B", 5.0);

    MapEnvironment me = new MapEnvironment(aMap);
    MapAgent ma = new MapAgent(me.getMap(), me, bidirectionalSearch,
        new String[] { "B" });
    me.addAgent(ma, "A");
    me.addEnvironmentView(new BDSEnvironmentView());
    me.stepUntilDone();

    Assert.assertEquals(
        "CurrentLocation=In(A), Goal=In(B):Action[name==moveTo, location==B]:METRIC[pathCost]=5.0:METRIC[maxQueueSize]=2:METRIC[queueSize]=2:METRIC[nodesExpanded]=2:Action[name==NoOp]:",
View Full Code Here

Examples of aima.core.environment.map.MapEnvironment.addAgent()

    aMap.addBidirectionalLink("B", "C", 5.0);

    MapEnvironment me = new MapEnvironment(aMap);
    MapAgent ma = new MapAgent(me.getMap(), me, bidirectionalSearch,
        new String[] { "C" });
    me.addAgent(ma, "A");
    me.addEnvironmentView(new BDSEnvironmentView());
    me.stepUntilDone();

    Assert.assertEquals(
        "CurrentLocation=In(A), Goal=In(C):Action[name==moveTo, location==B]:Action[name==moveTo, location==C]:METRIC[pathCost]=10.0:METRIC[maxQueueSize]=2:METRIC[queueSize]=2:METRIC[nodesExpanded]=4:Action[name==NoOp]:",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.