test_class.declarator: test3
test_class.modifier: private static
test_class.original_string: private static HierarchyMapGraph test3;
test_class.type: HierarchyMapGraph
test_class.var_name: test3
test_class.declarator: test5
test_class.modifier: private static
test_class.original_string: private static HierarchyMapGraph test5;
test_class.type: HierarchyMapGraph
test_class.var_name: test5
test_class.declarator: test8
test_class.modifier: private static
test_class.original_string: private static HierarchyMapGraph test8;
test_class.type: HierarchyMapGraph
test_class.var_name: test8
test_class.declarator: testGraph1
test_class.modifier: private static
test_class.original_string: private static HierarchyMapGraph testGraph1;
test_class.type: HierarchyMapGraph
test_class.var_name: testGraph1
test_class.declarator: testGraph2
test_class.modifier: private static
test_class.original_string: private static HierarchyMapGraph testGraph2;
test_class.type: HierarchyMapGraph
test_class.var_name: testGraph2
test_class.declarator: testGraph3
test_class.modifier: private static
test_class.original_string: private static HierarchyMapGraph testGraph3;
test_class.type: HierarchyMapGraph
test_class.var_name: testGraph3
test_class.declarator: testGraph4
test_class.modifier: private static
test_class.original_string: private static HierarchyMapGraph testGraph4;
test_class.type: HierarchyMapGraph
test_class.var_name: testGraph4
test_class.declarator: fastBackup
test_class.modifier: private static
test_class.original_string: private static boolean fastBackup;
test_class.type: boolean
test_class.var_name: fastBackup
test_class.file: SoftwarePraktikum/src/algorithmen/DijkstraTest.java
test_class.identifier: DijkstraTest
test_case.body: @Test
  	public void testWeight() throws Exception {
  		
  		Config.fastestPathMode = true;
  		
  		//Hier wird ein Graph erstellt, wo die kuerzeste Route nicht der schnellsten entspricht.
  		int gr = 4;
  		MapGraph weightGraph = GitterWeightGraph(gr);
  		
  		Logger.getInstance().log("DijkstraTest","Starte WeightGitter-Test (n="+gr+")");
  
  		ArrayList<MapNode> liste = Dijkstra.bidirectional(weightGraph, 1, gr*gr);
  		Logger.getInstance().log("DijkstraTest","Weglaenge (soll: "+((2*gr)-2)*3+"): "+weglaengeStrict(liste));
  		Logger.getInstance().log("DijkstraTest", "WegGewicht: "+weglaenge(liste));
  		Logger.getInstance().log("DijkstraTest","Pfad: "+Pfad(liste));
  		
  		//Pruefe auf krrekte Weglaenge - nicht dauer!
  		if (weglaenge(liste) == ((2*gr)-2)*2)
  			fail("Der berechnete Weg ist nciht der schnellste, sondern der kuerzeste");
  		
  		if (weglaengeStrict(liste) != ((2*gr)-2)*3)
  			fail("Der berechnete Weg ist nciht der schnellste. Soll:"+((2*gr)-2)*3+" Ist:"+weglaengeStrict(liste));
  		
  		
  	}
test_case.class_method_signature: DijkstraTest.testWeight()
test_case.full_signature: @Test public void testWeight()
test_case.identifier: testWeight
test_case.invocations: GitterWeightGraph log getInstance bidirectional log getInstance weglaengeStrict log getInstance weglaenge log getInstance Pfad weglaenge fail weglaengeStrict fail weglaengeStrict
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWeight()
focal_class.declarator: debug = false
focal_class.modifier: static
focal_class.original_string: static boolean debug = false;
focal_class.type: boolean
focal_class.var_name: debug
focal_class.declarator: logger = Logger.getInstance()
focal_class.modifier: private static
focal_class.original_string: private static Logger logger = Logger.getInstance();
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: SoftwarePraktikum/src/algorithmen/Dijkstra.java
focal_class.identifier: Dijkstra
focal_class.class_method_signature: Dijkstra.updateNeighbours(HashMap<Integer,Vertex> nodes, PrQueue queue, HierarchyMapEdge newEdge, Vertex node, boolean mode)
focal_class.full_signature: private static void updateNeighbours(HashMap<Integer,Vertex> nodes, PrQueue queue, HierarchyMapEdge newEdge, Vertex node, boolean mode)
focal_class.identifier: updateNeighbours
focal_class.modifiers: private static
focal_class.parameters: (HashMap<Integer,Vertex> nodes, PrQueue queue, HierarchyMapEdge newEdge, Vertex node, boolean mode)
focal_class.return: void
focal_class.signature: void updateNeighbours(HashMap<Integer,Vertex> nodes, PrQueue queue, HierarchyMapEdge newEdge, Vertex node, boolean mode)
focal_class.class_method_signature: Dijkstra.neighbourhood(HierarchyMapGraph graph, int startnode, byte level, boolean forward)
focal_class.full_signature: public static long neighbourhood(HierarchyMapGraph graph, int startnode, byte level, boolean forward)
focal_class.identifier: neighbourhood
focal_class.modifiers: public static
focal_class.parameters: (HierarchyMapGraph graph, int startnode, byte level, boolean forward)
focal_class.return: long
focal_class.signature: long neighbourhood(HierarchyMapGraph graph, int startnode, byte level, boolean forward)
focal_class.class_method_signature: Dijkstra.handleQueues(HashMap<Integer,Vertex> nodes1, PrQueue forward, MapGraph graph, 
  									HashMap<Integer,Vertex> nodes2, PrQueue backward, boolean mode)
