Skip to content

Commit c40f12c

Browse files
committed
Merge branch 'master' of https://github.com/valhalla/thor into gdg
2 parents 1c58c7b + d88b963 commit c40f12c

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

conf

Submodule conf updated from 3f399f3 to acea525

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ AX_BOOST_THREAD
4040
AX_BOOST_FILESYSTEM
4141

4242
# check pkg-config dependencies
43-
PKG_CHECK_MODULES([DEPS], [protobuf >= 2.4.0 libzmq >= 4.0 libprime_server >= 0.1.1])
43+
PKG_CHECK_MODULES([DEPS], [protobuf >= 2.4.0 libzmq >= 4.0 libprime_server >= 0.1.2])
4444

4545
# optionally enable coverage information
4646
CHECK_COVERAGE

scripts/install_service_deps.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ set -e
33

44
# grab the latest zmq library:
55
rm -rf libzmq
6-
git clone --depth=1 --recurse-submodules --single-branch --branch=master https://github.com/zeromq/libzmq.git
6+
git clone --recurse-submodules --single-branch --branch=master https://github.com/zeromq/libzmq.git
77
pushd libzmq
8+
git checkout b3f2acf7d625daef65d37ffa00dfed753cf2387b
89
./autogen.sh
910
./configure --without-libsodium --without-documentation
1011
make -j4

src/thor/pathalgorithm.cc

+6-11
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ PathAlgorithm::PathAlgorithm()
9999
edgelabel_index_(0),
100100
adjacencylist_(nullptr),
101101
edgestatus_(nullptr),
102+
walking_distance_(0),
102103
best_destination_{kInvalidLabel, Cost(std::numeric_limits<float>::max(), 0.0f)} {
103104
edgelabels_.reserve(kInitialEdgeLabelCount);
104105
}
@@ -155,7 +156,7 @@ void PathAlgorithm::Init(const PointLL& origll, const PointLL& destll,
155156
hierarchy_limits_ = costing->GetHierarchyLimits();
156157
}
157158

158-
// Calculate best path.
159+
// Calculate best path. This method is single mode, no time dependency.
159160
std::vector<PathInfo> PathAlgorithm::GetBestPath(const PathLocation& origin,
160161
const PathLocation& destination, GraphReader& graphreader,
161162
const std::shared_ptr<DynamicCost>& costing) {
@@ -165,7 +166,6 @@ std::vector<PathInfo> PathAlgorithm::GetBestPath(const PathLocation& origin,
165166
costing->GetFilter());
166167

167168
// Check for trivial path
168-
// TODO -currently mode is the same along entire path.
169169
mode_ = costing->travelmode();
170170
auto trivial_id = trivial(origin, dest);
171171
if (trivial_id.Is_Valid()) {
@@ -291,10 +291,6 @@ std::vector<PathInfo> PathAlgorithm::GetBestPath(const PathLocation& origin,
291291
costing->EdgeCost(directededge, nodeinfo->density()) +
292292
costing->TransitionCost(directededge, nodeinfo, pred);
293293

294-
// Update walking distance
295-
walking_distance_ = (mode_ == TravelMode::kPedestrian) ?
296-
pred.walking_distance() + directededge->length() : 0;
297-
298294
// Check if edge is temporarily labeled and this path has less cost. If
299295
// less cost the predecessor is updated and the sort cost is decremented
300296
// by the difference in real cost (A* heuristic doesn't change)
@@ -315,7 +311,7 @@ std::vector<PathInfo> PathAlgorithm::GetBestPath(const PathLocation& origin,
315311
// Add edge label, add to the adjacency list and set edge status
316312
edgelabels_.emplace_back(predindex, edgeid, directededge,
317313
newcost, sortcost, dist, directededge->restrictions(),
318-
directededge->opp_local_idx(), mode_, walking_distance_);
314+
directededge->opp_local_idx(), mode_);
319315
adjacencylist_->Add(edgelabel_index_, sortcost);
320316
edgestatus_->Set(edgeid, kTemporary, edgelabel_index_);
321317
edgelabel_index_++;
@@ -628,8 +624,7 @@ void PathAlgorithm::CheckIfLowerCostPath(const uint32_t idx,
628624
if (dc > 0) {
629625
float oldsortcost = edgelabels_[idx].sortcost();
630626
float newsortcost = oldsortcost - dc;
631-
edgelabels_[idx].Update(predindex, newcost, newsortcost,
632-
walking_distance_);
627+
edgelabels_[idx].Update(predindex, newcost, newsortcost);
633628
adjacencylist_->DecreaseCost(idx, newsortcost, oldsortcost);
634629
}
635630
}
@@ -651,7 +646,7 @@ void PathAlgorithm::HandleTransitionEdge(const uint32_t level,
651646
// predecessor information. Transition edges have no length.
652647
edgelabels_.emplace_back(predindex, edgeid,
653648
edge, pred.cost(), pred.sortcost(), pred.distance(),
654-
pred.restrictions(), pred.opp_local_idx(), mode_, 0);
649+
pred.restrictions(), pred.opp_local_idx(), mode_);
655650

656651
// Add to the adjacency list and set edge status
657652
adjacencylist_->Add(edgelabel_index_, pred.sortcost());
@@ -703,7 +698,7 @@ void PathAlgorithm::SetOrigin(GraphReader& graphreader,
703698
// to invalid to indicate the origin of the path.
704699
edgelabels_.emplace_back(kInvalidLabel, edgeid,
705700
directededge, cost, sortcost, dist, 0,
706-
directededge->opp_local_idx(), mode_, 0);
701+
directededge->opp_local_idx(), mode_);
707702
adjacencylist_->Add(edgelabel_index_, sortcost);
708703
edgestatus_->Set(edgeid, kTemporary, edgelabel_index_);
709704
edgelabel_index_++;

0 commit comments

Comments
 (0)