Search in sources :

Example 6 with Room

use of aima.core.environment.wumpusworld.Room 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));
}
Also used : AgentPercept(aima.core.environment.wumpusworld.AgentPercept) WumpusKnowledgeBase(aima.core.environment.wumpusworld.WumpusKnowledgeBase) Room(aima.core.environment.wumpusworld.Room) Test(org.junit.Test)

Aggregations

Room (aima.core.environment.wumpusworld.Room)6 Test (org.junit.Test)6 AgentPercept (aima.core.environment.wumpusworld.AgentPercept)4 AgentPosition (aima.core.environment.wumpusworld.AgentPosition)4 WumpusKnowledgeBase (aima.core.environment.wumpusworld.WumpusKnowledgeBase)4 Forward (aima.core.environment.wumpusworld.action.Forward)4 HybridWumpusAgent (aima.core.environment.wumpusworld.HybridWumpusAgent)2 TurnLeft (aima.core.environment.wumpusworld.action.TurnLeft)2 LinkedHashSet (java.util.LinkedHashSet)2 Shoot (aima.core.environment.wumpusworld.action.Shoot)1