Search in sources :

Example 11 with DynamicPercept

use of aima.core.agent.impl.DynamicPercept in project aima-java by aimacode.

the class MapEnvironmentTest method testPerceptSeenBy.

@Test
public void testPerceptSeenBy() {
    me.addAgent(ma, "D");
    DynamicPercept p = (DynamicPercept) me.getPerceptSeenBy(ma);
    Assert.assertEquals(p.getAttribute(DynAttributeNames.PERCEPT_IN), "D");
}
Also used : DynamicPercept(aima.core.agent.impl.DynamicPercept) Test(org.junit.Test)

Example 12 with DynamicPercept

use of aima.core.agent.impl.DynamicPercept in project aima-java by aimacode.

the class MapAgent method updateState.

//
// PROTECTED METHODS
//
@Override
protected void updateState(Percept p) {
    DynamicPercept dp = (DynamicPercept) p;
    state.setAttribute(DynAttributeNames.AGENT_LOCATION, dp.getAttribute(DynAttributeNames.PERCEPT_IN));
}
Also used : DynamicPercept(aima.core.agent.impl.DynamicPercept)

Aggregations

DynamicPercept (aima.core.agent.impl.DynamicPercept)12 Test (org.junit.Test)9 EQUALCondition (aima.core.agent.impl.aprog.simplerule.EQUALCondition)4 Rule (aima.core.agent.impl.aprog.simplerule.Rule)4 Percept (aima.core.agent.Percept)3 ArrayList (java.util.ArrayList)3 Action (aima.core.agent.Action)1 DynamicAction (aima.core.agent.impl.DynamicAction)1 NoOpAction (aima.core.agent.impl.NoOpAction)1 TableDrivenAgentProgram (aima.core.agent.impl.aprog.TableDrivenAgentProgram)1 ANDCondition (aima.core.agent.impl.aprog.simplerule.ANDCondition)1 NOTCondition (aima.core.agent.impl.aprog.simplerule.NOTCondition)1 ORCondition (aima.core.agent.impl.aprog.simplerule.ORCondition)1 MockAgent (aima.test.core.unit.agent.impl.MockAgent)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Before (org.junit.Before)1