2022-11-01 05:08:52 +01:00
|
|
|
|
using Graph;
|
|
|
|
|
using Logging;
|
|
|
|
|
using astar;
|
|
|
|
|
|
|
|
|
|
Logger logger = new (LogType.CONSOLE, LogLevel.DEBUG);
|
2022-11-13 14:02:27 +01:00
|
|
|
|
Graph.Graph graph = OpenStreetMap_Importer.Importer.Import(@"", true, logger);
|
2022-11-01 05:08:52 +01:00
|
|
|
|
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
|
|
|
|
|
{
|
2022-11-13 14:19:07 +01:00
|
|
|
|
n1 = graph.GetNodeAtIndex(r.Next(0, graph.GetNodeCount() - 1));
|
|
|
|
|
n2 = graph.GetNodeAtIndex(r.Next(0, graph.GetNodeCount() - 1));
|
2022-11-13 14:02:27 +01:00
|
|
|
|
_route = new Astar().FindPath(graph, n1, n2, logger);
|
2022-11-03 19:14:14 +01:00
|
|
|
|
} while (!_route.routeFound);
|
2022-11-01 05:08:52 +01:00
|
|
|
|
} while (Console.ReadKey().Key.Equals(ConsoleKey.Enter));
|