fixed pathfinding namespace

This commit is contained in:
glax 2023-04-09 16:24:43 +02:00
parent fc5d388ecd
commit bf08f38a1e
4 changed files with 4 additions and 9 deletions

View File

@ -1,6 +1,5 @@
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using OSMDatastructure.Graph; using OSMDatastructure.Graph;
using OSMImporter;
using Pathfinding; using Pathfinding;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

View File

@ -1,6 +1,5 @@
using OSMDatastructure; using OSMDatastructure;
using OSMDatastructure.Graph; using OSMDatastructure.Graph;
using OSMImporter;
namespace Pathfinding; namespace Pathfinding;

View File

@ -1,6 +1,5 @@
using OSMDatastructure; using OSMDatastructure;
using OSMDatastructure.Graph; using OSMDatastructure.Graph;
using OSMImporter;
namespace Pathfinding; namespace Pathfinding;
@ -28,13 +27,11 @@ public static partial class Pathfinder
OsmNode? neighbor = regionManager.GetNode(edge.neighborId, edge.neighborRegion); OsmNode? neighbor = regionManager.GetNode(edge.neighborId, edge.neighborRegion);
if (neighbor is not null) if (neighbor is not null)
{ {
double newPotentialWeight = double newPotentialLength = closestNodeToGoal.currentPathLength + Utils.DistanceBetween(closestNodeToGoal, neighbor);
closestNodeToGoal.currentPathWeight + Utils.DistanceBetween(closestNodeToGoal, neighbor); if (newPotentialLength < neighbor.currentPathLength)
if (newPotentialWeight < neighbor.currentPathWeight)
{ {
neighbor.previousPathNode = closestNodeToGoal; neighbor.previousPathNode = closestNodeToGoal;
neighbor.currentPathWeight = newPotentialWeight; //for other types of routing neighbor.currentPathLength = newPotentialLength;
neighbor.currentPathLength = newPotentialWeight;
neighbor.directDistanceToGoal = Utils.DistanceBetween(neighbor, goalNode); neighbor.directDistanceToGoal = Utils.DistanceBetween(neighbor, goalNode);
if (neighbor.Equals(goalNode)) if (neighbor.Equals(goalNode))

View File

@ -2,7 +2,7 @@ using System.Text.Json;
using OSMDatastructure; using OSMDatastructure;
using OSMDatastructure.Graph; using OSMDatastructure.Graph;
namespace OSMImporter namespace Pathfinding
{ {
public class RegionManager public class RegionManager
{ {