Package driftingdroids.model

Examples of driftingdroids.model.Board


                            final String data = JOptionPane.showInputDialog(frame,
                                    L10N.getString("msg.CreateBoardFromDump.input.message"),
                                    L10N.getString("msg.CreateBoardFromDump.input.title"),
                                    JOptionPane.PLAIN_MESSAGE);
                            if ((null != data) && (0 != data.length())) {
                                final Board newBoard = Board.createBoardGameDump(data);
                                if (null != newBoard) {
                                    board = newBoard;
                                    if (board.isFreestyleBoard()) {
                                        jtabEditBoard.setSelectedIndex(1);
                                    }
View Full Code Here


   
    private void handleGameID() {
        final String myGameID = this.board.getGameID();
        final String newGameID = this.jcomboGameIDs.getSelectedItem().toString();
        if (!newGameID.equals(myGameID)) {
            final Board newBoard = Board.createBoardGameID(newGameID);
            if (null != newBoard) {
                this.board = newBoard;
                this.refreshJComboPlaceRobot();
                this.refreshJcomboRobots();
                this.refreshJcomboQuadrants();
View Full Code Here

   
   
    @SuppressWarnings("unused")
    private static void runTestKeyDepthMap() throws InterruptedException {
//        final Board board = Board.createBoardRandom(5);
        final Board board = Board.createBoardGameID("0765+42+2E21BD0F+93");
       
        System.err.println("GameID\t#Sol\t#Mov\tmsGnrc\tmsSpcl\tMBgnrc\tMBspcl");
        for(;;) {
            board.setRobotsRandom();
//            board.setGoalRandom();
            final StringBuilder sb = new StringBuilder();
            sb.append(board.getGameID()).append('\t');
           
            KeyDepthMapFactory.setDefaultClass(KeyDepthMapTrieGeneric.class);
            final SolverIDDFS solverGeneric = (SolverIDDFS)Solver.createInstance(board);
            final List<Solution> solutionsGeneric = solverGeneric.execute();
           
View Full Code Here

                            final String data = JOptionPane.showInputDialog(frame,
                                    L10N.getString("msg.CreateBoardFromDump.input.message"),
                                    L10N.getString("msg.CreateBoardFromDump.input.title"),
                                    JOptionPane.PLAIN_MESSAGE);
                            if ((null != data) && (0 != data.length())) {
                                final Board newBoard = Board.createBoardGameDump(data);
                                if (null != newBoard) {
                                    board = newBoard;
                                    if (board.isFreestyleBoard()) {
                                        jtabEditBoard.setSelectedIndex(1);
                                    }
View Full Code Here

   
    private void handleGameID() {
        final String myGameID = this.board.getGameID();
        final String newGameID = this.jcomboGameIDs.getSelectedItem().toString();
        if (!newGameID.equals(myGameID)) {
            final Board newBoard = Board.createBoardGameID(newGameID);
            if (null != newBoard) {
                this.board = newBoard;
                this.refreshJComboPlaceRobot();
                this.refreshJcomboRobots();
                this.refreshJcomboQuadrants();
View Full Code Here

                            final String data = JOptionPane.showInputDialog(frame,
                                    L10N.getString("msg.CreateBoardFromDump.input.message"),
                                    L10N.getString("msg.CreateBoardFromDump.input.title"),
                                    JOptionPane.PLAIN_MESSAGE);
                            if ((null != data) && (0 != data.length())) {
                                final Board newBoard = Board.createBoardGameDump(data);
                                if (null != newBoard) {
                                    board = newBoard;
                                    if (board.isFreestyleBoard()) {
                                        jtabEditBoard.setSelectedIndex(1);
                                    }
View Full Code Here

   
    private void handleGameID() {
        final String myGameID = this.board.getGameID();
        final String newGameID = this.jcomboGameIDs.getSelectedItem().toString();
        if (!newGameID.equals(myGameID)) {
            final Board newBoard = Board.createBoardGameID(newGameID);
            if (null != newBoard) {
                this.board = newBoard;
                this.refreshJComboPlaceRobot();
                this.refreshJcomboRobots();
                this.refreshJlistQuadrants();
View Full Code Here

                            final String data = JOptionPane.showInputDialog(frame,
                                    L10N.getString("msg.CreateBoardFromDump.input.message"),
                                    L10N.getString("msg.CreateBoardFromDump.input.title"),
                                    JOptionPane.PLAIN_MESSAGE);
                            if ((null != data) && (0 != data.length())) {
                                final Board newBoard = Board.createBoardGameDump(data);
                                if (null != newBoard) {
                                    board = newBoard;
                                    if (board.isFreestyleBoard()) {
                                        jtabEditBoard.setSelectedIndex(1);
                                    }
View Full Code Here

   
    private void handleGameID() {
        final String myGameID = this.board.getGameID();
        final String newGameID = this.jcomboGameIDs.getSelectedItem().toString();
        if (!newGameID.equals(myGameID)) {
            final Board newBoard = Board.createBoardGameID(newGameID);
            if (null != newBoard) {
                this.board = newBoard;
                this.refreshJComboPlaceRobot();
                this.refreshJcomboRobots();
                this.refreshJlistQuadrants();
View Full Code Here

    private static void runTestRandom1000() throws InterruptedException {
        final Date startDate = new Date();
       
        final int numGames = 1000;
       
        final Board theBoard = Board.createBoardGameID("0765+42+2E21BD0F+93");
       
        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

TOP

Related Classes of driftingdroids.model.Board

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.