From bf08f38a1e05eeaaca0979876e8c42418101f3b9 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 9 Apr 2023 16:24:43 +0200 Subject: [PATCH] fixed pathfinding namespace --- API/Program.cs | 1 - Pathfinding/Pathfinder.cs | 1 - Pathfinding/Pathfinder_Distance.cs | 9 +++------ Pathfinding/RegionManager.cs | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/API/Program.cs b/API/Program.cs index 902ab0a..09daf67 100644 --- a/API/Program.cs +++ b/API/Program.cs @@ -1,6 +1,5 @@ using System.Text.Json.Serialization; using OSMDatastructure.Graph; -using OSMImporter; using Pathfinding; var builder = WebApplication.CreateBuilder(args); diff --git a/Pathfinding/Pathfinder.cs b/Pathfinding/Pathfinder.cs index d2a0138..8f4b917 100644 --- a/Pathfinding/Pathfinder.cs +++ b/Pathfinding/Pathfinder.cs @@ -1,6 +1,5 @@ using OSMDatastructure; using OSMDatastructure.Graph; -using OSMImporter; namespace Pathfinding; diff --git a/Pathfinding/Pathfinder_Distance.cs b/Pathfinding/Pathfinder_Distance.cs index 462da26..485dfeb 100644 --- a/Pathfinding/Pathfinder_Distance.cs +++ b/Pathfinding/Pathfinder_Distance.cs @@ -1,6 +1,5 @@ using OSMDatastructure; using OSMDatastructure.Graph; -using OSMImporter; namespace Pathfinding; @@ -28,13 +27,11 @@ public static partial class Pathfinder OsmNode? neighbor = regionManager.GetNode(edge.neighborId, edge.neighborRegion); if (neighbor is not null) { - double newPotentialWeight = - closestNodeToGoal.currentPathWeight + Utils.DistanceBetween(closestNodeToGoal, neighbor); - if (newPotentialWeight < neighbor.currentPathWeight) + double newPotentialLength = closestNodeToGoal.currentPathLength + Utils.DistanceBetween(closestNodeToGoal, neighbor); + if (newPotentialLength < neighbor.currentPathLength) { neighbor.previousPathNode = closestNodeToGoal; - neighbor.currentPathWeight = newPotentialWeight; //for other types of routing - neighbor.currentPathLength = newPotentialWeight; + neighbor.currentPathLength = newPotentialLength; neighbor.directDistanceToGoal = Utils.DistanceBetween(neighbor, goalNode); if (neighbor.Equals(goalNode)) diff --git a/Pathfinding/RegionManager.cs b/Pathfinding/RegionManager.cs index e40caf4..fc2ef45 100644 --- a/Pathfinding/RegionManager.cs +++ b/Pathfinding/RegionManager.cs @@ -2,7 +2,7 @@ using System.Text.Json; using OSMDatastructure; using OSMDatastructure.Graph; -namespace OSMImporter +namespace Pathfinding { public class RegionManager {