{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/89962060","pull_request_review_id":10488360,"id":89962060,"diff_hunk":"@@ -11,22 +14,513 @@ IndexGraph::IndexGraph(unique_ptr<GeometryLoader> loader, shared_ptr<EdgeEstimat\n   ASSERT(m_estimator, ());\n }\n \n-void IndexGraph::GetEdgeList(Joint::Id jointId, bool isOutgoing, vector<JointEdge> & edges)\n+void IndexGraph::GetEdgeList(Joint::Id jointId, bool isOutgoing, bool graphWithoutRestrictions,\n+                             vector<JointEdge> & edges)\n {\n-  m_jointIndex.ForEachPoint(jointId, [this, &edges, isOutgoing](RoadPoint const & rp) {\n-    GetNeighboringEdges(rp, isOutgoing, edges);\n+  m_jointIndex.ForEachPoint(jointId, [&](RoadPoint const & rp) {\n+    GetNeighboringEdges(rp, isOutgoing, graphWithoutRestrictions, edges);\n   });\n }\n \n+m2::PointD const & IndexGraph::GetPoint(RoadPoint const & rp)\n+{\n+  RoadGeometry const & road = GetRoad(rp.GetFeatureId());\n+  CHECK_LESS(rp.GetPointId(), road.GetPointsCount(), ());\n+  return road.GetPoint(rp.GetPointId());\n+}\n+\n m2::PointD const & IndexGraph::GetPoint(Joint::Id jointId)\n {\n-  return m_geometry.GetPoint(m_jointIndex.GetPoint(jointId));\n+  return GetPoint(m_jointIndex.GetPoint(jointId));\n }\n \n+double IndexGraph::GetSpeed(RoadPoint const & rp) { return GetRoad(rp.GetFeatureId()).GetSpeed(); }\n+\n+void IndexGraph::Build(uint32_t numJoints) { m_jointIndex.Build(m_roadIndex, numJoints); }\n+\n void IndexGraph::Import(vector<Joint> const & joints)\n {\n   m_roadIndex.Import(joints);\n-  m_jointIndex.Build(m_roadIndex, joints.size());\n+  Build(joints.size());\n+}\n+\n+void IndexGraph::GetSingleFeaturePath(RoadPoint from, RoadPoint to,\n+                                      vector<RoadPoint> & singleFeaturePath)","path":"routing/index_graph.cpp","position":52,"original_position":52,"commit_id":"712dfd35daf6cd4a47a63fbe56b02c9231f5ca77","original_commit_id":"4a836a6cf5c5f874dbd9f945d23fe6e1c6547260","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars.githubusercontent.com/u/1768114?v=3","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2016-11-29T08:44:41Z","updated_at":"2016-11-29T08:44:41Z","html_url":"https://github.com/mapsme/omim/pull/4817#discussion_r89962060","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/4817","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/89962060"},"html":{"href":"https://github.com/mapsme/omim/pull/4817#discussion_r89962060"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4817"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/4817","id":95372509,"html_url":"https://github.com/mapsme/omim/pull/4817","diff_url":"https://github.com/mapsme/omim/pull/4817.diff","patch_url":"https://github.com/mapsme/omim/pull/4817.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/4817","number":4817,"state":"open","locked":false,"title":"[routing] Applying restrictions on index graph","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars.githubusercontent.com/u/1768114?v=3","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"body":"Данный PR реализовывает наложение restriction на index graph. В не тривильных случаях это одно из двух преобразований графа: \r\nRestriction type Only\r\n```\r\n  // It's possible to move only from one segment to another in case of any number of ingoing and\r\n  // outgoing edges.\r\n  // The idea is to tranform the navigation graph for every non-degenerate case as it's shown below.\r\n  // At the picture below a restriction for permission moving only from 6 to O to 3 is shown.\r\n  // So to implement it it's necessary to remove (disable) an edge 6-O and add feature (edge) 4-N-3.\r\n  // Adding N is important for a route recovery stage. (The geometry of O will be copied to N.)\r\n  //\r\n  // 1       2       3                     1       2       3\r\n  // *       *       *                     *       *       *\r\n  //  ↖     ^     ↗                        ↖     ^     ↗^\r\n  //    ↖   |   ↗                            ↖   |   ↗  |\r\n  //      ↖ | ↗                                ↖ | ↗    |\r\n  //         *  O             ==>                  *  O    * N\r\n  //      ↗ ^ ↖                                 ↗^       ^\r\n  //    ↗   |   ↖                             ↗  |       |\r\n  //  ↗     |     ↖                         ↗    |       |\r\n  // *       *       *                     *       *       *\r\n  // 4       5       6                     4       5       6\r\n  //\r\n  // In case of this transformation the following edge mapping happens:\r\n  // 6-O -> 6-N\r\n  // O-3 -> O-3; N-3\r\n```\r\n\r\nRestriction type No\r\n```\r\n  // Prohibition of moving from one segment to another in case of any number of ingoing and outgoing\r\n  // edges.\r\n  // The idea is to transform the navigation graph for every non-degenerate case as it's shown below.\r\n  // At the picture below a restriction for prohibition moving from 4 to O to 3 is shown.\r\n  // So to implement it it's necessary to remove (disable) an edge 4-O and add features (edges)\r\n  // 4-N-1 and N-2.\r\n  //\r\n  // 1       2       3                     1       2       3\r\n  // *       *       *                     *       *       *\r\n  //  ↖     ^     ↗                       ^↖   ↗^     ↗\r\n  //    ↖   |   ↗                         |  ↖   |   ↗\r\n  //      ↖ | ↗                           |↗   ↖| ↗\r\n  //         *  O             ==>        N *       *  O\r\n  //      ↗ ^ ↖                           ^       ^ ↖\r\n  //    ↗   |   ↖                         |       |   ↖\r\n  //  ↗     |     ↖                       |       |     ↖\r\n  // *       *       *                     *       *       *\r\n  // 4       5       6                     4       5       6\r\n  //\r\n  // In case of this transformation the following edge mapping happens:\r\n  // 4-O -> 4-N\r\n  // O-1 -> O-1; N-1\r\n  // O-2 -> 0-2; N-2\r\n```\r\n\r\nВ данном PR я планирую еще доделать наложение пересекающихся рестрикшинов (входная дуга одного совпадает с выходной дугой другого). И добавить тестов.\r\n\r\nНо это сильно не повлияет на уже написанный код. Прошу всех заинтересованных коллег приступать к ревью.\r\n\r\n@ygorshenin @mpimenov @dobriy-eeh PTAL\r\n","created_at":"2016-11-26T14:06:55Z","updated_at":"2016-11-29T08:44:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83e3b874210444a3e5cfa9e00ff82f7a2509627f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/4817/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/4817/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/4817/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/712dfd35daf6cd4a47a63fbe56b02c9231f5ca77","head":{"label":"mapsme:master-applying-restrictions","ref":"master-applying-restrictions","sha":"712dfd35daf6cd4a47a63fbe56b02c9231f5ca77","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-11-29T07:18:07Z","pushed_at":"2016-11-29T08:41:51Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2913624,"stargazers_count":2051,"watchers_count":2051,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":408,"mirror_url":null,"open_issues_count":370,"forks":408,"open_issues":370,"watchers":2051,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"9d72d1a96959469ebd030b05abd989c60bde08ca","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-11-29T07:18:07Z","pushed_at":"2016-11-29T08:41:51Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2913624,"stargazers_count":2051,"watchers_count":2051,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":408,"mirror_url":null,"open_issues_count":370,"forks":408,"open_issues":370,"watchers":2051,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4817"},"html":{"href":"https://github.com/mapsme/omim/pull/4817"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/4817"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/4817/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4817/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4817/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/712dfd35daf6cd4a47a63fbe56b02c9231f5ca77"}}}}
{"actor":{"display_login":"bykoianko"}}