added new dynamic
This commit is contained in:
parent
a07fd6a400
commit
a134c128bc
@ -77,6 +77,7 @@ public final class RoutingContext {
|
|||||||
public boolean correctMisplacedViaPoints;
|
public boolean correctMisplacedViaPoints;
|
||||||
public double correctMisplacedViaPointsDistance;
|
public double correctMisplacedViaPointsDistance;
|
||||||
public boolean useDynamicDistance;
|
public boolean useDynamicDistance;
|
||||||
|
public boolean buildBeelineOnRange;
|
||||||
|
|
||||||
public AreaInfo ai;
|
public AreaInfo ai;
|
||||||
|
|
||||||
@ -171,7 +172,8 @@ public final class RoutingContext {
|
|||||||
// Constant power of the biker (in W)
|
// Constant power of the biker (in W)
|
||||||
bikerPower = expctxGlobal.getVariableValue("bikerPower", 100.f);
|
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;
|
boolean test = expctxGlobal.getVariableValue("check_start_way", 1f) == 1f;
|
||||||
if (!test) freeNoWays();
|
if (!test) freeNoWays();
|
||||||
|
|||||||
@ -1473,6 +1473,7 @@ public class RoutingEngine extends Thread {
|
|||||||
private void matchWaypointsToNodes(List<MatchedWaypoint> unmatchedWaypoints) {
|
private void matchWaypointsToNodes(List<MatchedWaypoint> unmatchedWaypoints) {
|
||||||
resetCache(false);
|
resetCache(false);
|
||||||
boolean useDynamicDistance = routingContext.useDynamicDistance;
|
boolean useDynamicDistance = routingContext.useDynamicDistance;
|
||||||
|
boolean bAddBeeline = routingContext.buildBeelineOnRange;
|
||||||
double range = routingContext.waypointCatchingRange;
|
double range = routingContext.waypointCatchingRange;
|
||||||
boolean ok = nodesCache.matchWaypointsToNodes(unmatchedWaypoints, range, islandNodePairs);
|
boolean ok = nodesCache.matchWaypointsToNodes(unmatchedWaypoints, range, islandNodePairs);
|
||||||
if (!ok && useDynamicDistance) {
|
if (!ok && useDynamicDistance) {
|
||||||
@ -1493,7 +1494,7 @@ public class RoutingEngine extends Thread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add beeline points when not already done
|
// add beeline points when not already done
|
||||||
if (useDynamicDistance && !useNodePoints && engineMode != BROUTER_ENGINEMODE_ROUNDTRIP) {
|
if (useDynamicDistance && !useNodePoints && bAddBeeline) {
|
||||||
List<MatchedWaypoint> waypoints = new ArrayList<>();
|
List<MatchedWaypoint> waypoints = new ArrayList<>();
|
||||||
for (int i = 0; i < unmatchedWaypoints.size(); i++) {
|
for (int i = 0; i < unmatchedWaypoints.size(); i++) {
|
||||||
MatchedWaypoint wp = unmatchedWaypoints.get(i);
|
MatchedWaypoint wp = unmatchedWaypoints.get(i);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user