-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.java
42 lines (37 loc) · 1.11 KB
/
Test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import java.util.Scanner;
public class Test {
public static int play(double[] w) {
CustomState s = new CustomState();
//s.setSeed(29);
int step = 0;
while (!s.hasLost()) {
s.makeMove(StateHelperLA.bestMove(s, w));
step++;
if (step % 100000 == 0) System.out.print(s.getRowsCleared() + " ");
}
System.out.println();
return s.getRowsCleared();
}
public static void main(String[] args) {
int noFactor = Search.noFactor;
double[] w = new double[noFactor];
Scanner sc = new Scanner(System.in);
for (int i = 0; i < noFactor; i++) w[i] = sc.nextDouble();
int Min = 100000000;
int Max = 0;
int sum = 0;
int sampleSize = 10;
for (int i = 0; i < sampleSize; i++) {
int cur = play(w);
System.out.println("turn " + (i + 1) + ": " + cur);
sum += cur;
Min = Math.min(cur, Min);
Max = Math.max(cur, Max);
}
System.out.println("-----------------------------------------------");
System.out.println("mean = " + sum / sampleSize);
System.out.println("min = " + Min);
System.out.println("max = " + Max);
System.out.println("-----------------------------------------------");
}
}