AStar/Executable/Program.cs

20 lines
577 B
C#
Raw Normal View History

2022-11-01 05:08:52 +01:00
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();
2022-11-03 19:14:14 +01:00
Route _route;
2022-11-01 05:08:52 +01:00
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))];
2022-11-03 19:14:14 +01:00
_route = Astar.FindPath(ref graph, n1, n2, logger);
} while (!_route.routeFound);
2022-11-01 05:08:52 +01:00
} while (Console.ReadKey().Key.Equals(ConsoleKey.Enter));