Search in sources :

Example 1 with VacuumEnvironmentViewActionTracker

use of aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker in project aima-java by aimacode.

the class TableDrivenVacuumAgentTest method testDirtyDirty.

@Test
public void testDirtyDirty() {
    VacuumEnvironment tve = new VacuumEnvironment(VacuumEnvironment.LocationState.Dirty, VacuumEnvironment.LocationState.Dirty);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);
    tve.addEnvironmentView(new VacuumEnvironmentViewActionTracker(envChanges));
    tve.stepUntilDone();
    Assert.assertEquals("Action[name==Suck]Action[name==Right]Action[name==Suck]Action[name==NoOp]", envChanges.toString());
}
Also used : VacuumEnvironmentViewActionTracker(aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker) VacuumEnvironment(aima.core.environment.vacuum.VacuumEnvironment) Test(org.junit.Test)

Example 2 with VacuumEnvironmentViewActionTracker

use of aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker in project aima-java by aimacode.

the class ReflexVacuumAgentTest method testCleanDirty.

@Test
public void testCleanDirty() {
    VacuumEnvironment tve = new VacuumEnvironment(VacuumEnvironment.LocationState.Clean, VacuumEnvironment.LocationState.Dirty);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);
    tve.addEnvironmentView(new VacuumEnvironmentViewActionTracker(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]", envChanges.toString());
}
Also used : VacuumEnvironmentViewActionTracker(aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker) VacuumEnvironment(aima.core.environment.vacuum.VacuumEnvironment) Test(org.junit.Test)

Example 3 with VacuumEnvironmentViewActionTracker

use of aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker in project aima-java by aimacode.

the class ReflexVacuumAgentTest method testCleanClean.

@Test
public void testCleanClean() {
    VacuumEnvironment tve = new VacuumEnvironment(VacuumEnvironment.LocationState.Clean, VacuumEnvironment.LocationState.Clean);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);
    tve.addEnvironmentView(new VacuumEnvironmentViewActionTracker(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]", envChanges.toString());
}
Also used : VacuumEnvironmentViewActionTracker(aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker) VacuumEnvironment(aima.core.environment.vacuum.VacuumEnvironment) Test(org.junit.Test)

Example 4 with VacuumEnvironmentViewActionTracker

use of aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker in project aima-java by aimacode.

the class ReflexVacuumAgentTest method testDirtyClean.

@Test
public void testDirtyClean() {
    VacuumEnvironment tve = new VacuumEnvironment(VacuumEnvironment.LocationState.Dirty, VacuumEnvironment.LocationState.Clean);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);
    tve.addEnvironmentView(new VacuumEnvironmentViewActionTracker(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]", envChanges.toString());
}
Also used : VacuumEnvironmentViewActionTracker(aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker) VacuumEnvironment(aima.core.environment.vacuum.VacuumEnvironment) Test(org.junit.Test)

Example 5 with VacuumEnvironmentViewActionTracker

use of aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker in project aima-java by aimacode.

the class ModelBasedReflexVacuumAgentTest method testDirtyClean.

@Test
public void testDirtyClean() {
    VacuumEnvironment tve = new VacuumEnvironment(VacuumEnvironment.LocationState.Dirty, VacuumEnvironment.LocationState.Clean);
    tve.addAgent(agent, VacuumEnvironment.LOCATION_A);
    tve.addEnvironmentView(new VacuumEnvironmentViewActionTracker(envChanges));
    tve.stepUntilDone();
    Assert.assertEquals("Action[name==Suck]Action[name==Right]Action[name==NoOp]", envChanges.toString());
}
Also used : VacuumEnvironmentViewActionTracker(aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker) VacuumEnvironment(aima.core.environment.vacuum.VacuumEnvironment) Test(org.junit.Test)

Aggregations

VacuumEnvironment (aima.core.environment.vacuum.VacuumEnvironment)16 VacuumEnvironmentViewActionTracker (aima.core.environment.vacuum.VacuumEnvironmentViewActionTracker)16 Test (org.junit.Test)16