Test release added

This commit is contained in:
AngeHerman 2024-04-29 18:10:38 +02:00
parent db471f41d1
commit 29e95072f3
2 changed files with 31 additions and 0 deletions

View file

@ -7,6 +7,7 @@ import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.List;
import java.util.Properties;
import javax.imageio.ImageIO;
@ -15,6 +16,11 @@ import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
import fr.u_paris.gla.project.itinerary.Finder;
import fr.u_paris.gla.project.itinerary.Parse;
import fr.u_paris.gla.project.itinerary.Path;
import fr.u_paris.gla.project.itinerary.Stop;
/** Simple application model.
*
* @author Emmanuel Bigeon */
@ -60,9 +66,31 @@ public class App {
showLogo();
}
}
}else{
testRelease();
}
}
public static void testRelease(){
Parse parse = new Parse();
parse.parseFiles();
Stop source = parse.getTmp().get("Porte d'Ivry").get(0);
Stop destination = parse.getTmp().get("Châtelet").get(0);
System.out.println("Itinéraire de Porte d'Ivry à Châtelet");
List<Path> result = parse.getItinerary(source, destination, 43200);
for(Path element : result){
System.out.println(element.getCurrentStop());
}
System.out.println("°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°");
System.out.println("Itinéraire de Porte d'Ivry à Châtelet");
source = parse.getTmp().get("Saint-Jacques").get(0);
destination = parse.getTmp().get("Porte d'Ivry").get(0);
result = parse.getItinerary(source, destination, 43200);
for(Path element : result){
System.out.println(element.getCurrentStop());
}
}
/** @param out the output stream */
public static void printAppInfos(PrintStream out) {
Properties props = readApplicationProperties();

View file

@ -59,6 +59,9 @@ public class Parse {
return new double[] {Double.parseDouble(stringCoords[0]), Double.parseDouble(stringCoords[1])};
}
public HashMap<String, ArrayList<Stop>> getTmp(){
return tmp;
}
/**
* Searchs for a stop with the same name and GPS coordinates in the graph, and creates it if non existant
* @param nodes a graph of the stops