Slightly modify default router perferences
This commit is contained in:
parent
0755a5459c
commit
9d91d90633
2 changed files with 7 additions and 7 deletions
|
@ -177,7 +177,7 @@ public class BinaryRoutePlanner {
|
||||||
};
|
};
|
||||||
PriorityQueue<RouteSegment> graphSegments = new PriorityQueue<RouteSegment>(50, segmentsComparator);
|
PriorityQueue<RouteSegment> graphSegments = new PriorityQueue<RouteSegment>(50, segmentsComparator);
|
||||||
// initialize temporary lists to calculate not forbidden ways at way intersections
|
// initialize temporary lists to calculate not forbidden ways at way intersections
|
||||||
ArrayList<RouteSegment> segmentsToVisitPrescricted = new ArrayList<RouteSegment>(5);
|
ArrayList<RouteSegment> segmentsToVisitPrescripted = new ArrayList<RouteSegment>(5);
|
||||||
ArrayList<RouteSegment> segmentsToVisitNotForbidden = new ArrayList<RouteSegment>(5);
|
ArrayList<RouteSegment> segmentsToVisitNotForbidden = new ArrayList<RouteSegment>(5);
|
||||||
|
|
||||||
// Set to not visit one segment twice (stores road.id << X + segmentStart)
|
// Set to not visit one segment twice (stores road.id << X + segmentStart)
|
||||||
|
@ -282,7 +282,7 @@ public class BinaryRoutePlanner {
|
||||||
RouteSegment next = ctx.routes.get(l);
|
RouteSegment next = ctx.routes.get(l);
|
||||||
if (next != null) {
|
if (next != null) {
|
||||||
|
|
||||||
segmentsToVisitPrescricted.clear();
|
segmentsToVisitPrescripted.clear();
|
||||||
segmentsToVisitNotForbidden.clear();
|
segmentsToVisitNotForbidden.clear();
|
||||||
boolean exclusiveRestriction = false;
|
boolean exclusiveRestriction = false;
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ public class BinaryRoutePlanner {
|
||||||
// case exclusive restriction (only_right, only_straight, ...)
|
// case exclusive restriction (only_right, only_straight, ...)
|
||||||
exclusiveRestriction = true;
|
exclusiveRestriction = true;
|
||||||
segmentsToVisitNotForbidden.clear();
|
segmentsToVisitNotForbidden.clear();
|
||||||
segmentsToVisitPrescricted.add(next);
|
segmentsToVisitPrescripted.add(next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ public class BinaryRoutePlanner {
|
||||||
for(RouteSegment s : segmentsToVisitNotForbidden){
|
for(RouteSegment s : segmentsToVisitNotForbidden){
|
||||||
graphSegments.add(s);
|
graphSegments.add(s);
|
||||||
}
|
}
|
||||||
for(RouteSegment s : segmentsToVisitPrescricted){
|
for(RouteSegment s : segmentsToVisitPrescripted){
|
||||||
graphSegments.add(s);
|
graphSegments.add(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ import net.osmand.osm.LatLon;
|
||||||
import net.osmand.osm.MapUtils;
|
import net.osmand.osm.MapUtils;
|
||||||
import net.osmand.osm.Way;
|
import net.osmand.osm.Way;
|
||||||
import net.osmand.router.BinaryRoutePlanner;
|
import net.osmand.router.BinaryRoutePlanner;
|
||||||
|
import net.osmand.router.RouteSegmentResult;
|
||||||
import net.osmand.router.BinaryRoutePlanner.RouteSegment;
|
import net.osmand.router.BinaryRoutePlanner.RouteSegment;
|
||||||
import net.osmand.router.BinaryRoutePlanner.RouteSegmentResult;
|
|
||||||
import net.osmand.router.BinaryRoutePlanner.RouteSegmentVisitor;
|
import net.osmand.router.BinaryRoutePlanner.RouteSegmentVisitor;
|
||||||
import net.osmand.router.BinaryRoutePlanner.RoutingContext;
|
import net.osmand.router.BinaryRoutePlanner.RoutingContext;
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ import org.xml.sax.SAXException;
|
||||||
|
|
||||||
public class MapRouterLayer implements MapPanelLayer {
|
public class MapRouterLayer implements MapPanelLayer {
|
||||||
|
|
||||||
private /*final */ static boolean ANIMATE_CALCULATING_ROUTE = true;
|
private /*final */ static boolean ANIMATE_CALCULATING_ROUTE = false;
|
||||||
private /*final */ static int SIZE_OF_ROUTES_TO_ANIMATE = 1;
|
private /*final */ static int SIZE_OF_ROUTES_TO_ANIMATE = 50;
|
||||||
|
|
||||||
|
|
||||||
private MapPanel map;
|
private MapPanel map;
|
||||||
|
|
Loading…
Reference in a new issue