double priority = ctx.getRouter().defineSpeedPriority(road);
double speed = ctx.getRouter().defineSpeed(road) * priority;
if (speed == 0) {
speed = ctx.getRouter().getMinDefaultSpeed() * priority;
}
<BUG>double distStartObstacles = segment.distanceFromStart + ( d > 0? obstaclePlusTime : obstacleMinusTime) +
</BUG>
distOnRoadToPass / speed;
double distToFinalPoint = squareRootDist(x, y, targetEndX, targetEndY);
boolean routeFound = processIntersections(ctx, graphSegments, visitedSegments, oppositeSegments,

double priority = ctx.getRouter().defineSpeedPriority(road);
double speed = ctx.getRouter().defineSpeed(road) * priority;
if (speed == 0) {
speed = ctx.getRouter().getMinDefaultSpeed() * priority;
}
double distStartObstacles = segment.distanceFromStart + ( segmentEnd > middle? obstaclePlusTime : obstacleMinusTime) +
distOnRoadToPass / speed;
double distToFinalPoint = squareRootDist(x, y, targetEndX, targetEndY);
boolean routeFound = processIntersections(ctx, graphSegments, visitedSegments, oppositeSegments,
