src/demo/Maze.java
public void playAgent() throws MatrixException, NeuralNetworkException, DynamicParamException, AgentException {
        while (true) {
            agent.newStep();
            agent.act();

            mazePanel.updateAgentHistory(mazeAgentHistory);
            jFrame.revalidate();
            mazePanel.paintImmediately(0, 0, size * 10, size * 10 + 40);

            if (resetRequested) {
                initMaze();
                resetRequested = false;
            }

            if (rebuildRequested) {
                newMaze();
                createMaze();
                initMaze();
                rebuildRequested = false;
            }

            if (mazeAgentCurrent.x == 0 || mazeAgentCurrent.y == 0 || mazeAgentCurrent.x == size - 1 || mazeAgentCurrent.y == size - 1) initMaze();
        }
    }
/**
     * Plays maze game until user quits game (closes window).
     *
     * @throws NeuralNetworkException throws exception if neural network operation fails.
     * @throws MatrixException throws exception if matrix operation fails.
     * @throws DynamicParamException throws exception if parameter (params) setting fails.
     * @throws AgentException throws exception if update of estimator fails.
     */
Plays maze game until user quits game (closes window).
@throws NeuralNetworkException throws exception if neural network operation fails.
@throws MatrixException throws exception if matrix operation fails.
@throws DynamicParamException throws exception if parameter (params) setting fails.
@throws AgentException throws exception if update of estimator fails.
Plays maze game until user quits game ( closes window ) . @throws NeuralNetworkException throws exception if neural network operation fails . @throws MatrixException throws exception if matrix operation fails . @throws DynamicParamException throws exception if parameter ( params ) setting fails . @throws AgentException throws exception if update of estimator fails .
public void playAgent() throws MatrixException, NeuralNetworkException, DynamicParamException, AgentException {
        while (true) {
            agent.newStep();
            agent.act();
            mazePanel.updateAgentHistory(mazeAgentHistory);
            jFrame.revalidate();
            mazePanel.paintImmediately(0, 0, size * 10, size * 10 + 40);
            if (resetRequested) {
                initMaze();
                resetRequested = false;
            }
            if (rebuildRequested) {
                newMaze();
                createMaze();
                initMaze();
                rebuildRequested = false;
            }
            if (mazeAgentCurrent.x == 0 || mazeAgentCurrent.y == 0 || mazeAgentCurrent.x == size - 1 || mazeAgentCurrent.y == size - 1) initMaze();
        }
    }
public void playAgent ( ) throws MatrixException , NeuralNetworkException , DynamicParamException , AgentException { while ( true ) { agent . newStep ( ) ; agent . act ( ) ; mazePanel . updateAgentHistory ( mazeAgentHistory ) ; jFrame . revalidate ( ) ; mazePanel . paintImmediately ( 0 , 0 , size * 10 , size * 10 + 40 ) ; if ( resetRequested ) { initMaze ( ) ; resetRequested = false ; } if ( rebuildRequested ) { newMaze ( ) ; createMaze ( ) ; initMaze ( ) ; rebuildRequested = false ; } if ( mazeAgentCurrent . x == 0 || mazeAgentCurrent . y == 0 || mazeAgentCurrent . x == size - 1 || mazeAgentCurrent . y == size - 1 ) initMaze ( ) ; } }
Plays maze game until user quits game (closes window).
Plays maze game until user quits game ( closes window ) .