File tree Expand file tree Collapse file tree 3 files changed +81
-2
lines changed
src/de/adrianwilke/acotspjava Expand file tree Collapse file tree 3 files changed +81
-2
lines changed Original file line number Diff line number Diff line change @@ -541,7 +541,9 @@ public static void main(String[] args) {
541
541
* (SIDE)EFFECTS: none
542
542
* COMMENTS: this function controls the run of "max_tries" independent trials
543
543
*/
544
-
544
+ for (String argument : args ){
545
+ System .out .println (argument );
546
+ }
545
547
Timer .start_timers ();
546
548
547
549
InOut .init_program (args );
Original file line number Diff line number Diff line change @@ -76,7 +76,10 @@ public OptComparator() {
76
76
77
77
@ Override
78
78
public int compare (Option o1 , Option o2 ) {
79
- return (opt .get (o1 .getOpt ()) - opt .get (o2 .getOpt ()));
79
+ if (o1 .getValue () == null || o2 .getValue () == null )
80
+ return 0 ;
81
+ else
82
+ return (opt .get (o1 .getOpt ()) - opt .get (o2 .getOpt ()));
80
83
}
81
84
}
82
85
Original file line number Diff line number Diff line change
1
+ package de .adrianwilke .acotspjava .test ;
2
+
3
+ import java .util .LinkedList ;
4
+ import java .util .List ;
5
+
6
+ import de .adrianwilke .acotspjava .AcoTsp ;
7
+
8
+ public class Test {
9
+
10
+ private static final String TEST_FILE = "tsp/d1291.tsp" ;
11
+
12
+ private static List <String > argList = new LinkedList <String >();
13
+
14
+ public static void main (String [] args ) {
15
+
16
+ // System.out.println(new File("").getAbsolutePath());
17
+
18
+ // argList.add("-h");
19
+
20
+ putTestParameters ();
21
+ argList .add ("-l" );
22
+ argList .add ("0" );
23
+
24
+ // ./AcoTsp --ants 20 --time 2 --tours 2 --tries 2 -i ../../d1291.tsp -l 0 --as
25
+
26
+ // Comments: ACOTSP, ACOTSPJava
27
+
28
+ argList .add ("--as" );
29
+ // -l 0: 62571,67053
30
+ // -l 1: 52842,53925
31
+ // -l 2: 52547,53464
32
+ // -l 3: 51759,52609
33
+
34
+ // argList.add("--eas");
35
+ // -l 0: 84079,90539
36
+ // -l 3: 51524,52335
37
+
38
+ // argList.add("--ras");
39
+ // -l 0: 68201,78482
40
+ // -l 3: 51401,51890
41
+
42
+ // argList.add("--mmas");
43
+ // -l 0: 97732,98702
44
+ // -l 3: 52179,52698
45
+
46
+ // argList.add("--bwas");
47
+ // -l 0:92378,94083
48
+ // -l 3:51076,52068
49
+
50
+ // argList.add("--acs");
51
+ // -l 0:61881,63012
52
+ // -l 3:50962,51401
53
+
54
+ AcoTsp .main (argList .toArray (new String [0 ]));
55
+ }
56
+
57
+ private static void putTestParameters () {
58
+ argList .add ("--ants" );
59
+ argList .add ("20" );
60
+
61
+ argList .add ("--time" );
62
+ argList .add ("2" );
63
+
64
+ argList .add ("--tours" );
65
+ argList .add ("2" );
66
+
67
+ argList .add ("--tries" );
68
+ argList .add ("2" );
69
+
70
+ argList .add ("-i" );
71
+ argList .add (TEST_FILE );
72
+ }
73
+
74
+ }
You can’t perform that action at this time.
0 commit comments