Search in sources :

Example 1 with ModifiedPolicyEvaluation

use of aima.core.probability.mdp.impl.ModifiedPolicyEvaluation in project aima-java by aimacode.

the class PassiveADPAgentTest method setUp.

@Before
public void setUp() {
    cw = CellWorldFactory.createCellWorldForFig17_1();
    cwe = new CellWorldEnvironment(cw.getCellAt(1, 1), cw.getCells(), MDPFactory.createTransitionProbabilityFunctionForFigure17_1(cw), new JavaRandomizer());
    Map<Cell<Double>, CellWorldAction> fixedPolicy = new HashMap<Cell<Double>, CellWorldAction>();
    fixedPolicy.put(cw.getCellAt(1, 1), CellWorldAction.Up);
    fixedPolicy.put(cw.getCellAt(1, 2), CellWorldAction.Up);
    fixedPolicy.put(cw.getCellAt(1, 3), CellWorldAction.Right);
    fixedPolicy.put(cw.getCellAt(2, 1), CellWorldAction.Left);
    fixedPolicy.put(cw.getCellAt(2, 3), CellWorldAction.Right);
    fixedPolicy.put(cw.getCellAt(3, 1), CellWorldAction.Left);
    fixedPolicy.put(cw.getCellAt(3, 2), CellWorldAction.Up);
    fixedPolicy.put(cw.getCellAt(3, 3), CellWorldAction.Right);
    fixedPolicy.put(cw.getCellAt(4, 1), CellWorldAction.Left);
    padpa = new PassiveADPAgent<Cell<Double>, CellWorldAction>(fixedPolicy, cw.getCells(), cw.getCellAt(1, 1), MDPFactory.createActionsFunctionForFigure17_1(cw), new ModifiedPolicyEvaluation<Cell<Double>, CellWorldAction>(10, 1.0));
    cwe.addAgent(padpa);
}
Also used : CellWorldAction(aima.core.environment.cellworld.CellWorldAction) HashMap(java.util.HashMap) JavaRandomizer(aima.core.util.JavaRandomizer) CellWorldEnvironment(aima.core.learning.reinforcement.example.CellWorldEnvironment) Cell(aima.core.environment.cellworld.Cell) ModifiedPolicyEvaluation(aima.core.probability.mdp.impl.ModifiedPolicyEvaluation) Before(org.junit.Before)

Aggregations

Cell (aima.core.environment.cellworld.Cell)1 CellWorldAction (aima.core.environment.cellworld.CellWorldAction)1 CellWorldEnvironment (aima.core.learning.reinforcement.example.CellWorldEnvironment)1 ModifiedPolicyEvaluation (aima.core.probability.mdp.impl.ModifiedPolicyEvaluation)1 JavaRandomizer (aima.core.util.JavaRandomizer)1 HashMap (java.util.HashMap)1 Before (org.junit.Before)1