AStar/Executable/Program.cs
2022-11-03 19:14:14 +01:00

20 lines
577 B
C#

using Graph;
using Logging;
using astar;
Logger logger = new (LogType.CONSOLE, LogLevel.DEBUG);
Dictionary<ulong, Node> graph = OpenStreetMap_Importer.Importer.Import(@"", true, logger);
logger.level = LogLevel.DEBUG;
Random r = new();
Route _route;
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))];
_route = Astar.FindPath(ref graph, n1, n2, logger);
} while (!_route.routeFound);
} while (Console.ReadKey().Key.Equals(ConsoleKey.Enter));