Compare commits

..

3 Commits

3 changed files with 10 additions and 10 deletions

View File

@ -88,7 +88,7 @@ public class Tag
}
public static readonly Dictionary<WayType, byte> defaultSpeedCar = new() {
{ WayType.NONE, 0 },
{ WayType.NONE, 1 },
{ WayType.motorway, 110 },
{ WayType.trunk, 100 },
{ WayType.primary, 80 },
@ -102,13 +102,13 @@ public class Tag
{ WayType.secondary_link, 25 },
{ WayType.tertiary_link, 25 },
{ WayType.living_street, 10 },
{ WayType.service, 0 },
{ WayType.service, 1 },
{ WayType.pedestrian, 0 },
{ WayType.track, 0 },
{ WayType.track, 15 },
{ WayType.bus_guideway, 0 },
{ WayType.escape, 0 },
{ WayType.raceway, 0 },
{ WayType.road, 25 },
{ WayType.road, 20 },
{ WayType.busway, 0 },
{ WayType.footway, 0 },
{ WayType.bridleway, 0 },
@ -125,9 +125,9 @@ public class Tag
{ WayType.trunk, 0 },
{ WayType.primary, 0 },
{ WayType.secondary, 0 },
{ WayType.tertiary, 0 },
{ WayType.tertiary, 2 },
{ WayType.unclassified, 1 },
{ WayType.residential, 3 },
{ WayType.residential, 4 },
{ WayType.motorway_link, 0 },
{ WayType.trunk_link, 0 },
{ WayType.primary_link, 0 },
@ -136,9 +136,9 @@ public class Tag
{ WayType.living_street, 5 },
{ WayType.service, 2 },
{ WayType.pedestrian, 5 },
{ WayType.track, 0 },
{ WayType.track, 1 },
{ WayType.bus_guideway, 0 },
{ WayType.escape, 0 },
{ WayType.escape, 1 },
{ WayType.raceway, 0 },
{ WayType.road, 3 },
{ WayType.busway, 0 },

View File

@ -45,7 +45,7 @@ public class Pathfinder
neighbor.currentPathWeight = newPotentialWeight;
neighbor.currentPathLength = closestNodeToGoal.currentPathLength + Utils.DistanceBetween(closestNodeToGoal, neighbor);
if (neighbor.Equals(goalNode) || closestNodeToGoal.directDistanceToGoal < 250)
if (neighbor.Equals(goalNode) || closestNodeToGoal.directDistanceToGoal < 10) //change for faster
stop = true;
else
{

View File

@ -19,7 +19,7 @@ public class Server
Coordinates start = new Coordinates(48.793319f, 9.832102f);
Coordinates finish = new Coordinates(48.840728f, 10.067603f);
Coordinates finish = new Coordinates(48.8407888f, 10.0676020f);
DateTime startTime = DateTime.Now;
OsmNode[] path = Pathfinder.CustomAStar("D:/stuttgart-regbez-latest", start, finish, Tag.SpeedType.car).ToArray();
TimeSpan duration = DateTime.Now - startTime;