fixed pathfinding namespace
This commit is contained in:
parent
fc5d388ecd
commit
bf08f38a1e
@ -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);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using OSMDatastructure;
|
using OSMDatastructure;
|
||||||
using OSMDatastructure.Graph;
|
using OSMDatastructure.Graph;
|
||||||
using OSMImporter;
|
|
||||||
|
|
||||||
namespace Pathfinding;
|
namespace Pathfinding;
|
||||||
|
|
||||||
|
@ -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))
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user