Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.out.printf("agenttype; threshold; lookahead; gamesize; miliseconds;%n");
- height = 3;
- width = 3;
- lookahead = 5;
- BigInteger totalMovesPossible = GameUtils.TotalMoves(height * width * 2, height * width);
- int stepSize = totalMovesPossible.divide(BigInteger.valueOf(10)).intValue();
- for(int threshold = 0; threshold <= 20000; threshold += 200)
- {
- // Change the threshold for the agent.
- //FJPlayer.setThreshold(threshold);
- MiniMaxAgentFJ<Oxo> player = new MiniMaxAgentFJ<>(lookahead, new SimpleScoreHeuristic(), threshold);
- long before = System.nanoTime();
- double[] scores = PlayFirstMove(height, width, player);
- long after = System.nanoTime();
- long totalTime = after-before;
- // Trick the JVM.
- dummy |= Arrays.hashCode(scores);
- // Print out the resulsts.
- System.out.printf("forkjoin ;%9d; %9d; %8d; %11d; %n", threshold, lookahead, (height * width), (int) Math.ceil(totalTime / 1000000));
- }
- return dummy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement