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 OSMDatastructure.Graph;
using OSMImporter;
using Pathfinding;
var builder = WebApplication.CreateBuilder(args);

View File

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

View File

@ -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))

View File

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