further fixes but forward/reverse edge weights are reversed
This commit is contained in:
parent
394e369b54
commit
8ec3d549a6
@ -545,7 +545,7 @@ void EdgeBasedGraphFactory::Run(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
if ( //TODO: rename to IsCompatibleTo
|
||||
fwd_edge_data1.IsEqualTo(fwd_edge_data2) &&
|
||||
rev_edge_data1.IsEqualTo(rev_edge_data2)
|
||||
) {
|
||||
|
@ -152,30 +152,31 @@ struct PhantomNodes
|
||||
return source_phantom == target_phantom;
|
||||
}
|
||||
|
||||
bool ComputeForwardQueueOffset() const
|
||||
{
|
||||
if (source_phantom.forward_node_id == target_phantom.forward_node_id)
|
||||
{
|
||||
const int forward_queue_weight = source_phantom.GetForwardWeightPlusOffset();
|
||||
const int reverse_queue_weight = target_phantom.GetForwardWeightPlusOffset();
|
||||
const int weight_diff = (forward_queue_weight - reverse_queue_weight);
|
||||
SimpleLogger().Write(logDEBUG) << "fwd queue offset: " << std::max(0, weight_diff);
|
||||
return 0;//std::max(0, weight_diff);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// bool ComputeForwardQueueOffset() const
|
||||
// {
|
||||
// if (source_phantom.forward_node_id == target_phantom.forward_node_id)
|
||||
// {
|
||||
// const int forward_queue_weight = source_phantom.GetForwardWeightPlusOffset();
|
||||
// const int reverse_queue_weight = target_phantom.GetForwardWeightPlusOffset();
|
||||
// const int weight_diff = (forward_queue_weight - reverse_queue_weight);
|
||||
// SimpleLogger().Write(logDEBUG) << "fwd queue offset: " << std::max(0, weight_diff);
|
||||
// return 0;//std::max(0, weight_diff);
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
bool ComputeReverseQueueOffset() const
|
||||
{
|
||||
if (source_phantom.reverse_node_id == target_phantom.reverse_node_id)
|
||||
{
|
||||
const int forward_queue_weight = source_phantom.GetReverseWeightPlusOffset();
|
||||
const int reverse_queue_weight = target_phantom.GetReverseWeightPlusOffset();
|
||||
const int weight_diff = (forward_queue_weight - reverse_queue_weight);
|
||||
return 0;//std::max(0, weight_diff);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// bool ComputeReverseQueueOffset() const
|
||||
// {
|
||||
// if (source_phantom.reverse_node_id == target_phantom.reverse_node_id)
|
||||
// {
|
||||
// const int forward_queue_weight = source_phantom.GetReverseWeightPlusOffset();
|
||||
// const int reverse_queue_weight = target_phantom.GetReverseWeightPlusOffset();
|
||||
// const int weight_diff = (forward_queue_weight - reverse_queue_weight);
|
||||
// SimpleLogger().Write(logDEBUG) << "rev queue offset: " << std::max(0, weight_diff);
|
||||
// return 0;//std::max(0, weight_diff);
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream &out, const PhantomNodes & pn)
|
||||
|
@ -691,13 +691,13 @@ public:
|
||||
) { //found a new minimum
|
||||
min_dist = current_perpendicular_distance;
|
||||
//TODO: use assignment c'tor in PhantomNode
|
||||
result_phantom_node.forward_node_id = current_edge.forward_edge_based_node_id;
|
||||
result_phantom_node.reverse_node_id = current_edge.reverse_edge_based_node_id;
|
||||
result_phantom_node.forward_node_id = current_edge.reverse_edge_based_node_id;
|
||||
result_phantom_node.reverse_node_id = current_edge.forward_edge_based_node_id;
|
||||
result_phantom_node.name_id = current_edge.name_id;
|
||||
result_phantom_node.forward_weight = current_edge.forward_weight;
|
||||
result_phantom_node.reverse_weight = current_edge.reverse_weight;
|
||||
result_phantom_node.forward_offset = current_edge.forward_offset;
|
||||
result_phantom_node.reverse_offset = current_edge.reverse_offset;
|
||||
result_phantom_node.forward_weight = current_edge.reverse_weight;
|
||||
result_phantom_node.reverse_weight = current_edge.forward_weight;
|
||||
result_phantom_node.forward_offset = current_edge.reverse_offset;
|
||||
result_phantom_node.reverse_offset = current_edge.forward_offset;
|
||||
result_phantom_node.packed_geometry_id = current_edge.packed_geometry_id;
|
||||
result_phantom_node.fwd_segment_position = current_edge.fwd_segment_position;
|
||||
|
||||
|
@ -150,11 +150,11 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
const int forward_offset = phantom_node_pair.ComputeForwardQueueOffset();
|
||||
// const int forward_offset = phantom_node_pair.ComputeForwardQueueOffset();
|
||||
// const int forward_offset = super::ComputeEdgeOffset(
|
||||
// phantom_node_pair.source_phantom
|
||||
// );
|
||||
const int reverse_offset = phantom_node_pair.ComputeReverseQueueOffset();
|
||||
// const int reverse_offset = phantom_node_pair.ComputeReverseQueueOffset();
|
||||
// const int reverse_offset = super::ComputeEdgeOffset(
|
||||
// phantom_node_pair.target_phantom
|
||||
// );
|
||||
@ -171,7 +171,7 @@ public:
|
||||
&upper_bound_to_shortest_path_distance,
|
||||
via_node_candidate_list,
|
||||
forward_search_space,
|
||||
forward_offset
|
||||
0
|
||||
);
|
||||
}
|
||||
if(0 < reverse_heap1.Size()){
|
||||
@ -182,7 +182,7 @@ public:
|
||||
&upper_bound_to_shortest_path_distance,
|
||||
via_node_candidate_list,
|
||||
reverse_search_space,
|
||||
reverse_offset
|
||||
0
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -286,7 +286,7 @@ public:
|
||||
//prioritizing via nodes for deep inspection
|
||||
BOOST_FOREACH(const NodeID node, preselected_node_list) {
|
||||
int length_of_via_path = 0, sharing_of_via_path = 0;
|
||||
ComputeLengthAndSharingOfViaPath(node, &length_of_via_path, &sharing_of_via_path, forward_offset+reverse_offset, packed_shortest_path);
|
||||
ComputeLengthAndSharingOfViaPath(node, &length_of_via_path, &sharing_of_via_path, 0, packed_shortest_path);
|
||||
const int maximum_allowed_sharing = upper_bound_to_shortest_path_distance*VIAPATH_GAMMA;
|
||||
if( sharing_of_via_path <= maximum_allowed_sharing && length_of_via_path <= upper_bound_to_shortest_path_distance*(1+VIAPATH_EPSILON)) {
|
||||
ranked_candidates_list.push_back(
|
||||
@ -307,7 +307,7 @@ public:
|
||||
int length_of_via_path = INVALID_EDGE_WEIGHT;
|
||||
NodeID s_v_middle = SPECIAL_NODEID, v_t_middle = SPECIAL_NODEID;
|
||||
BOOST_FOREACH(const RankedCandidateNode & candidate, ranked_candidates_list){
|
||||
if(ViaNodeCandidatePassesTTest(forward_heap1, reverse_heap1, forward_heap2, reverse_heap2, candidate, forward_offset+reverse_offset, upper_bound_to_shortest_path_distance, &length_of_via_path, &s_v_middle, &v_t_middle)) {
|
||||
if(ViaNodeCandidatePassesTTest(forward_heap1, reverse_heap1, forward_heap2, reverse_heap2, candidate, 0, upper_bound_to_shortest_path_distance, &length_of_via_path, &s_v_middle, &v_t_middle)) {
|
||||
// select first admissable
|
||||
selected_via_node = candidate.node;
|
||||
break;
|
||||
|
@ -159,11 +159,11 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
const int forward_offset = phantom_node_pair.ComputeForwardQueueOffset();
|
||||
// const int forward_offset = phantom_node_pair.ComputeForwardQueueOffset();
|
||||
// const int forward_offset = super::ComputeForwardOffset(
|
||||
// phantom_node_pair.source_phantom
|
||||
// );
|
||||
const int reverse_offset = -phantom_node_pair.ComputeReverseQueueOffset();
|
||||
// const int reverse_offset = -phantom_node_pair.ComputeReverseQueueOffset();
|
||||
// const int reverse_offset = super::ComputeReverseOffset(
|
||||
// phantom_node_pair.target_phantom
|
||||
// );
|
||||
@ -176,7 +176,7 @@ public:
|
||||
reverse_heap1,
|
||||
&middle1,
|
||||
&local_upper_bound1,
|
||||
forward_offset,
|
||||
0,
|
||||
true
|
||||
);
|
||||
}
|
||||
@ -186,7 +186,7 @@ public:
|
||||
forward_heap1,
|
||||
&middle1,
|
||||
&local_upper_bound1,
|
||||
reverse_offset,
|
||||
0,
|
||||
false
|
||||
);
|
||||
}
|
||||
@ -200,7 +200,7 @@ public:
|
||||
reverse_heap2,
|
||||
&middle2,
|
||||
&local_upper_bound2,
|
||||
forward_offset,
|
||||
0,
|
||||
true
|
||||
);
|
||||
}
|
||||
@ -210,7 +210,7 @@ public:
|
||||
forward_heap2,
|
||||
&middle2,
|
||||
&local_upper_bound2,
|
||||
reverse_offset,
|
||||
0,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user