change finish route parameters
This commit is contained in:
parent
488d37b070
commit
cc265269e6
1 changed files with 6 additions and 2 deletions
|
@ -64,6 +64,8 @@ public class RoutingEngine extends Thread {
|
||||||
protected RoutingContext routingContext;
|
protected RoutingContext routingContext;
|
||||||
|
|
||||||
public double airDistanceCostFactor;
|
public double airDistanceCostFactor;
|
||||||
|
public double lastAirDistanceCostFactor;
|
||||||
|
|
||||||
private OsmTrack guideTrack;
|
private OsmTrack guideTrack;
|
||||||
|
|
||||||
private OsmPathElement matchPath;
|
private OsmPathElement matchPath;
|
||||||
|
@ -933,6 +935,7 @@ public class RoutingEngine extends Thread {
|
||||||
|
|
||||||
if (track == null) {
|
if (track == null) {
|
||||||
for (int cfi = 0; cfi < airDistanceCostFactors.length; cfi++) {
|
for (int cfi = 0; cfi < airDistanceCostFactors.length; cfi++) {
|
||||||
|
if (cfi > 0) lastAirDistanceCostFactor = airDistanceCostFactors[cfi-1];
|
||||||
airDistanceCostFactor = airDistanceCostFactors[cfi];
|
airDistanceCostFactor = airDistanceCostFactors[cfi];
|
||||||
|
|
||||||
if (airDistanceCostFactor < 0.) {
|
if (airDistanceCostFactor < 0.) {
|
||||||
|
@ -986,6 +989,7 @@ public class RoutingEngine extends Thread {
|
||||||
|
|
||||||
// final run for verbose log info and detail nodes
|
// final run for verbose log info and detail nodes
|
||||||
airDistanceCostFactor = 0.;
|
airDistanceCostFactor = 0.;
|
||||||
|
lastAirDistanceCostFactor = 0.;
|
||||||
guideTrack = track;
|
guideTrack = track;
|
||||||
startTime = System.currentTimeMillis(); // reset timeout...
|
startTime = System.currentTimeMillis(); // reset timeout...
|
||||||
try {
|
try {
|
||||||
|
@ -1328,7 +1332,7 @@ public class RoutingEngine extends Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
// recheck cutoff before doing expensive stuff
|
// recheck cutoff before doing expensive stuff
|
||||||
int addDiff = 300;
|
int addDiff = 100;
|
||||||
if (path.cost + path.airdistance > maxTotalCost + addDiff) {
|
if (path.cost + path.airdistance > maxTotalCost + addDiff) {
|
||||||
path.unregisterUpTree(routingContext);
|
path.unregisterUpTree(routingContext);
|
||||||
continue;
|
continue;
|
||||||
|
@ -1427,7 +1431,7 @@ public class RoutingEngine extends Thread {
|
||||||
|
|
||||||
boolean inRadius = boundary == null || boundary.isInBoundary(nextNode, bestPath.cost);
|
boolean inRadius = boundary == null || boundary.isInBoundary(nextNode, bestPath.cost);
|
||||||
|
|
||||||
if (inRadius && (isFinalLink || bestPath.cost + bestPath.airdistance <= maxTotalCost + addDiff)) {
|
if (inRadius && (isFinalLink || bestPath.cost + bestPath.airdistance <= (lastAirDistanceCostFactor != 0. ? maxTotalCost*lastAirDistanceCostFactor : maxTotalCost) + addDiff)) {
|
||||||
// add only if this may beat an existing path for that link
|
// add only if this may beat an existing path for that link
|
||||||
OsmLinkHolder dominator = link.getFirstLinkHolder(currentNode);
|
OsmLinkHolder dominator = link.getFirstLinkHolder(currentNode);
|
||||||
while (!trafficSim && dominator != null) {
|
while (!trafficSim && dominator != null) {
|
||||||
|
|
Loading…
Reference in a new issue