focal_class.full_signature: private static boolean handleQueues(HashMap<Integer,Vertex> nodes1, PrQueue forward, MapGraph graph, 
  									HashMap<Integer,Vertex> nodes2, PrQueue backward, boolean mode)
focal_class.identifier: handleQueues
focal_class.modifiers: private static
focal_class.parameters: (HashMap<Integer,Vertex> nodes1, PrQueue forward, MapGraph graph, 
  									HashMap<Integer,Vertex> nodes2, PrQueue backward, boolean mode)
focal_class.return: boolean
focal_class.signature: boolean handleQueues(HashMap<Integer,Vertex> nodes1, PrQueue forward, MapGraph graph, 
  									HashMap<Integer,Vertex> nodes2, PrQueue backward, boolean mode)
focal_class.class_method_signature: Dijkstra.bidirectional(MapGraph graph, int startnode, int endnode)
focal_class.full_signature: public static ArrayList<MapNode> bidirectional(MapGraph graph, int startnode, int endnode)
focal_class.identifier: bidirectional
focal_class.modifiers: public static
focal_class.parameters: (MapGraph graph, int startnode, int endnode)
focal_class.return: ArrayList<MapNode>
focal_class.signature: ArrayList<MapNode> bidirectional(MapGraph graph, int startnode, int endnode)
focal_class.class_method_signature: Dijkstra.handleQueues(HashMap<Integer,Vertex> nodes1, PrQueue forward, 
  									    HashMap<Integer,Vertex> nodes2, PrQueue backward, boolean mode)
focal_class.full_signature: private static boolean handleQueues(HashMap<Integer,Vertex> nodes1, PrQueue forward, 
  									    HashMap<Integer,Vertex> nodes2, PrQueue backward, boolean mode)
focal_class.identifier: handleQueues
focal_class.modifiers: private static
focal_class.parameters: (HashMap<Integer,Vertex> nodes1, PrQueue forward, 
  									    HashMap<Integer,Vertex> nodes2, PrQueue backward, boolean mode)
focal_class.return: boolean
focal_class.signature: boolean handleQueues(HashMap<Integer,Vertex> nodes1, PrQueue forward, 
  									    HashMap<Integer,Vertex> nodes2, PrQueue backward, boolean mode)
