2 import junit
.framework
.*;
4 public class MySearcherLatexTest
extends TestCase
{
5 String
[] from
= {"Tegsbron" , "Flygplatsen" , "MIT" , "Nydala" , "Teg"};
6 String
[] to
= {"Nydala" , "Begbilar" , "Flygplatsen" , "Gamlia" , "Foa"};
8 public MySearcherLatexTest(String name
) {
12 public void testBreadthFirst() {
13 for (int i
= 0; i
< from
.length
; i
++) {
14 MySearcher my
= new MySearcher();
15 my
.setMap(new File("maps/umea_map.xml"));
16 System
.out
.println("\\subsection{Test Bredden-först}");
17 System
.out
.println("\\subsubsection{From: " + from
[i
] + " to " + to
[i
] + "}");
18 System
.out
.println(my
.breadthFirst(from
[i
], to
[i
]));
22 public void testDepthFirst() {
23 for (int i
= 0; i
< from
.length
; i
++) {
24 MySearcher my
= new MySearcher();
25 my
.setMap(new File("maps/umea_map.xml"));
26 System
.out
.println("\\subsection{Test Djupet-först}");
27 System
.out
.println("\\subsubsection{From: " + from
[i
] + " to " + to
[i
] + "}");
28 System
.out
.println(my
.depthFirst(from
[i
], to
[i
]));
32 public void testAStar() {
33 for (int i
= 0; i
< from
.length
; i
++) {
34 MySearcher my
= new MySearcher();
35 my
.setMap(new File("maps/umea_map.xml"));
36 System
.out
.println("\\subsection{Test A*}");
37 System
.out
.println("\\subsubsection{From: " + from
[i
] + " to " + to
[i
] + "}");
38 System
.out
.println(my
.aStar(from
[i
], to
[i
], true));
42 public void testGreedy() {
43 for (int i
= 0; i
< from
.length
; i
++) {
44 MySearcher my
= new MySearcher();
45 my
.setMap(new File("maps/umea_map.xml"));
46 System
.out
.println("\\subsection{Test Girig sökning}");
47 System
.out
.println("\\subsubsection{From: " + from
[i
] + " to " + to
[i
] + "}");
48 System
.out
.println(my
.greedySearch(from
[i
], to
[i
]));