Package aima.core.environment.vacuum

Examples of aima.core.environment.vacuum.VacuumEnvironment.addEnvironmentView()


public class TrivialVacuumDemo {
  public static void main(String[] args) {
    // create environment with random state of cleaning.
    Environment env = new VacuumEnvironment();
    EnvironmentView view = new SimpleEnvironmentView();
    env.addEnvironmentView(view);
   
    Agent a = null;
    a = new ModelBasedReflexVacuumAgent();
    // a = new ReflexVacuumAgent();
    // a = new SimpleReflexVacuumAgent();
View Full Code Here


    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Clean,
        VacuumEnvironment.LocationState.Clean);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.step(8);

    Assert.assertEquals(
        "Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]",
View Full Code Here

    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Clean,
        VacuumEnvironment.LocationState.Dirty);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.step(8);

    Assert.assertEquals(
        "Action[name==Right]Action[name==Suck]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]",
View Full Code Here

    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Dirty,
        VacuumEnvironment.LocationState.Clean);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.step(8);

    Assert.assertEquals(
        "Action[name==Suck]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]",
View Full Code Here

    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Dirty,
        VacuumEnvironment.LocationState.Dirty);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.step(8);

    Assert.assertEquals(
        "Action[name==Suck]Action[name==Right]Action[name==Suck]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]",
View Full Code Here

    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Clean,
        VacuumEnvironment.LocationState.Clean);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.step(8);

    Assert.assertEquals(
        "Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]",
View Full Code Here

    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Clean,
        VacuumEnvironment.LocationState.Dirty);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.step(8);

    Assert.assertEquals(
        "Action[name==Right]Action[name==Suck]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]",
View Full Code Here

    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Dirty,
        VacuumEnvironment.LocationState.Clean);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.step(8);

    Assert.assertEquals(
        "Action[name==Suck]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]",
View Full Code Here

    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Dirty,
        VacuumEnvironment.LocationState.Dirty);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.step(8);

    Assert.assertEquals(
        "Action[name==Suck]Action[name==Right]Action[name==Suck]Action[name==Left]Action[name==Right]Action[name==Left]Action[name==Right]Action[name==Left]",
View Full Code Here

    VacuumEnvironment tve = new VacuumEnvironment(
        VacuumEnvironment.LocationState.Clean,
        VacuumEnvironment.LocationState.Clean);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);

    tve.addEnvironmentView(new EnvironmentViewActionTracker(envChanges));

    tve.stepUntilDone();

    Assert.assertEquals(
        "Action[name==Right]Action[name==Left]Action[name==Right]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.