Package driftingdroids.model

Examples of driftingdroids.model.Solver


        int maxMoves = -1;
        String maxSolution = "";
        for (int i = 1; i <= numGames; ++i) {
           
            theBoard.setRobotsRandom();
            final Solver theSolver = Solver.createInstance(theBoard);
            final Solution theSolution = theSolver.execute().get(0);
            final int moves = theSolution.size();
           
            //System.err.println(i + " usedMem=" + (getBytesUsed() >> 20) + " MiB  " + theSolver.getKnownStatesNumber());
           
            if ((0 == i % 100) || (moves > maxMoves)) {
                String msg = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
                msg += "  gamesSolved=" + i + "/" + numGames + "  maxMoves=" + (moves > maxMoves ? moves : maxMoves);
                System.out.println(msg);
            }
            if (moves > maxMoves) {
                maxMoves = moves;
                maxSolution = theBoard.toString() + "\n" + theSolver.toString() + '\n';
                System.out.println(maxSolution);
            } else {
                System.out.println("\n***** run #" + i + "  -  current maxMoves still is " + maxMoves + " *****\n");
            }
        }
View Full Code Here


        int maxMoves = -1;
        String maxSolution = "";
        for (int i = 1; i <= numGames; ++i) {
           
            theBoard.setRobotsRandom();
            final Solver theSolver = Solver.createInstance(theBoard);
            final Solution theSolution = theSolver.execute().get(0);
            final int moves = theSolution.size();
           
            //System.err.println(i + " usedMem=" + (getBytesUsed() >> 20) + " MiB  " + theSolver.getKnownStatesNumber());
           
            if ((0 == i % 100) || (moves > maxMoves)) {
                String msg = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
                msg += "  gamesSolved=" + i + "/" + numGames + "  maxMoves=" + (moves > maxMoves ? moves : maxMoves);
                System.out.println(msg);
            }
            if (moves > maxMoves) {
                maxMoves = moves;
                maxSolution = theBoard.toString() + "\n" + theSolver.toString() + '\n';
                System.out.println(maxSolution);
            } else {
                System.out.println("\n***** run #" + i + "  -  current maxMoves still is " + maxMoves + " *****\n");
            }
        }
View Full Code Here

        int maxMoves = -1;
        String maxSolution = "";
        for (int i = 1; i <= numGames; ++i) {
           
            theBoard.setRobotsRandom();
            final Solver theSolver = Solver.createInstance(theBoard);
            final Solution theSolution = theSolver.execute().get(0);
            final int moves = theSolution.size();
           
            //System.err.println(i + " usedMem=" + (getBytesUsed() >> 20) + " MiB  " + theSolver.getKnownStatesNumber());
           
            if ((0 == i % 100) || (moves > maxMoves)) {
                String msg = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
                msg += "  gamesSolved=" + i + "/" + numGames + "  maxMoves=" + (moves > maxMoves ? moves : maxMoves);
                System.out.println(msg);
            }
            if (moves > maxMoves) {
                maxMoves = moves;
                maxSolution = theBoard.toString() + "\n" + theSolver.toString() + '\n';
                System.out.println(maxSolution);
            } else {
                System.out.println("\n***** run #" + i + "  -  current maxMoves still is " + maxMoves + " *****\n");
            }
        }
