set up for computing durations while unpacking them

copy dummy cache over

implement retrievePackedPathFromSearchSpace

calculate packed_path_from_source_to_middle

debugging the retrievePackedPathFromSearchSpace function implementation

adding in packed_path_from_source_to_middle

cache is partway working

unpack path and get duration that way

the computeDurationForEdge method

comment out cache

clean up the code

move vector creation and allocation to outside of loop

hack to not return vectors on facade.GetUncompressedForwardDurations and facade.GetUncompressedReverseDurations

clean up hack

add exclude_index to cache key

clearing cache with timestamp

rebase against vectors->range pr

swapped out unordered_map cache with a boost_lru implementation

calculation for cache size

cleaned up comment about cache size calculations

unit tests

cache uses unsigned char for exclude index

clean up cache and unit tests
This commit is contained in:
Kajari Ghosh 2018-02-12 11:10:17 -05:00
parent ca123790bc
commit 4563d44180
4 changed files with 5 additions and 2 deletions

View File

@ -71,6 +71,7 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
std::size_t index = std::size_t index =
std::stoi(exclude_prefix.substr(index_begin + 1, exclude_prefix.size())); std::stoi(exclude_prefix.substr(index_begin + 1, exclude_prefix.size()));
BOOST_ASSERT(index >= 0 && index < facades.size()); BOOST_ASSERT(index >= 0 && index < facades.size());
facades[index] = facades[index] =
std::make_shared<const Facade>(allocator, metric_name, index, timestamp); std::make_shared<const Facade>(allocator, metric_name, index, timestamp);
} }

View File

@ -177,11 +177,11 @@ void annotatePath(const FacadeT &facade,
const auto geometry_index = facade.GetGeometryIndex(node_id); const auto geometry_index = facade.GetGeometryIndex(node_id);
get_segment_geometry(geometry_index); get_segment_geometry(geometry_index);
BOOST_ASSERT(id_vector.size() > 0); BOOST_ASSERT(id_vector.size() > 0);
BOOST_ASSERT(datasource_vector.size() > 0); BOOST_ASSERT(datasource_vector.size() > 0);
BOOST_ASSERT(weight_vector.size() + 1 == id_vector.size()); BOOST_ASSERT(weight_vector.size() + 1 == id_vector.size());
BOOST_ASSERT(duration_vector.size() + 1 == id_vector.size()); BOOST_ASSERT(duration_vector.size() + 1 == id_vector.size());
const bool is_first_segment = unpacked_path.empty(); const bool is_first_segment = unpacked_path.empty();
const std::size_t start_index = const std::size_t start_index =

View File

@ -2,7 +2,10 @@
#define UNPACKING_CACHE_HPP #define UNPACKING_CACHE_HPP
#include <boost/optional/optional_io.hpp> #include <boost/optional/optional_io.hpp>
<<<<<<< HEAD
#include <boost/thread.hpp> #include <boost/thread.hpp>
=======
>>>>>>> 68659b398... set up for computing durations while unpacking them
#include "../../third_party/compute_detail/lru_cache.hpp" #include "../../third_party/compute_detail/lru_cache.hpp"
#include "util/typedefs.hpp" #include "util/typedefs.hpp"

View File

@ -73,7 +73,6 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
{ {
return WeightReverseRange(GetUncompressedForwardWeights(id)); return WeightReverseRange(GetUncompressedForwardWeights(id));
} }
DurationForwardRange GetUncompressedForwardDurations(const EdgeID /*id*/) const override DurationForwardRange GetUncompressedForwardDurations(const EdgeID /*id*/) const override
{ {
static std::uint64_t data[] = {1, 2, 3}; static std::uint64_t data[] = {1, 2, 3};