-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.java
49 lines (38 loc) · 1.49 KB
/
main.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
43
44
45
46
47
48
49
import runGA.RunGA;
public class main {
public static final int NUMRUNS = 30;
public static final int GENSIZE = 20;
public static final int TIMELIMIT = 20;
public static final String GOAL = "hi";
public static final double STARTMUTATION = 0.65;
public static final double ENDMUTATION = 0.95;
public static final double STARTCROSSOVER = 0.65;
public static final double ENDCROSSOVER = 0.95;
public static final double INCRATE = 0.1;
public static final double STARTLENGTH = 60;
public static final double ENDLENGTH = 100;
public static final double INCLENGTH = 10;
public static void main(String[] args) {
for(double m = STARTMUTATION; m <= ENDMUTATION; m += INCRATE) {
ArrayList<finalOut> results = new ArrayList<finalOut>();
for (int n = 0; n < NUMRUNS; n ++) {
runGA g = new runGA (GENSIZE, ENDCROSSOVER, m, TIMELIMIT, STARTLENGTH, GOAL);
results.add(g.run());
}
}
for(double c = STARTCROSSOVER; c <= ENDCROSSOVER; c += INCRATE) {
ArrayList<finalOut> results = new ArrayList<finalOut>();
for (int n = 0; n < NUMRUNS; n ++) {
runGA g = new runGA (GENSIZE, c, ENDMUTATION, TIMELIMIT, STARTLENGTH, GOAL);
results.add(g.run());
}
}
for(double r = STARTCROSSOVER; r <= ENDCROSSOVER; r += INCRATE) {
ArrayList<finalOut> results = new ArrayList<finalOut>();
for (int n = 0; n < NUMRUNS; n ++) {
runGA g = new runGA (GENSIZE, r, r, TIMELIMIT, STARTLENGTH, GOAL);
results.add(g.run());
}
}
}
}