fixed pathfinding namespace
This commit is contained in:
parent
fc5d388ecd
commit
bf08f38a1e
@ -1,6 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using OSMDatastructure.Graph;
|
||||
using OSMImporter;
|
||||
using Pathfinding;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
@ -1,6 +1,5 @@
|
||||
using OSMDatastructure;
|
||||
using OSMDatastructure.Graph;
|
||||
using OSMImporter;
|
||||
|
||||
namespace Pathfinding;
|
||||
|
||||
|
@ -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))
|
||||
|
@ -2,7 +2,7 @@ using System.Text.Json;
|
||||
using OSMDatastructure;
|
||||
using OSMDatastructure.Graph;
|
||||
|
||||
namespace OSMImporter
|
||||
namespace Pathfinding
|
||||
{
|
||||
public class RegionManager
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user