Search in sources :

Example 1 with QLearningAgent

use of aima.core.learning.reinforcement.agent.QLearningAgent in project aima-java by aimacode.

the class LearningDemo method qLearningAgentDemo.

public static void qLearningAgentDemo() {
    System.out.println("======================");
    System.out.println("DEMO: Q-Learning-Agent");
    System.out.println("======================");
    CellWorld<Double> cw = CellWorldFactory.createCellWorldForFig17_1();
    CellWorldEnvironment cwe = new CellWorldEnvironment(cw.getCellAt(1, 1), cw.getCells(), MDPFactory.createTransitionProbabilityFunctionForFigure17_1(cw), new JavaRandomizer());
    QLearningAgent<Cell<Double>, CellWorldAction> qla = new QLearningAgent<Cell<Double>, CellWorldAction>(MDPFactory.createActionsFunctionForFigure17_1(cw), CellWorldAction.None, 0.2, 1.0, 5, 2.0);
    cwe.addAgent(qla);
    output_utility_learning_rates(qla, 20, 10000, 500, 20);
    System.out.println("=========================");
}
Also used : CellWorldAction(aima.core.environment.cellworld.CellWorldAction) JavaRandomizer(aima.core.util.JavaRandomizer) CellWorldEnvironment(aima.core.learning.reinforcement.example.CellWorldEnvironment) QLearningAgent(aima.core.learning.reinforcement.agent.QLearningAgent) Cell(aima.core.environment.cellworld.Cell)

Aggregations

Cell (aima.core.environment.cellworld.Cell)1 CellWorldAction (aima.core.environment.cellworld.CellWorldAction)1 QLearningAgent (aima.core.learning.reinforcement.agent.QLearningAgent)1 CellWorldEnvironment (aima.core.learning.reinforcement.example.CellWorldEnvironment)1 JavaRandomizer (aima.core.util.JavaRandomizer)1