Maximum turn angle variable
This commit is contained in:
parent
b89a3715a1
commit
97a8c2ea6f
@ -16,7 +16,7 @@ var app = builder.Build();
|
|||||||
app.MapGet("/getRoute", (float latStart, float lonStart, float latEnd, float lonEnd, Tag.SpeedType vehicle, double stayOnSameRoadPriority, double useHigherLevelRoadsPriority, double useRoadsWithLessJunctionsPriority, double angleFactor) =>
|
app.MapGet("/getRoute", (float latStart, float lonStart, float latEnd, float lonEnd, Tag.SpeedType vehicle, double stayOnSameRoadPriority, double useHigherLevelRoadsPriority, double useRoadsWithLessJunctionsPriority, double angleFactor) =>
|
||||||
{
|
{
|
||||||
Pathfinder result = new Pathfinder("D:/stuttgart-regbez-latest", useHigherLevelRoadsPriority, stayOnSameRoadPriority,
|
Pathfinder result = new Pathfinder("D:/stuttgart-regbez-latest", useHigherLevelRoadsPriority, stayOnSameRoadPriority,
|
||||||
useRoadsWithLessJunctionsPriority, angleFactor).AStar(new Coordinates(latStart, lonStart),
|
useRoadsWithLessJunctionsPriority, angleFactor, 30).AStar(new Coordinates(latStart, lonStart),
|
||||||
new Coordinates(latEnd, lonEnd), vehicle);
|
new Coordinates(latEnd, lonEnd), vehicle);
|
||||||
return result.pathResult;
|
return result.pathResult;
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ app.MapGet("/getRoute", (float latStart, float lonStart, float latEnd, float lon
|
|||||||
app.MapGet("/getShortestRoute", (float latStart, float lonStart, float latEnd, float lonEnd) =>
|
app.MapGet("/getShortestRoute", (float latStart, float lonStart, float latEnd, float lonEnd) =>
|
||||||
{
|
{
|
||||||
Pathfinder result = new Pathfinder("D:/stuttgart-regbez-latest", 0, 0,
|
Pathfinder result = new Pathfinder("D:/stuttgart-regbez-latest", 0, 0,
|
||||||
0, 0).AStar(new Coordinates(latStart, lonStart),
|
0, 0, 30).AStar(new Coordinates(latStart, lonStart),
|
||||||
new Coordinates(latEnd, lonEnd), Tag.SpeedType.any);
|
new Coordinates(latEnd, lonEnd), Tag.SpeedType.any);
|
||||||
return result.pathResult;
|
return result.pathResult;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ public class Server
|
|||||||
Console.SetError(newConsole);
|
Console.SetError(newConsole);
|
||||||
|
|
||||||
string workingDir = "D:/stuttgart-regbez-latest";
|
string workingDir = "D:/stuttgart-regbez-latest";
|
||||||
|
|
||||||
//RegionConverter.ConvertXMLToRegions("D:/stuttgart-regbez-latest.osm", "D:/stuttgart-regbez-latest");
|
//RegionConverter.ConvertXMLToRegions("D:/stuttgart-regbez-latest.osm", "D:/stuttgart-regbez-latest");
|
||||||
//RegionConverter.ConvertXMLToRegions("D:/map.osm", "D:/map");
|
//RegionConverter.ConvertXMLToRegions("D:/map.osm", "D:/map");
|
||||||
//RegionConverter.ConvertXMLToRegions("D:/germany-latest.osm", "D:/germany-latest");
|
//RegionConverter.ConvertXMLToRegions("D:/germany-latest.osm", "D:/germany-latest");
|
||||||
@ -31,10 +31,10 @@ public class Server
|
|||||||
/*
|
/*
|
||||||
string parentFolder = new DirectoryInfo(workingDir).Parent!.FullName;
|
string parentFolder = new DirectoryInfo(workingDir).Parent!.FullName;
|
||||||
|
|
||||||
Pathfinder result = new Pathfinder(workingDir).AStar(start,
|
Pathfinder result = new Pathfinder(workingDir, 0.002, 0,
|
||||||
finish, Tag.SpeedType.car, 0.034, 0.012,
|
0, 1, 30).AStar(start,
|
||||||
0, 0.18);
|
finish, Tag.SpeedType.car);
|
||||||
|
|
||||||
Console.WriteLine($"Calc-time {result.pathResult!.calcTime} Path-length: {result.pathResult.pathNodes.Count} Visited-nodes: {result.gScore!.Count}");
|
Console.WriteLine($"Calc-time {result.pathResult!.calcTime} Path-length: {result.pathResult.pathNodes.Count} Visited-nodes: {result.gScore!.Count}");
|
||||||
|
|
||||||
string fileName = DateTime.Now.ToFileTime().ToString();
|
string fileName = DateTime.Now.ToFileTime().ToString();
|
||||||
@ -88,9 +88,9 @@ public class Server
|
|||||||
double factor = angleWeightFactor;
|
double factor = angleWeightFactor;
|
||||||
calcThreads.Enqueue(new Thread(() =>
|
calcThreads.Enqueue(new Thread(() =>
|
||||||
{
|
{
|
||||||
Pathfinder testresult = new Pathfinder(rm).AStar(start,
|
Pathfinder testresult = new Pathfinder(rm, priority, roadPriority,
|
||||||
finish, Tag.SpeedType.car, priority, roadPriority,
|
0, factor, 30).AStar(start,
|
||||||
0, factor);
|
finish, Tag.SpeedType.car);
|
||||||
string fileName =
|
string fileName =
|
||||||
$"angle{factor:0.000}_level{priority:0.000}_same{roadPriority:0.000}.result";
|
$"angle{factor:0.000}_level{priority:0.000}_same{roadPriority:0.000}.result";
|
||||||
testresult.SaveResult(Path.Join(parentFolder, fileName));
|
testresult.SaveResult(Path.Join(parentFolder, fileName));
|
||||||
|
Reference in New Issue
Block a user