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
@@ -65,12 +65,16 @@ const constexpr char *scenario_names[] = {"Simple",
class TurnLaneHandler
{
using UpgradableMutex = boost::interprocess::interprocess_upgradable_mutex;
using ScopedReaderLock = boost::interprocess::sharable_lock<UpgradableMutex>;
using ScopedWriterLock = boost::interprocess::scoped_lock<UpgradableMutex>;
public:
typedef std::vector<TurnLaneData> LaneDataVector;
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);
@@ -86,8 +90,8 @@ class TurnLaneHandler
// we need to be able to look at previous intersections to, in some cases, find the correct turn
// lanes for a turn
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;
@@ -10,6 +10,7 @@
#include <boost/functional/hash.hpp>
#include "util/concurrent_id_map.hpp"
#include "util/json_container.hpp"
#include "util/typedefs.hpp"
@@ -93,9 +94,9 @@ struct TurnLaneDescription_hash
}
};
typedef std::unordered_map<guidance::TurnLaneDescription,
LaneDescriptionID,
guidance::TurnLaneDescription_hash>
typedef util::ConcurrentIDMap<guidance::TurnLaneDescription,
LaneDescriptionID,
guidance::TurnLaneDescription_hash>
LaneDescriptionMap;
} // guidance