enable dynamic range for all
This commit is contained in:
parent
bda582f4e3
commit
d4a4da7e43
@ -77,7 +77,8 @@ public final class RoutingContext {
|
||||
public boolean correctMisplacedViaPoints;
|
||||
public double correctMisplacedViaPointsDistance;
|
||||
public boolean useDynamicDistance;
|
||||
|
||||
public boolean buildBeelineOnRange;
|
||||
|
||||
private void setModel(String className) {
|
||||
if (className == null) {
|
||||
pm = new StdModel();
|
||||
@ -120,7 +121,7 @@ public final class RoutingContext {
|
||||
considerTurnRestrictions = 0.f != expctxGlobal.getVariableValue("considerTurnRestrictions", footMode ? 0.f : 1.f);
|
||||
|
||||
correctMisplacedViaPoints = 0.f != expctxGlobal.getVariableValue("correctMisplacedViaPoints", 1.f);
|
||||
correctMisplacedViaPointsDistance = expctxGlobal.getVariableValue("correctMisplacedViaPointsDistance", 40.f);
|
||||
correctMisplacedViaPointsDistance = expctxGlobal.getVariableValue("correctMisplacedViaPointsDistance", 0.f); // 0 == don't use distance
|
||||
|
||||
// process tags not used in the profile (to have them in the data-tab)
|
||||
processUnusedTags = 0.f != expctxGlobal.getVariableValue("processUnusedTags", 0.f);
|
||||
@ -169,7 +170,8 @@ public final class RoutingContext {
|
||||
// Constant power of the biker (in W)
|
||||
bikerPower = expctxGlobal.getVariableValue("bikerPower", 100.f);
|
||||
|
||||
useDynamicDistance = expctxGlobal.getVariableValue("use_dynamic_range", 0f) == 1f;
|
||||
useDynamicDistance = expctxGlobal.getVariableValue("use_dynamic_range", 1f) == 1f;
|
||||
buildBeelineOnRange = expctxGlobal.getVariableValue("add_beeline", 0f) == 1f;
|
||||
|
||||
boolean test = expctxGlobal.getVariableValue("check_start_way", 1f) == 1f;
|
||||
if (!test) freeNoWays();
|
||||
|
||||
@ -1085,6 +1085,7 @@ public class RoutingEngine extends Thread {
|
||||
private void matchWaypointsToNodes(List<MatchedWaypoint> unmatchedWaypoints) {
|
||||
resetCache(false);
|
||||
boolean useDynamicDistance = routingContext.useDynamicDistance;
|
||||
boolean bAddBeeline = routingContext.buildBeelineOnRange;
|
||||
double range = routingContext.waypointCatchingRange;
|
||||
boolean ok = nodesCache.matchWaypointsToNodes(unmatchedWaypoints, range, islandNodePairs);
|
||||
if (!ok && useDynamicDistance) {
|
||||
@ -1093,7 +1094,8 @@ public class RoutingEngine extends Thread {
|
||||
range = -MAX_DYNAMIC_RANGE;
|
||||
List<MatchedWaypoint> tmp = new ArrayList<>();
|
||||
for (MatchedWaypoint mwp : unmatchedWaypoints) {
|
||||
if (mwp.crosspoint == null || mwp.radius >= routingContext.waypointCatchingRange) tmp.add(mwp);
|
||||
if (mwp.crosspoint == null || mwp.radius >= routingContext.waypointCatchingRange)
|
||||
tmp.add(mwp);
|
||||
}
|
||||
ok = nodesCache.matchWaypointsToNodes(tmp, range, islandNodePairs);
|
||||
}
|
||||
@ -1104,7 +1106,7 @@ public class RoutingEngine extends Thread {
|
||||
}
|
||||
}
|
||||
// add beeline points when not already done
|
||||
if (useDynamicDistance && !useNodePoints) {
|
||||
if (useDynamicDistance && !useNodePoints && bAddBeeline) {
|
||||
List<MatchedWaypoint> waypoints = new ArrayList<>();
|
||||
for (int i = 0; i < unmatchedWaypoints.size(); i++) {
|
||||
MatchedWaypoint wp = unmatchedWaypoints.get(i);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user