Skip to content

Commit

Permalink
remove now unused compression functionality from restriction map
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Kobitzsch committed Jul 12, 2017
1 parent d01a007 commit c5e4c66
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 80 deletions.
53 changes: 0 additions & 53 deletions include/extractor/restriction_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,61 +80,8 @@ class RestrictionMap
RestrictionMap() : m_count(0) {}
RestrictionMap(const std::vector<TurnRestriction> &restriction_list);

// Replace end v with w in each turn restriction containing u as via node
template <class GraphT>
void FixupArrivingTurnRestriction(const NodeID node_u,
const NodeID node_v,
const NodeID node_w,
const GraphT &graph)
{
BOOST_ASSERT(node_u != SPECIAL_NODEID);
BOOST_ASSERT(node_v != SPECIAL_NODEID);
BOOST_ASSERT(node_w != SPECIAL_NODEID);

if (!IsViaNode(node_u))
{
return;
}

// find all potential start edges. It is more efficient to get a (small) list
// of potential start edges than iterating over all buckets
std::vector<NodeID> predecessors;
for (const EdgeID current_edge_id : graph.GetAdjacentEdgeRange(node_u))
{
const NodeID target = graph.GetTarget(current_edge_id);
if (node_v != target)
{
predecessors.push_back(target);
}
}

for (const NodeID node_x : predecessors)
{
const auto restriction_iterator = m_restriction_map.find({node_x, node_u});
if (restriction_iterator == m_restriction_map.end())
{
continue;
}

const unsigned index = restriction_iterator->second;
auto &bucket = m_restriction_bucket_list.at(index);

for (RestrictionTarget &restriction_target : bucket)
{
if (node_v == restriction_target.target_node)
{
restriction_target.target_node = node_w;
}
}
}
}

bool IsViaNode(const NodeID node) const;

// Replaces start edge (v, w) with (u, w). Only start node changes.
void
FixupStartingTurnRestriction(const NodeID node_u, const NodeID node_v, const NodeID node_w);

// Check if edge (u, v) is the start of any turn restriction.
// If so returns id of first target node.
NodeID CheckForEmanatingIsOnlyTurn(const NodeID node_u, const NodeID node_v) const;
Expand Down
27 changes: 0 additions & 27 deletions src/extractor/restriction_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,33 +65,6 @@ bool RestrictionMap::IsViaNode(const NodeID node) const
return m_no_turn_via_node_set.find(node) != m_no_turn_via_node_set.end();
}

// Replaces start edge (v, w) with (u, w). Only start node changes.
void RestrictionMap::FixupStartingTurnRestriction(const NodeID node_u,
const NodeID node_v,
const NodeID node_w)
{
BOOST_ASSERT(node_u != SPECIAL_NODEID);
BOOST_ASSERT(node_v != SPECIAL_NODEID);
BOOST_ASSERT(node_w != SPECIAL_NODEID);

if (!IsSourceNode(node_v))
{
return;
}

const auto restriction_iterator = m_restriction_map.find({node_v, node_w});
if (restriction_iterator != m_restriction_map.end())
{
const unsigned index = restriction_iterator->second;
// remove old restriction start (v,w)
m_restriction_map.erase(restriction_iterator);
m_restriction_start_nodes.emplace(node_u);
// insert new restriction start (u,w) (pointing to index)
RestrictionSource new_source = {node_u, node_w};
m_restriction_map.emplace(new_source, index);
}
}

// Check if edge (u, v) is the start of any turn restriction.
// If so returns id of first target node.
NodeID RestrictionMap::CheckForEmanatingIsOnlyTurn(const NodeID node_u, const NodeID node_v) const
Expand Down

0 comments on commit c5e4c66

Please sign in to comment.