Parallelize generation of the edge-expanded-edges.

This commit is contained in:
Daniel Patterson
2017-06-06 21:31:07 -07:00
committed by Patrick Niklaus
parent b68d79407e
commit 35550d8c0a
12 changed files with 425 additions and 240 deletions
+4 -15
View File
@@ -34,8 +34,8 @@ std::size_t getNumberOfTurns(const Intersection &intersection)
} // namespace
TurnLaneHandler::TurnLaneHandler(const util::NodeBasedDynamicGraph &node_based_graph,
std::vector<std::uint32_t> &turn_lane_offsets,
std::vector<TurnLaneType::Mask> &turn_lane_masks,
const std::vector<std::uint32_t> &turn_lane_offsets,
const std::vector<TurnLaneType::Mask> &turn_lane_masks,
LaneDescriptionMap &lane_description_map,
const TurnAnalysis &turn_analysis,
util::guidance::LaneDataIdMap &id_map)
@@ -781,19 +781,8 @@ Intersection TurnLaneHandler::handleSliproadTurn(Intersection intersection,
}
}
const auto combined_id = [&]() {
auto itr = lane_description_map.find(combined_description);
if (lane_description_map.find(combined_description) == lane_description_map.end())
{
const auto new_id = boost::numeric_cast<LaneDescriptionID>(lane_description_map.size());
lane_description_map[combined_description] = new_id;
return new_id;
}
else
{
return itr->second;
}
}();
const auto combined_id = lane_description_map.ConcurrentFindOrAdd(combined_description);
return simpleMatchTuplesToTurns(std::move(intersection), lane_data, combined_id);
}
+1 -10
View File
@@ -209,16 +209,7 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection,
util::guidance::LaneTupleIdPair key{{LaneID(data.to - data.from + 1), data.from},
lane_string_id};
auto lane_data_id = boost::numeric_cast<LaneDataID>(lane_data_to_id.size());
const auto it = lane_data_to_id.find(key);
if (it == lane_data_to_id.end())
lane_data_to_id.insert({key, lane_data_id});
else
lane_data_id = it->second;
// set lane id instead after the switch:
road.lane_data_id = lane_data_id;
road.lane_data_id = lane_data_to_id.ConcurrentFindOrAdd(key);
};
if (!lane_data.empty() && lane_data.front().tag == TurnLaneType::uturn)