View Full Code Here

    }
   
    private class SolverTask extends SwingWorker<Solver, Object> {
        @Override
        protected Solver doInBackground() throws Exception {
            final Solver solver = Solver.createInstance(Board.createClone(board));
            solver.setOptionSolutionMode((Solver.SOLUTION_MODE)jcomboOptSolutionMode.getSelectedItem());
            solver.setOptionAllowRebounds(jcheckOptAllowRebounds.isSelected());
            jtextSolution.setText(null);
            appendSolutionText(getSolverOptionsString(solver), null);
            appendSolutionTextCurrentGoal();
            appendSolutionText(L10N.getString("txt.ComputingSolutions.text") + "\n\n", null);
            solver.execute();
            return solver;
        }
View Full Code Here

    }
   
    private class SolverTask extends SwingWorker<Solver, Object> {
        @Override
        protected Solver doInBackground() throws Exception {
            final Solver solver = Solver.createInstance(Board.createClone(board));
            solver.setOptionSolutionMode((Solver.SOLUTION_MODE)jcomboOptSolutionMode.getSelectedItem());
            solver.setOptionAllowRebounds(jcheckOptAllowRebounds.isSelected());
            jtextSolution.setText(null);
            appendSolutionText(getSolverOptionsString(solver), null);
            appendSolutionTextCurrentGoal();
            appendSolutionText(L10N.getString("txt.ComputingSolutions.text") + "\n\n", null);
            solver.execute();
            return solver;
        }
View Full Code Here

    }
   
    private class SolverTask extends SwingWorker<Solver, Object> {
        @Override
        protected Solver doInBackground() throws Exception {
            final Solver solver = Solver.createInstance(board);
            solver.setOptionSolutionMode((Solver.SOLUTION_MODE)jcomboOptSolutionMode.getSelectedItem());
            solver.setOptionAllowRebounds(jcheckOptAllowRebounds.isSelected());
            jtextSolution.setText(null);
            appendSolutionText(getSolverOptionsString(solver), null);
            appendSolutionTextCurrentGoal();
            appendSolutionText(L10N.getString("txt.ComputingSolutions.text") + "\n\n", null);
            solver.execute();
            return solver;
        }
View Full Code Here

        int maxMoves = -1;
        String maxSolution = "";
        for (int i = 1; i <= numGames; ++i) {
           
            theBoard.setRobotsRandom();
            final Solver theSolver = Solver.createInstance(theBoard);
            final Solution theSolution = theSolver.execute().get(0);
            final int moves = theSolution.size();
           
            //System.err.println(i + " usedMem=" + (getBytesUsed() >> 20) + " MiB  " + theSolver.getKnownStatesNumber());
           
            if ((0 == i % 100) || (moves > maxMoves)) {
                String msg = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
                msg += "  gamesSolved=" + i + "/" + numGames + "  maxMoves=" + (moves > maxMoves ? moves : maxMoves);
                System.out.println(msg);
            }
            if (moves > maxMoves) {
                maxMoves = moves;
                maxSolution = theBoard.toString() + "\n" + theSolver.toString() + '\n';
                System.out.println(maxSolution);
            } else {
                System.out.println("\n***** run #" + i + "  -  current maxMoves still is " + maxMoves + " *****\n");
            }
        }
View Full Code Here

        int maxMoves = -1;
        String maxSolution = "";
        for (int i = 1; i <= numGames; ++i) {
           
            theBoard.setRobotsRandom();
            final Solver theSolver = Solver.createInstance(theBoard);
            final Solution theSolution = theSolver.execute().get(0);
            final int moves = theSolution.size();
           
            //System.err.println(i + " usedMem=" + (getBytesUsed() >> 20) + " MiB  " + theSolver.getKnownStatesNumber());
           
            if ((0 == i % 100) || (moves > maxMoves)) {
                String msg = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
                msg += "  gamesSolved=" + i + "/" + numGames + "  maxMoves=" + (moves > maxMoves ? moves : maxMoves);
                System.out.println(msg);
            }
            if (moves > maxMoves) {
                maxMoves = moves;
                maxSolution = theBoard.toString() + "\n" + theSolver.toString() + '\n';
                System.out.println(maxSolution);
            } else {
                System.out.println("\n***** run #" + i + "  -  current maxMoves still is " + maxMoves + " *****\n");
            }
        }
View Full Code Here

        int maxMoves = -1;
        String maxSolution = "";
        for (int i = 1; i <= numGames; ++i) {
           
            theBoard.setRobotsRandom();
            final Solver theSolver = Solver.createInstance(theBoard);
            final Solution theSolution = theSolver.execute().get(0);
            final int moves = theSolution.size();
           
            //System.err.println(i + " usedMem=" + (getBytesUsed() >> 20) + " MiB  " + theSolver.getKnownStatesNumber());
           
            if ((0 == i % 100) || (moves > maxMoves)) {
                String msg = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
                msg += "  gamesSolved=" + i + "/" + numGames + "  maxMoves=" + (moves > maxMoves ? moves : maxMoves);
                System.out.println(msg);
            }
            if (moves > maxMoves) {
                maxMoves = moves;
                maxSolution = theBoard.toString() + "\n" + theSolver.toString() + '\n';
                System.out.println(maxSolution);
            } else {
                System.out.println("\n***** run #" + i + "  -  current maxMoves still is " + maxMoves + " *****\n");
            }
        }
View Full Code Here

    }
   
    private class SolverTask extends SwingWorker<Solver, Object> {
        @Override
        protected Solver doInBackground() throws Exception {
            final Solver solver = Solver.createInstance(board);
            solver.setOptionSolutionMode((Solver.SOLUTION_MODE)jcomboOptSolutionMode.getSelectedItem());
            solver.setOptionAllowRebounds(jcheckOptAllowRebounds.isSelected());
            jtextSolution.setText(null);
            appendSolutionText(getSolverOptionsString(solver), null);
            appendSolutionTextCurrentGoal();
            appendSolutionText(L10N.getString("txt.ComputingSolutions.text") + "\n\n", null);
            solver.execute();
            return solver;
        }
View Full Code Here

TOP

Related Classes of driftingdroids.model.Solver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.