Skip to content

Commit

Permalink
renamed variables, see #1844 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
karussell committed Jan 13, 2020
1 parent dc3b5e6 commit fb4dffa
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class InstructionsOutgoingEdges {
private final EdgeIteratorState prevEdge;
private final EdgeIteratorState currentEdge;
// Outgoing edges that we would be allowed to turn on
private final List<EdgeIteratorState> allowedOutgoingEdges;
private final List<EdgeIteratorState> filteredOutgoingEdges;
// All outgoing edges, including oneways in the wrong direction
private final List<EdgeIteratorState> allOutgoingEdges;
private final List<EdgeIteratorState> filteredEdges;
private final DecimalEncodedValue maxSpeedEnc;
private final DecimalEncodedValue avgSpeedEnc;
private final NodeAccess nodeAccess;
Expand All @@ -83,15 +83,15 @@ public InstructionsOutgoingEdges(EdgeIteratorState prevEdge,

EdgeIteratorState tmpEdge;

allOutgoingEdges = new ArrayList<>();
allowedOutgoingEdges = new ArrayList<>();
filteredEdges = new ArrayList<>();
filteredOutgoingEdges = new ArrayList<>();
EdgeIterator edgeIter = crossingExplorer.setBaseNode(baseNode);
while (edgeIter.next()) {
if (edgeIter.getAdjNode() != prevNode && edgeIter.getAdjNode() != adjNode) {
tmpEdge = edgeIter.detach(false);
allOutgoingEdges.add(tmpEdge);
filteredEdges.add(tmpEdge);
if (tmpEdge.get(accessEnc)) {
allowedOutgoingEdges.add(tmpEdge);
filteredOutgoingEdges.add(tmpEdge);
}
}
}
Expand All @@ -102,15 +102,15 @@ public InstructionsOutgoingEdges(EdgeIteratorState prevEdge,
* roads one might take at the intersection. This excludes the road you are coming from and inaccessible roads.
*/
public int nrOfAllowedOutgoingEdges() {
return 1 + allowedOutgoingEdges.size();
return 1 + filteredOutgoingEdges.size();
}

/**
* This method calculates the number of all outgoing edges, which could be considered the number of roads you see
* at the intersection. This excludes the road your are coming from.
*/
public int nrOfAllOutgoingEdges() {
return 1 + allOutgoingEdges.size();
return 1 + filteredEdges.size();
}


Expand All @@ -129,7 +129,7 @@ public boolean outgoingEdgesAreSlowerByFactor(double factor) {

double maxSurroundingSpeed = -1;

for (EdgeIteratorState edge : allOutgoingEdges) {
for (EdgeIteratorState edge : filteredEdges) {
tmpSpeed = getSpeed(edge);
if (tmpSpeed < 1) {
// This might happen for the DataFlagEncoder, might create unnecessary turn instructions
Expand Down Expand Up @@ -162,7 +162,7 @@ private double getSpeed(EdgeIteratorState edge) {
*/
public EdgeIteratorState getOtherContinue(double prevLat, double prevLon, double prevOrientation) {
int tmpSign;
for (EdgeIteratorState edge : allowedOutgoingEdges) {
for (EdgeIteratorState edge : filteredOutgoingEdges) {
GHPoint point = InstructionsHelper.getPointForOrientationCalculation(edge, nodeAccess);
tmpSign = InstructionsHelper.calculateSign(prevLat, prevLon, point.getLat(), point.getLon(), prevOrientation);
if (Math.abs(tmpSign) <= 1) {
Expand All @@ -184,7 +184,7 @@ public boolean isLeavingCurrentStreet(String prevName, String name) {

// If flags are changing, there might be a chance we find these flags on a different edge
boolean checkFlag = currentEdge.getFlags() != prevEdge.getFlags();
for (EdgeIteratorState edge : allowedOutgoingEdges) {
for (EdgeIteratorState edge : filteredOutgoingEdges) {
String edgeName = edge.getName();
IntsRef edgeFlag = edge.getFlags();
// leave the current street || enter a different street
Expand Down

0 comments on commit fb4dffa

Please sign in to comment.