{"action":"created","comment":{"url":"https://api.github.com/repos/CanalTP/navitia/pulls/comments/42142737","id":42142737,"diff_hunk":"@@ -130,14 +132,72 @@ void Thermometer::generate_thermometer(const type::Route* route) {\n     generate_thermometer(std::vector<vector_idx>(stop_point_lists.begin(), stop_point_lists.end()));\n }\n \n+// Define types for next function 'generate_topological_thermometer'\n+struct VertexProperties\n+{\n+    type::idx_t idx;\n+    VertexProperties() : idx(0) {}\n+    VertexProperties(type::idx_t const& i): idx(i) {}\n+};\n+typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_bundle_t, VertexProperties> > Graph;\n+typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;\n+\n+// Generate an topologicaly exact thermometer\n+// return false if topological sort fail (because of a cycle)\n+// return true if succeed\n+bool Thermometer::generate_topological_thermometer(const std::vector<vector_idx> &stop_point_lists) {\n+\n+    Graph stop_point_graph;\n+    std::map<type::idx_t, Vertex> vertex_map;\n+    for (const auto& v: stop_point_list) {\n+        bool first = true;\n+        Vertex previous_vx;\n+        for (auto sp : v) {\n+            Vertex current_vx;\n+\n+            // We don't add a vertex twice\n+            auto it = vertex_map.find(sp);\n+            if (it == vertex_map.end()) {\n+                current_vx = boost::add_vertex(VertexProperties(sp), stop_point_graph);\n+                vertex_map[sp] = current_vx;\n+            } else {\n+\t        current_vx = it->second;\n+\t    }\n+\t    if (!first) {","path":"source/time_tables/thermometer.cpp","position":112,"original_position":111,"commit_id":"a4720bd1f8c0fc20db8a176875cb8a99aece3ac3","original_commit_id":"66ea7f5e6f52f82c5a0caa3685122f2d0bfd37d1","user":{"login":"xlqian","id":6093486,"avatar_url":"https://avatars.githubusercontent.com/u/6093486?v=3","gravatar_id":"","url":"https://api.github.com/users/xlqian","html_url":"https://github.com/xlqian","followers_url":"https://api.github.com/users/xlqian/followers","following_url":"https://api.github.com/users/xlqian/following{/other_user}","gists_url":"https://api.github.com/users/xlqian/gists{/gist_id}","starred_url":"https://api.github.com/users/xlqian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlqian/subscriptions","organizations_url":"https://api.github.com/users/xlqian/orgs","repos_url":"https://api.github.com/users/xlqian/repos","events_url":"https://api.github.com/users/xlqian/events{/privacy}","received_events_url":"https://api.github.com/users/xlqian/received_events","type":"User","site_admin":false},"body":"To avoid creating a branch you may call std::slice","created_at":"2015-10-15T15:54:20Z","updated_at":"2015-10-15T15:54:20Z","html_url":"https://github.com/CanalTP/navitia/pull/1211#discussion_r42142737","pull_request_url":"https://api.github.com/repos/CanalTP/navitia/pulls/1211","_links":{"self":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/comments/42142737"},"html":{"href":"https://github.com/CanalTP/navitia/pull/1211#discussion_r42142737"},"pull_request":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/1211"}}},"pull_request":{"url":"https://api.github.com/repos/CanalTP/navitia/pulls/1211","id":47791231,"html_url":"https://github.com/CanalTP/navitia/pull/1211","diff_url":"https://github.com/CanalTP/navitia/pull/1211.diff","patch_url":"https://github.com/CanalTP/navitia/pull/1211.patch","issue_url":"https://api.github.com/repos/CanalTP/navitia/issues/1211","number":1211,"state":"open","locked":false,"title":"Pr thermometer algorithm issue 1159","user":{"login":"xavierraffin","id":1170030,"avatar_url":"https://avatars.githubusercontent.com/u/1170030?v=3","gravatar_id":"","url":"https://api.github.com/users/xavierraffin","html_url":"https://github.com/xavierraffin","followers_url":"https://api.github.com/users/xavierraffin/followers","following_url":"https://api.github.com/users/xavierraffin/following{/other_user}","gists_url":"https://api.github.com/users/xavierraffin/gists{/gist_id}","starred_url":"https://api.github.com/users/xavierraffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavierraffin/subscriptions","organizations_url":"https://api.github.com/users/xavierraffin/orgs","repos_url":"https://api.github.com/users/xavierraffin/repos","events_url":"https://api.github.com/users/xavierraffin/events{/privacy}","received_events_url":"https://api.github.com/users/xavierraffin/received_events","type":"User","site_admin":false},"body":"Fix issue https://github.com/CanalTP/navitia/issues/1159\r\n\r\nI did it accordingly with TeXitoi proposal.","created_at":"2015-10-15T14:11:24Z","updated_at":"2015-10-15T15:54:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e95a1c9a492d3c674bb7085beb6c63862133842b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CanalTP/navitia/pulls/1211/commits","review_comments_url":"https://api.github.com/repos/CanalTP/navitia/pulls/1211/comments","review_comment_url":"https://api.github.com/repos/CanalTP/navitia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CanalTP/navitia/issues/1211/comments","statuses_url":"https://api.github.com/repos/CanalTP/navitia/statuses/a4720bd1f8c0fc20db8a176875cb8a99aece3ac3","head":{"label":"Tisseo:PR-thermometer-algorithm-issue-1159","ref":"PR-thermometer-algorithm-issue-1159","sha":"a4720bd1f8c0fc20db8a176875cb8a99aece3ac3","user":{"login":"Tisseo","id":5136514,"avatar_url":"https://avatars.githubusercontent.com/u/5136514?v=3","gravatar_id":"","url":"https://api.github.com/users/Tisseo","html_url":"https://github.com/Tisseo","followers_url":"https://api.github.com/users/Tisseo/followers","following_url":"https://api.github.com/users/Tisseo/following{/other_user}","gists_url":"https://api.github.com/users/Tisseo/gists{/gist_id}","starred_url":"https://api.github.com/users/Tisseo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tisseo/subscriptions","organizations_url":"https://api.github.com/users/Tisseo/orgs","repos_url":"https://api.github.com/users/Tisseo/repos","events_url":"https://api.github.com/users/Tisseo/events{/privacy}","received_events_url":"https://api.github.com/users/Tisseo/received_events","type":"Organization","site_admin":false},"repo":{"id":26804325,"name":"navitia","full_name":"Tisseo/navitia","owner":{"login":"Tisseo","id":5136514,"avatar_url":"https://avatars.githubusercontent.com/u/5136514?v=3","gravatar_id":"","url":"https://api.github.com/users/Tisseo","html_url":"https://github.com/Tisseo","followers_url":"https://api.github.com/users/Tisseo/followers","following_url":"https://api.github.com/users/Tisseo/following{/other_user}","gists_url":"https://api.github.com/users/Tisseo/gists{/gist_id}","starred_url":"https://api.github.com/users/Tisseo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tisseo/subscriptions","organizations_url":"https://api.github.com/users/Tisseo/orgs","repos_url":"https://api.github.com/users/Tisseo/repos","events_url":"https://api.github.com/users/Tisseo/events{/privacy}","received_events_url":"https://api.github.com/users/Tisseo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tisseo/navitia","description":"The REST API to build cool stuff with public transport","fork":true,"url":"https://api.github.com/repos/Tisseo/navitia","forks_url":"https://api.github.com/repos/Tisseo/navitia/forks","keys_url":"https://api.github.com/repos/Tisseo/navitia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tisseo/navitia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tisseo/navitia/teams","hooks_url":"https://api.github.com/repos/Tisseo/navitia/hooks","issue_events_url":"https://api.github.com/repos/Tisseo/navitia/issues/events{/number}","events_url":"https://api.github.com/repos/Tisseo/navitia/events","assignees_url":"https://api.github.com/repos/Tisseo/navitia/assignees{/user}","branches_url":"https://api.github.com/repos/Tisseo/navitia/branches{/branch}","tags_url":"https://api.github.com/repos/Tisseo/navitia/tags","blobs_url":"https://api.github.com/repos/Tisseo/navitia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tisseo/navitia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tisseo/navitia/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tisseo/navitia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tisseo/navitia/statuses/{sha}","languages_url":"https://api.github.com/repos/Tisseo/navitia/languages","stargazers_url":"https://api.github.com/repos/Tisseo/navitia/stargazers","contributors_url":"https://api.github.com/repos/Tisseo/navitia/contributors","subscribers_url":"https://api.github.com/repos/Tisseo/navitia/subscribers","subscription_url":"https://api.github.com/repos/Tisseo/navitia/subscription","commits_url":"https://api.github.com/repos/Tisseo/navitia/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tisseo/navitia/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tisseo/navitia/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tisseo/navitia/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tisseo/navitia/contents/{+path}","compare_url":"https://api.github.com/repos/Tisseo/navitia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tisseo/navitia/merges","archive_url":"https://api.github.com/repos/Tisseo/navitia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tisseo/navitia/downloads","issues_url":"https://api.github.com/repos/Tisseo/navitia/issues{/number}","pulls_url":"https://api.github.com/repos/Tisseo/navitia/pulls{/number}","milestones_url":"https://api.github.com/repos/Tisseo/navitia/milestones{/number}","notifications_url":"https://api.github.com/repos/Tisseo/navitia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tisseo/navitia/labels{/name}","releases_url":"https://api.github.com/repos/Tisseo/navitia/releases{/id}","created_at":"2014-11-18T10:37:15Z","updated_at":"2015-03-06T12:25:08Z","pushed_at":"2015-10-15T15:52:58Z","git_url":"git://github.com/Tisseo/navitia.git","ssh_url":"git@github.com:Tisseo/navitia.git","clone_url":"https://github.com/Tisseo/navitia.git","svn_url":"https://github.com/Tisseo/navitia","homepage":"http://www.navitia.io","size":25601,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"CanalTP:dev","ref":"dev","sha":"30af99062015454e943d0555d0e3009f776fa04a","user":{"login":"CanalTP","id":2743985,"avatar_url":"https://avatars.githubusercontent.com/u/2743985?v=3","gravatar_id":"","url":"https://api.github.com/users/CanalTP","html_url":"https://github.com/CanalTP","followers_url":"https://api.github.com/users/CanalTP/followers","following_url":"https://api.github.com/users/CanalTP/following{/other_user}","gists_url":"https://api.github.com/users/CanalTP/gists{/gist_id}","starred_url":"https://api.github.com/users/CanalTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanalTP/subscriptions","organizations_url":"https://api.github.com/users/CanalTP/orgs","repos_url":"https://api.github.com/users/CanalTP/repos","events_url":"https://api.github.com/users/CanalTP/events{/privacy}","received_events_url":"https://api.github.com/users/CanalTP/received_events","type":"Organization","site_admin":false},"repo":{"id":10797333,"name":"navitia","full_name":"CanalTP/navitia","owner":{"login":"CanalTP","id":2743985,"avatar_url":"https://avatars.githubusercontent.com/u/2743985?v=3","gravatar_id":"","url":"https://api.github.com/users/CanalTP","html_url":"https://github.com/CanalTP","followers_url":"https://api.github.com/users/CanalTP/followers","following_url":"https://api.github.com/users/CanalTP/following{/other_user}","gists_url":"https://api.github.com/users/CanalTP/gists{/gist_id}","starred_url":"https://api.github.com/users/CanalTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanalTP/subscriptions","organizations_url":"https://api.github.com/users/CanalTP/orgs","repos_url":"https://api.github.com/users/CanalTP/repos","events_url":"https://api.github.com/users/CanalTP/events{/privacy}","received_events_url":"https://api.github.com/users/CanalTP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CanalTP/navitia","description":"The REST API to build cool stuff with public transport","fork":false,"url":"https://api.github.com/repos/CanalTP/navitia","forks_url":"https://api.github.com/repos/CanalTP/navitia/forks","keys_url":"https://api.github.com/repos/CanalTP/navitia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CanalTP/navitia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CanalTP/navitia/teams","hooks_url":"https://api.github.com/repos/CanalTP/navitia/hooks","issue_events_url":"https://api.github.com/repos/CanalTP/navitia/issues/events{/number}","events_url":"https://api.github.com/repos/CanalTP/navitia/events","assignees_url":"https://api.github.com/repos/CanalTP/navitia/assignees{/user}","branches_url":"https://api.github.com/repos/CanalTP/navitia/branches{/branch}","tags_url":"https://api.github.com/repos/CanalTP/navitia/tags","blobs_url":"https://api.github.com/repos/CanalTP/navitia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CanalTP/navitia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CanalTP/navitia/git/refs{/sha}","trees_url":"https://api.github.com/repos/CanalTP/navitia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CanalTP/navitia/statuses/{sha}","languages_url":"https://api.github.com/repos/CanalTP/navitia/languages","stargazers_url":"https://api.github.com/repos/CanalTP/navitia/stargazers","contributors_url":"https://api.github.com/repos/CanalTP/navitia/contributors","subscribers_url":"https://api.github.com/repos/CanalTP/navitia/subscribers","subscription_url":"https://api.github.com/repos/CanalTP/navitia/subscription","commits_url":"https://api.github.com/repos/CanalTP/navitia/commits{/sha}","git_commits_url":"https://api.github.com/repos/CanalTP/navitia/git/commits{/sha}","comments_url":"https://api.github.com/repos/CanalTP/navitia/comments{/number}","issue_comment_url":"https://api.github.com/repos/CanalTP/navitia/issues/comments{/number}","contents_url":"https://api.github.com/repos/CanalTP/navitia/contents/{+path}","compare_url":"https://api.github.com/repos/CanalTP/navitia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CanalTP/navitia/merges","archive_url":"https://api.github.com/repos/CanalTP/navitia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CanalTP/navitia/downloads","issues_url":"https://api.github.com/repos/CanalTP/navitia/issues{/number}","pulls_url":"https://api.github.com/repos/CanalTP/navitia/pulls{/number}","milestones_url":"https://api.github.com/repos/CanalTP/navitia/milestones{/number}","notifications_url":"https://api.github.com/repos/CanalTP/navitia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CanalTP/navitia/labels{/name}","releases_url":"https://api.github.com/repos/CanalTP/navitia/releases{/id}","created_at":"2013-06-19T15:34:30Z","updated_at":"2015-10-11T20:06:49Z","pushed_at":"2015-10-15T15:52:58Z","git_url":"git://github.com/CanalTP/navitia.git","ssh_url":"git@github.com:CanalTP/navitia.git","clone_url":"https://github.com/CanalTP/navitia.git","svn_url":"https://github.com/CanalTP/navitia","homepage":"http://www.navitia.io","size":36452,"stargazers_count":128,"watchers_count":128,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":20,"forks":41,"open_issues":20,"watchers":128,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/1211"},"html":{"href":"https://github.com/CanalTP/navitia/pull/1211"},"issue":{"href":"https://api.github.com/repos/CanalTP/navitia/issues/1211"},"comments":{"href":"https://api.github.com/repos/CanalTP/navitia/issues/1211/comments"},"review_comments":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/1211/comments"},"review_comment":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/1211/commits"},"statuses":{"href":"https://api.github.com/repos/CanalTP/navitia/statuses/a4720bd1f8c0fc20db8a176875cb8a99aece3ac3"}}}}