Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to write turn lookups and read turn penalty files #2306

Merged
merged 1 commit into from
Apr 29, 2016

Conversation

lbud
Copy link
Member

@lbud lbud commented Apr 23, 2016

Reopened from #2291.

@lbud lbud force-pushed the 1830_turn_penalties branch from c550171 to bda253e Compare April 23, 2016 00:56
@lbud
Copy link
Member Author

lbud commented Apr 23, 2016

k @danpat @TheMarex @MoKob and/or @daniel-j-h 🌴 have at it

isCompressed
? m_node_info_list[m_compressed_edge_container.GetLastEdgeSourceID(
edge_from_u)]
: m_node_info_list[node_u];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behaviour here looks right, but I think the wording could be changed. I think if I were to come back to this in a few months, isCompressed and ContainsCompressedGeometries might confuse me, as technically, all edges are in the CompressedGeometryContainer.

How about isTrivial and isTrivial(), and the some comments in the CompressdGeometryContainer to explain what Trivial means in this context.

@lbud lbud force-pushed the 1830_turn_penalties branch from 7676bf0 to 989297a Compare April 25, 2016 18:43
@lbud
Copy link
Member Author

lbud commented Apr 25, 2016

Added a few comments for clarity, replaced the removed assertions, renamed the new compressed geometry fns/vars to isTrivial/IsTrivial(), and rebased on master. As long as #2306 (comment) is okay I think this is ready — 🚦✅ and I'll squash and merge.

@TheMarex
Copy link
Member

@lbud tests on travis seem to be failing. Otherwise 👍 for merging if that is fixed.

// node to the first turn would be the same as from end to end of a segment,
// which is obviously incorrect and not ideal...
unpacked_path.front().duration_until_turn =
std::max(unpacked_path.front().duration_until_turn - source_weight, 1);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheMarex would love another set of 👀 on this — it feels like maybe sort of a hacky solution to potentially negative edge durations, but… ??
cc @danpat

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this explains why the test fails above. If the phantom node snapps to a segment end point the result of this used to be 0. using 0 instead of 1 here should yield the expected behavior.

@lbud
Copy link
Member Author

lbud commented Apr 27, 2016

Travis tests were failing because I was testing a debug assertion in cucumber, so all release builds weren't erroring where I expected they should — which exposed the issue that we really needed to catch any negative edge weight regardless of build type, hence 663c28e. This raised some additional questions which I've added in comments here.

@TheMarex
Copy link
Member

@lbud can you rebase again on master? Seems like the travis breakages are mostly due to me accidentally breaking master.

@lbud lbud force-pushed the 1830_turn_penalties branch from cac91b0 to 97ffd5d Compare April 27, 2016 23:12
@lbud
Copy link
Member Author

lbud commented Apr 27, 2016

👌 @TheMarex just rebased after renaming original_node_count to compressed_edge_nodes

@lbud lbud force-pushed the 1830_turn_penalties branch from 77cf1b4 to 410661b Compare April 28, 2016 16:18
@lbud lbud force-pushed the 1830_turn_penalties branch from 784dbd3 to b89164c Compare April 28, 2016 20:14
@lbud
Copy link
Member Author

lbud commented Apr 28, 2016

Just forced pushed after squash/rebase and then I'll merge once travis passes.

@lbud lbud merged commit b8f7569 into master Apr 29, 2016
@lbud lbud deleted the 1830_turn_penalties branch April 29, 2016 07:48
NodeID CompressedEdgeContainer::GetLastEdgeSourceID(const EdgeID edge_id) const
{
const auto &bucket = GetBucketReference(edge_id);
BOOST_ASSERT(bucket.size() >= 2);
BOOST_ASSERT(bucket.size() >= 1);
return bucket[bucket.size() - 2].node_id;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bucket.size() >=1 and access to bucket.size()-2 seems like a bad idea?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Derp. That might have been my ill-advised comment to consider that non-compressed geometries. Yes this should be 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants