Advertisement
m1dnight

Untitled

Jun 3rd, 2014
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1.         System.out.printf("agenttype; threshold; lookahead; gamesize; miliseconds;%n");
  2.  
  3.         height     = 3;
  4.         width      = 3;
  5.         lookahead  = 5;
  6.  
  7.         BigInteger totalMovesPossible = GameUtils.TotalMoves(height * width * 2, height * width);
  8.         int stepSize = totalMovesPossible.divide(BigInteger.valueOf(10)).intValue();
  9.  
  10.         for(int threshold = 0; threshold <= 20000; threshold += 200)
  11.         {
  12.             // Change the threshold for the agent.
  13.             //FJPlayer.setThreshold(threshold);
  14.             MiniMaxAgentFJ<Oxo> player = new MiniMaxAgentFJ<>(lookahead, new SimpleScoreHeuristic(), threshold);
  15.  
  16.             long before     = System.nanoTime();
  17.             double[] scores = PlayFirstMove(height, width, player);
  18.             long after      = System.nanoTime();
  19.             long totalTime  = after-before;
  20.  
  21.             // Trick the JVM.
  22.             dummy |= Arrays.hashCode(scores);
  23.             // Print out the resulsts.
  24.             System.out.printf("forkjoin ;%9d; %9d; %8d; %11d; %n", threshold, lookahead, (height * width), (int) Math.ceil(totalTime  / 1000000));
  25.         }
  26.         return dummy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement