other improvements.

Variable renaming with better names
This commit is contained in:
xlaussel
2020-11-23 23:10:22 +01:00
parent 41af9615cd
commit e181cb325c
4 changed files with 27 additions and 27 deletions
@@ -121,7 +121,7 @@ void alternativeRoutingStep(const DataFacade<Algorithm> &facade,
forward_heap.Insert(to, to_weight, heapNode.node);
}
// Found a shorter Path -> Update weight
else if (to_weight < forward_heap.GetKey(to))
else if (to_weight < toHeapNode->weight)
{
// new parent
toHeapNode->data.parent = heapNode.node;
@@ -79,7 +79,7 @@ void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
}
// Found a shorter Path -> Update weight and set new parent
else if (std::tie(to_weight, to_duration) <
std::tie(query_heap.GetKey(to), query_heap.GetData(to).duration))
std::tie(toHeapNode->weight, toHeapNode->data.duration))
{
toHeapNode->data = {heapNode.node, to_duration, to_distance};
toHeapNode->weight=to_weight;
@@ -78,7 +78,7 @@ void relaxBorderEdges(const DataFacade<mld::Algorithm> &facade,
}
// Found a shorter Path -> Update weight and set new parent
else if (std::tie(to_weight, to_duration, to_distance, node) <
std::tie(query_heap.GetKey(to),
std::tie(toHeapNode->weight,
toHeapNode->data.duration,
toHeapNode->data.distance,
toHeapNode->data.parent))
@@ -140,7 +140,7 @@ void relaxOutgoingEdges(const DataFacade<mld::Algorithm> &facade,
query_heap.Insert(to, to_weight, {node, true, to_duration, to_distance});
}
else if (std::tie(to_weight, to_duration, to_distance, node) <
std::tie(query_heap.GetKey(to),
std::tie(toHeapNode->weight,
toHeapNode->data.duration,
toHeapNode->data.distance,
toHeapNode->data.parent))
@@ -180,7 +180,7 @@ void relaxOutgoingEdges(const DataFacade<mld::Algorithm> &facade,
query_heap.Insert(to, to_weight, {node, true, to_duration, to_distance});
}
else if (std::tie(to_weight, to_duration, to_distance, node) <
std::tie(query_heap.GetKey(to),
std::tie(toHeapNode->weight,
toHeapNode->data.duration,
toHeapNode->data.distance,
toHeapNode->data.parent))