focal_class.class_method_signature: Dijkstra.bidirectional(HierarchyMapGraph graph, int startnode, int endnode)
focal_class.full_signature: public static Path bidirectional(HierarchyMapGraph graph, int startnode, int endnode)
focal_class.identifier: bidirectional
focal_class.modifiers: public static
focal_class.parameters: (HierarchyMapGraph graph, int startnode, int endnode)
focal_class.return: Path
focal_class.signature: Path bidirectional(HierarchyMapGraph graph, int startnode, int endnode)
focal_method.body: public static ArrayList<MapNode> bidirectional(MapGraph graph, int startnode, int endnode) throws Exception{
  		
  		if (graph == null) throw new EmptyInputException("Leerer Graph uebergeben");
  		//Hier breche ich immer wieder ab, was echt bloed ist und mich nervt das langsam echt!
  		if (graph.getNode(startnode) == null || graph.getNode(endnode) == null || startnode == endnode) return new ArrayList<MapNode>();
  		
  		HashMap<Integer,Vertex> nodes1 = new HashMap<Integer,Vertex>(); // In einzelnen Listen wird gespeichert welcher Knoten.
  		HashMap<Integer,Vertex> nodes2 = new HashMap<Integer,Vertex>(); //von welcher Richtung aus schon besucht worden ist.
  		
  		PrQueue forward = new PrQueue(); //Priority Queue, die alle erreichbaren Knoten enthaelt
  		PrQueue backward = new PrQueue(); //Priority Queue, die alle erreichbaren Knoten enthaelt
  		
  		Vertex start = new Vertex(graph.getNode(startnode),0,0); //Vertex ist die Hilfsklasse, in der zusaetzliche Infos ueber Knoten gespeichert werden.
  		Vertex end = new Vertex(graph.getNode(endnode),0,0); //Vertex ist die Hilfsklasse, in der zusaetzliche Infos ueber Knoten gespeichert werden.
  		
  		nodes1.put(startnode,start); 
  		nodes2.put(endnode,end);
  		
  		forward.insert(start);
  		backward.insert(end);
          
  		while (forward.getSize() != 0 && backward.getSize() != 0){ //Wenn beide Queues leer, Abbruch
  			boolean abort;
  			abort = handleQueues(nodes1,forward,graph,nodes2,backward,true); //Berechne vorwaerts
  			if(abort) break;
  			abort = handleQueues(nodes1,forward,graph,nodes2,backward,false); //Berechne rueckwaerts
  			if(abort) break;
  		}
  		
  		long distance = -1;
  		Vertex meet = null;
  		
  		
  		//Wir suchen den Punkt ueber den der kuerzeste Weg verlueuft
  		for (Vertex currentNode : nodes1.values()){
  			
  			//ueber pruefe ob Node in beiden Listen vorhanden ist
  			
  			int ID = currentNode.node.getUID();
  			if (nodes2.containsKey(ID) == false){
  				continue;  //node noch nicht von anderer Seite ueberprueft => liegt nicht auf kuerzestem Weg
  			}
  			
  			if (distance == -1) {
  				distance = nodes1.get(ID).getDist() + nodes2.get(ID).getDist();
  				meet = nodes1.get(ID);
  				
  
  			}else{
  				long newDist = nodes1.get(ID).getDist() + nodes2.get(ID).getDist();
  				if (distance > newDist){
  					distance = nodes1.get(ID).getDist() + nodes2.get(ID).getDist();
  					meet = nodes1.get(ID);
  				}
  			}
  		}
  		
  		
  		if (meet == null) return new ArrayList<MapNode>();
  		
  		ArrayList<MapNode> route = new ArrayList<MapNode>();
  
  		route.add(graph.getNode(meet.node.getUID() ) );
  		Vertex pos = meet;
  		
  		while (pos.getPredecessor() != 0){ //Ermittle alle Knoten, die vor meet besucht wurden
  			Vertex parent = nodes1.get(pos.getPredecessor());
  			route.add(0, graph.getNode(parent.node.getUID()));
  			pos = parent;
  		}
  		
  		pos = nodes2.get( meet.node.getUID());
  		
  		while (pos.getPredecessor() != 0){ //Ermittle alle Knoten die nach meet besucht wurden 
  			Vertex parent = nodes2.get(pos.getPredecessor());
  			route.add(graph.getNode(parent.node.getUID()));
  			pos = parent;
  		}		
  		
  		if(debug){ 
  			logger.log("Dijkstra.biderectional","Vom Startknoten aus evaluiert: "+nodes1.values().size());
  			logger.log("Dijkstra.biderectional","Vom Zielknoten aus evaluiert: "+nodes2.values().size());
  			logger.log("Dijkstra.biderectional","Knoten auf der Route: "+route.size());
  		}
  		
  		return route; //gib die Liste zurueck
  	}
focal_method.class_method_signature: Dijkstra.bidirectional(MapGraph graph, int startnode, int endnode)
focal_method.full_signature: public static ArrayList<MapNode> bidirectional(MapGraph graph, int startnode, int endnode)
focal_method.identifier: bidirectional
focal_method.invocations: getNode getNode getNode getNode put put insert insert getSize getSize handleQueues handleQueues values getUID containsKey getDist get getDist get get getDist get getDist get getDist get getDist get get add getNode getUID getPredecessor get getPredecessor add getNode getUID get getUID getPredecessor get getPredecessor add getNode getUID log size values log size values log size
focal_method.modifiers: public static
focal_method.parameters: (MapGraph graph, int startnode, int endnode)
focal_method.return: ArrayList<MapNode>
focal_method.signature: ArrayList<MapNode> bidirectional(MapGraph graph, int startnode, int endnode)