use of aima.core.environment.wumpusworld.WumpusKnowledgeBase in project aima-java by aimacode.
the class WumpusKnowledgeBaseTest method testAskNotUnsafeRooms.
@SuppressWarnings("serial")
@Test
public void testAskNotUnsafeRooms() {
WumpusKnowledgeBase KB;
int t = 0;
KB = new WumpusKnowledgeBase(dpll, 2);
step(KB, new AgentPercept(false, false, false, false, false), t);
Assert.assertEquals(new HashSet<Room>() {
{
add(new Room(1, 1));
add(new Room(1, 2));
add(new Room(2, 1));
}
}, KB.askNotUnsafeRooms(t));
KB = new WumpusKnowledgeBase(dpll, 2);
step(KB, new AgentPercept(true, false, false, false, false), t);
Assert.assertEquals(new HashSet<Room>() {
{
add(new Room(1, 1));
add(new Room(1, 2));
add(new Room(2, 1));
add(new Room(2, 2));
}
}, KB.askNotUnsafeRooms(t));
}
use of aima.core.environment.wumpusworld.WumpusKnowledgeBase in project aima-java by aimacode.
the class WumpusKnowledgeBaseTest method testAskGlitter.
@Test
public void testAskGlitter() {
WumpusKnowledgeBase KB = new WumpusKnowledgeBase(dpll, 2);
step(KB, new AgentPercept(false, false, false, false, false), 0);
Assert.assertFalse(KB.askGlitter(0));
step(KB, new AgentPercept(false, false, false, false, false), 1);
Assert.assertFalse(KB.askGlitter(1));
step(KB, new AgentPercept(false, false, true, false, false), 2);
Assert.assertTrue(KB.askGlitter(2));
step(KB, new AgentPercept(false, false, false, false, false), 3);
Assert.assertFalse(KB.askGlitter(3));
}
Aggregations