From 2c5ab070a2895449b7e0d0e94b58d3c733b8bcb4 Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 1 Apr 2023 18:10:26 +0200 Subject: [PATCH] working --- Server/Server.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Server/Server.cs b/Server/Server.cs index 9453498..d2630e6 100644 --- a/Server/Server.cs +++ b/Server/Server.cs @@ -18,19 +18,15 @@ public class Server Console.WriteLine("Loaded"); - Coordinates start = new Coordinates(48.7933989f, 9.8301467f); - Coordinates finish = new Coordinates(48.7906258f, 9.8355983f); - OsmNode[] path = Pathfinder.CustomAStar("D:/map", start, finish, Tag.SpeedType.pedestrian).ToArray(); - Console.WriteLine("{0}\n", path[0].ToString()); + Coordinates start = new Coordinates(48.793319f, 9.832102f); + Coordinates finish = new Coordinates(48.840728f, 10.067603f); + DateTime startTime = DateTime.Now; + OsmNode[] path = Pathfinder.CustomAStar("D:/stuttgart-regbez-latest", start, finish, Tag.SpeedType.car).ToArray(); + TimeSpan duration = DateTime.Now - startTime; + Console.WriteLine($"Took {duration.TotalMilliseconds}ms ({duration:g})"); for (int i = 0; i < path.Length - 1; i++) { - OsmNode n1 = path[i]; - OsmNode n2 = path[i + 1]; - OsmEdge? e = n1.GetEdgeToNode(n2); - if(e != null) - Console.WriteLine("{0}\n{1}", e.ToString(), n2.ToString()); - else - Console.WriteLine("NO EDGE\n{0}", n2.ToString()); + Console.WriteLine(path[i]); } Console.WriteLine(); }