private static void PrintInfo(IEnumerable <Vertex> shortestpath) { var main = new MainCtr(); AirportCtr airportCtr = main.AirportCtr; double time = 0; double price = 0; Console.WriteLine("Travel route:"); foreach (var v in shortestpath) { Console.WriteLine(v.EdgeToUse.VertexEdge.flightID + " from: " + airportCtr.GetAirportByID(v.EdgeToUse.VertexEdge.@from).name + " to: " + airportCtr.GetAirportByID(v.EdgeToUse.VertexEdge.to).name + " Price: " + v.EdgeToUse.VertexEdge.price + "kr. Traveltime: " + v.EdgeToUse.VertexEdge.traveltime); time += (double)v.EdgeToUse.VertexEdge.traveltime; price += (double)v.EdgeToUse.VertexEdge.price; } Console.WriteLine("Totals - Price: {0}, Traveltime: {1}", price, time); }
public Airport GetAirportByID(int id) { return(AirportCtr.GetAirportByID(id)); }