Cleanup variable rename
This commit is contained in:
parent
7fd9047ac4
commit
465d40a475
@ -71,8 +71,7 @@ public class Pathfinder
|
||||
gScore[neighbor] = tentativeGScore;
|
||||
double h = Heuristic(currentNode, neighbor, goalNode, edge,
|
||||
heuristicRoadLevelPriority, heuristicFewJunctionsPriority, heuristicSameRoadPriority, angleWeightFactor);
|
||||
//Console.WriteLine($"Queue: {openSetfScore.Count:00000} Current Distance: {Utils.DistanceBetween(currentNode, goalNode):000000.00} Visited: {cameFromDict.Count:00000} Current heuristic: {h:00000.00}");
|
||||
openSetfScore.Enqueue(neighbor, tentativeGScore + h);
|
||||
openSetfScore.Enqueue(neighbor, tentativeGScore + h); //Currently set includes a lot of duplicates
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -86,18 +85,19 @@ public class Pathfinder
|
||||
{
|
||||
double distance = Utils.DistanceBetween(currentNode, neighborNode);
|
||||
double speed = regionManager.GetSpeedForEdge(currentNode, edge.wayId, _speedType);
|
||||
|
||||
double angle = 1;
|
||||
|
||||
double nodeAngle = 1;
|
||||
if (_cameFromDict!.ContainsKey(currentNode))
|
||||
{
|
||||
OsmNode previousNode = _cameFromDict[currentNode];
|
||||
Vector v1 = new(currentNode, previousNode);
|
||||
Vector v2 = new(currentNode, neighborNode);
|
||||
double nodeAngle = v1.Angle(v2);
|
||||
angle = (nodeAngle / 180);
|
||||
double angle = v1.Angle(v2);
|
||||
nodeAngle = (angle + 1) / 181;
|
||||
}
|
||||
double prio = regionManager.GetPriorityForVehicle(_speedType,edge, currentNode);
|
||||
return distance / (1 + speed * angle);
|
||||
|
||||
return distance / (speed * nodeAngle + prio + 1);
|
||||
}
|
||||
|
||||
private double Heuristic(OsmNode currentNode, OsmNode neighborNode, OsmNode goalNode, OsmEdge edge, double roadPriorityFactor, double junctionFactor, double sameRoadFactor, double nodeAngleFactor)
|
||||
|
Loading…
Reference in New Issue
Block a user