From 7e8d8e2a74af1030611262318d65d0b5da491b9e Mon Sep 17 00:00:00 2001 From: C9Glax <13404778+C9Glax@users.noreply.github.com> Date: Tue, 1 Nov 2022 05:08:52 +0100 Subject: [PATCH] Different Call --- Executable/Program.cs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Executable/Program.cs b/Executable/Program.cs index 0d61c04..cbc5daa 100644 --- a/Executable/Program.cs +++ b/Executable/Program.cs @@ -1,5 +1,19 @@ -Logging.Logger logger = new (Logging.LogType.CONSOLE, Logging.LogLevel.DEBUG); -Dictionary nodes = OpenStreetMap_Importer.Importer.Import(@"C:\Users\glax\Downloads\oberbayern-latest.osm", logger); -logger.level = Logging.LogLevel.VERBOSE; -astar.Astar astar = new(nodes, logger); -Console.ReadKey(); \ No newline at end of file +using Graph; +using Logging; +using astar; + +Logger logger = new (LogType.CONSOLE, LogLevel.DEBUG); +Dictionary graph = OpenStreetMap_Importer.Importer.Import(@"", true, logger); +logger.level = LogLevel.DEBUG; + +Random r = new(); +List path; +Node n1, n2; +do +{ + do + { + n1 = graph[graph.Keys.ElementAt(r.Next(0, graph.Count - 1))]; + n2 = graph[graph.Keys.ElementAt(r.Next(0, graph.Count - 1))]; + } while (!Astar.FindPath(ref graph, n1, n2, out path, logger)); +} while (Console.ReadKey().Key.Equals(ConsoleKey.Enter)); \ No newline at end of file