Skak:Testsuite
Fra DAMNWiki
start = System.currentTimeMillis(); for (int i = 0; i < 100000; i++) { EvalFunction.eval(datalink.getBoardData()); } stop = System.currentTimeMillis(); System.out.println("Tid for 100.000 evalueringer " + (stop-start)); start = System.currentTimeMillis(); ArrayList<Piece> pieces = datalink.getBoardData().getPiecesOfType(Piece.WPAWN); Board b = datalink.getBoardData(); for (int i = 0; i < 10000; i++) { for (int j = 0 ; j < pieces.size(); j++) EvalFunction.evalPawn(pieces.get(j), b); } stop = System.currentTimeMillis(); System.out.println("Tid for 10.000 pawneval " + (stop-start)); start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { for (Piece p : datalink.getBoardData().getPiecesOfType(Piece.WKNIGHT)) EvalFunction.evalKnight(p, datalink.getBoardData()); } stop = System.currentTimeMillis(); System.out.println("Tid for 10.000 knighteval " + (stop-start)); start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { for (Piece p : datalink.getBoardData().getPiecesOfType(Piece.WBISHOP)) EvalFunction.evalBishop(p, datalink.getBoardData()); } stop = System.currentTimeMillis(); System.out.println("Tid for 10.000 bishopeval " + (stop-start)); start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { for (Piece p : datalink.getBoardData().getPiecesOfType(Piece.WROOK)) EvalFunction.evalRook(p, datalink.getBoardData()); } stop = System.currentTimeMillis(); System.out.println("Tid for 10.000 rookeval " + (stop-start)); start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { for (Piece p : datalink.getBoardData().getPiecesOfType(Piece.WQUEEN)) EvalFunction.evalQueen(p, datalink.getBoardData()); } stop = System.currentTimeMillis(); System.out.println("Tid for 10.000 queeneval " + (stop-start)); start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { for (Piece p : datalink.getBoardData().getPiecesOfType(Piece.WKING)) EvalFunction.evalKing(p, datalink.getBoardData()); } stop = System.currentTimeMillis(); System.out.println("Tid for 10.000 kingeval " + (stop-start));