{"action":"created","comment":{"url":"https://api.github.com/repos/frs69wq/log2sim/pulls/comments/71477882","id":71477882,"diff_hunk":"@@ -156,68 +107,62 @@ for(j in 1:nrow(gate_db)){\n         round(gate_downloads[(j-1)*3+k-1,]$Download_End)\n     } \n     gate_downloads[(j-1)*3+k,]$Download_End = \n-      gate_downloads[(j-1)*3+k,]$Download_Start + round(gate_downloads[(j-1)*3+k,]$Time/1000)\n+      gate_downloads[(j-1)*3+k,]$Download_Start + round(gate_downloads[(j-1)*3+k,]$Time)\n   }\n }\n \n-gate_downloads$Bandwidth <-gate_downloads$FileSize/(pmax(0.1,(gate_downloads$Time-1000)))\n-gate_downloads$Time <- gate_downloads$Time/1000\n-\n gate_downloads$concurrency <- 1\n \n-# sampling 20 points to estimate the concurrency of each transfer\n-n_point <- 20\n+# for merge download trqnsfers, the concurrency is considered as 1\n+merge_downloads$concurrency <- 1\n+\n+\n+\n+# divide each transfer into 50 intervals to estimate the nominal bandwidth (only for Gate downloads)\n+n_interval <- 50\n for(i in 1:nrow(gate_downloads)){\n-  tmp <- vector(mode=\"numeric\", length=n_point)\n-  step <- (gate_downloads[i,]$Download_End - gate_downloads[i,]$Download_Start)/n_point\n-  for(s in 1: n_point){\n-    tmp[s] <- nrow(subset(gate_downloads, SE_SITE == gate_downloads[i,]$SE_SITE\n+  conc <- vector(mode=\"numeric\", length=n_interval)\n+  step <- (gate_downloads[i,]$Download_End - gate_downloads[i,]$Download_Start)/n_interval\n+  for(s in 1: n_interval){\n+    conc[s] <- nrow(subset(gate_downloads, SE_SITE == gate_downloads[i,]$SE_SITE\n                                          &FileSize == gate_downloads[i,]$FileSize\n                                          &Download_Start <= (step*(s-1)+gate_downloads[i,]$Download_Start)\n                                          &Download_End >= (step*(s-1)+gate_downloads[i,]$Download_Start)))\n   }\n-  # take the mean of concurrency of all sampling points\n-  if(mean(tmp) > 1){\n-    gate_downloads[i,]$concurrency <- mean(tmp)\n-  }\n-}\n \n-## function to find the concurrency of a link\n-## if the max is given by several transfers, the maximum concurrency is taken for this link.\n-Concurrency_link <- function(Bandwidth, concurrency){\n-  pos <- which(Bandwidth == max(Bandwidth))\n-  con <- concurrency[pos[1]]\n-  if(length(pos)>1){\n-    for(i in 2:length(pos)){\n-      if(concurrency[pos[i]]> con){\n-        con <- concurrency[pos[i]]\n-      }\n-    }\n-  }\n-  return (con)\n+  tmp <- 1/conc\n+  gate_downloads[i,]$concurrency <- n_interval/sum(tmp)","path":"platform_generator.R","position":null,"original_position":154,"commit_id":"0de1dd35e3054deeae83ca11420c062ea3c5a964","original_commit_id":"0de1dd35e3054deeae83ca11420c062ea3c5a964","user":{"login":"frs69wq","id":2534712,"avatar_url":"https://avatars.githubusercontent.com/u/2534712?v=3","gravatar_id":"","url":"https://api.github.com/users/frs69wq","html_url":"https://github.com/frs69wq","followers_url":"https://api.github.com/users/frs69wq/followers","following_url":"https://api.github.com/users/frs69wq/following{/other_user}","gists_url":"https://api.github.com/users/frs69wq/gists{/gist_id}","starred_url":"https://api.github.com/users/frs69wq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frs69wq/subscriptions","organizations_url":"https://api.github.com/users/frs69wq/orgs","repos_url":"https://api.github.com/users/frs69wq/repos","events_url":"https://api.github.com/users/frs69wq/events{/privacy}","received_events_url":"https://api.github.com/users/frs69wq/received_events","type":"User","site_admin":false},"body":"I think that n_interval/sum(1/conc) should work too. No need for a temporary vector there","created_at":"2016-07-20T07:35:08Z","updated_at":"2016-07-20T07:35:08Z","html_url":"https://github.com/frs69wq/log2sim/pull/4#discussion_r71477882","pull_request_url":"https://api.github.com/repos/frs69wq/log2sim/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/frs69wq/log2sim/pulls/comments/71477882"},"html":{"href":"https://github.com/frs69wq/log2sim/pull/4#discussion_r71477882"},"pull_request":{"href":"https://api.github.com/repos/frs69wq/log2sim/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/frs69wq/log2sim/pulls/4","id":74917465,"html_url":"https://github.com/frs69wq/log2sim/pull/4","diff_url":"https://github.com/frs69wq/log2sim/pull/4.diff","patch_url":"https://github.com/frs69wq/log2sim/pull/4.patch","issue_url":"https://api.github.com/repos/frs69wq/log2sim/issues/4","number":4,"state":"open","locked":false,"title":"add the code to apply a corrective factor for bandwidth in platform_g…","user":{"login":"anchenchai","id":10548591,"avatar_url":"https://avatars.githubusercontent.com/u/10548591?v=3","gravatar_id":"","url":"https://api.github.com/users/anchenchai","html_url":"https://github.com/anchenchai","followers_url":"https://api.github.com/users/anchenchai/followers","following_url":"https://api.github.com/users/anchenchai/following{/other_user}","gists_url":"https://api.github.com/users/anchenchai/gists{/gist_id}","starred_url":"https://api.github.com/users/anchenchai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anchenchai/subscriptions","organizations_url":"https://api.github.com/users/anchenchai/orgs","repos_url":"https://api.github.com/users/anchenchai/repos","events_url":"https://api.github.com/users/anchenchai/events{/privacy}","received_events_url":"https://api.github.com/users/anchenchai/received_events","type":"User","site_admin":false},"body":"the code for applying corrective factor of bandwidth.","created_at":"2016-06-23T08:52:25Z","updated_at":"2016-07-20T07:35:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da5842b261246ddc928106250925d3bd8b88a2f1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/frs69wq/log2sim/pulls/4/commits","review_comments_url":"https://api.github.com/repos/frs69wq/log2sim/pulls/4/comments","review_comment_url":"https://api.github.com/repos/frs69wq/log2sim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/frs69wq/log2sim/issues/4/comments","statuses_url":"https://api.github.com/repos/frs69wq/log2sim/statuses/0de1dd35e3054deeae83ca11420c062ea3c5a964","head":{"label":"frs69wq:chai","ref":"chai","sha":"0de1dd35e3054deeae83ca11420c062ea3c5a964","user":{"login":"frs69wq","id":2534712,"avatar_url":"https://avatars.githubusercontent.com/u/2534712?v=3","gravatar_id":"","url":"https://api.github.com/users/frs69wq","html_url":"https://github.com/frs69wq","followers_url":"https://api.github.com/users/frs69wq/followers","following_url":"https://api.github.com/users/frs69wq/following{/other_user}","gists_url":"https://api.github.com/users/frs69wq/gists{/gist_id}","starred_url":"https://api.github.com/users/frs69wq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frs69wq/subscriptions","organizations_url":"https://api.github.com/users/frs69wq/orgs","repos_url":"https://api.github.com/users/frs69wq/repos","events_url":"https://api.github.com/users/frs69wq/events{/privacy}","received_events_url":"https://api.github.com/users/frs69wq/received_events","type":"User","site_admin":false},"repo":{"id":45904310,"name":"log2sim","full_name":"frs69wq/log2sim","owner":{"login":"frs69wq","id":2534712,"avatar_url":"https://avatars.githubusercontent.com/u/2534712?v=3","gravatar_id":"","url":"https://api.github.com/users/frs69wq","html_url":"https://github.com/frs69wq","followers_url":"https://api.github.com/users/frs69wq/followers","following_url":"https://api.github.com/users/frs69wq/following{/other_user}","gists_url":"https://api.github.com/users/frs69wq/gists{/gist_id}","starred_url":"https://api.github.com/users/frs69wq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frs69wq/subscriptions","organizations_url":"https://api.github.com/users/frs69wq/orgs","repos_url":"https://api.github.com/users/frs69wq/repos","events_url":"https://api.github.com/users/frs69wq/events{/privacy}","received_events_url":"https://api.github.com/users/frs69wq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frs69wq/log2sim","description":"","fork":false,"url":"https://api.github.com/repos/frs69wq/log2sim","forks_url":"https://api.github.com/repos/frs69wq/log2sim/forks","keys_url":"https://api.github.com/repos/frs69wq/log2sim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frs69wq/log2sim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frs69wq/log2sim/teams","hooks_url":"https://api.github.com/repos/frs69wq/log2sim/hooks","issue_events_url":"https://api.github.com/repos/frs69wq/log2sim/issues/events{/number}","events_url":"https://api.github.com/repos/frs69wq/log2sim/events","assignees_url":"https://api.github.com/repos/frs69wq/log2sim/assignees{/user}","branches_url":"https://api.github.com/repos/frs69wq/log2sim/branches{/branch}","tags_url":"https://api.github.com/repos/frs69wq/log2sim/tags","blobs_url":"https://api.github.com/repos/frs69wq/log2sim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frs69wq/log2sim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frs69wq/log2sim/git/refs{/sha}","trees_url":"https://api.github.com/repos/frs69wq/log2sim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frs69wq/log2sim/statuses/{sha}","languages_url":"https://api.github.com/repos/frs69wq/log2sim/languages","stargazers_url":"https://api.github.com/repos/frs69wq/log2sim/stargazers","contributors_url":"https://api.github.com/repos/frs69wq/log2sim/contributors","subscribers_url":"https://api.github.com/repos/frs69wq/log2sim/subscribers","subscription_url":"https://api.github.com/repos/frs69wq/log2sim/subscription","commits_url":"https://api.github.com/repos/frs69wq/log2sim/commits{/sha}","git_commits_url":"https://api.github.com/repos/frs69wq/log2sim/git/commits{/sha}","comments_url":"https://api.github.com/repos/frs69wq/log2sim/comments{/number}","issue_comment_url":"https://api.github.com/repos/frs69wq/log2sim/issues/comments{/number}","contents_url":"https://api.github.com/repos/frs69wq/log2sim/contents/{+path}","compare_url":"https://api.github.com/repos/frs69wq/log2sim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frs69wq/log2sim/merges","archive_url":"https://api.github.com/repos/frs69wq/log2sim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frs69wq/log2sim/downloads","issues_url":"https://api.github.com/repos/frs69wq/log2sim/issues{/number}","pulls_url":"https://api.github.com/repos/frs69wq/log2sim/pulls{/number}","milestones_url":"https://api.github.com/repos/frs69wq/log2sim/milestones{/number}","notifications_url":"https://api.github.com/repos/frs69wq/log2sim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frs69wq/log2sim/labels{/name}","releases_url":"https://api.github.com/repos/frs69wq/log2sim/releases{/id}","deployments_url":"https://api.github.com/repos/frs69wq/log2sim/deployments","created_at":"2015-11-10T10:19:27Z","updated_at":"2016-04-29T12:09:10Z","pushed_at":"2016-07-19T15:05:34Z","git_url":"git://github.com/frs69wq/log2sim.git","ssh_url":"git@github.com:frs69wq/log2sim.git","clone_url":"https://github.com/frs69wq/log2sim.git","svn_url":"https://github.com/frs69wq/log2sim","homepage":null,"size":138,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"frs69wq:master","ref":"master","sha":"357f1d3e2ccf179deb5c0427d2ba2e9874912a24","user":{"login":"frs69wq","id":2534712,"avatar_url":"https://avatars.githubusercontent.com/u/2534712?v=3","gravatar_id":"","url":"https://api.github.com/users/frs69wq","html_url":"https://github.com/frs69wq","followers_url":"https://api.github.com/users/frs69wq/followers","following_url":"https://api.github.com/users/frs69wq/following{/other_user}","gists_url":"https://api.github.com/users/frs69wq/gists{/gist_id}","starred_url":"https://api.github.com/users/frs69wq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frs69wq/subscriptions","organizations_url":"https://api.github.com/users/frs69wq/orgs","repos_url":"https://api.github.com/users/frs69wq/repos","events_url":"https://api.github.com/users/frs69wq/events{/privacy}","received_events_url":"https://api.github.com/users/frs69wq/received_events","type":"User","site_admin":false},"repo":{"id":45904310,"name":"log2sim","full_name":"frs69wq/log2sim","owner":{"login":"frs69wq","id":2534712,"avatar_url":"https://avatars.githubusercontent.com/u/2534712?v=3","gravatar_id":"","url":"https://api.github.com/users/frs69wq","html_url":"https://github.com/frs69wq","followers_url":"https://api.github.com/users/frs69wq/followers","following_url":"https://api.github.com/users/frs69wq/following{/other_user}","gists_url":"https://api.github.com/users/frs69wq/gists{/gist_id}","starred_url":"https://api.github.com/users/frs69wq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frs69wq/subscriptions","organizations_url":"https://api.github.com/users/frs69wq/orgs","repos_url":"https://api.github.com/users/frs69wq/repos","events_url":"https://api.github.com/users/frs69wq/events{/privacy}","received_events_url":"https://api.github.com/users/frs69wq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frs69wq/log2sim","description":"","fork":false,"url":"https://api.github.com/repos/frs69wq/log2sim","forks_url":"https://api.github.com/repos/frs69wq/log2sim/forks","keys_url":"https://api.github.com/repos/frs69wq/log2sim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frs69wq/log2sim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frs69wq/log2sim/teams","hooks_url":"https://api.github.com/repos/frs69wq/log2sim/hooks","issue_events_url":"https://api.github.com/repos/frs69wq/log2sim/issues/events{/number}","events_url":"https://api.github.com/repos/frs69wq/log2sim/events","assignees_url":"https://api.github.com/repos/frs69wq/log2sim/assignees{/user}","branches_url":"https://api.github.com/repos/frs69wq/log2sim/branches{/branch}","tags_url":"https://api.github.com/repos/frs69wq/log2sim/tags","blobs_url":"https://api.github.com/repos/frs69wq/log2sim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frs69wq/log2sim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frs69wq/log2sim/git/refs{/sha}","trees_url":"https://api.github.com/repos/frs69wq/log2sim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frs69wq/log2sim/statuses/{sha}","languages_url":"https://api.github.com/repos/frs69wq/log2sim/languages","stargazers_url":"https://api.github.com/repos/frs69wq/log2sim/stargazers","contributors_url":"https://api.github.com/repos/frs69wq/log2sim/contributors","subscribers_url":"https://api.github.com/repos/frs69wq/log2sim/subscribers","subscription_url":"https://api.github.com/repos/frs69wq/log2sim/subscription","commits_url":"https://api.github.com/repos/frs69wq/log2sim/commits{/sha}","git_commits_url":"https://api.github.com/repos/frs69wq/log2sim/git/commits{/sha}","comments_url":"https://api.github.com/repos/frs69wq/log2sim/comments{/number}","issue_comment_url":"https://api.github.com/repos/frs69wq/log2sim/issues/comments{/number}","contents_url":"https://api.github.com/repos/frs69wq/log2sim/contents/{+path}","compare_url":"https://api.github.com/repos/frs69wq/log2sim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frs69wq/log2sim/merges","archive_url":"https://api.github.com/repos/frs69wq/log2sim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frs69wq/log2sim/downloads","issues_url":"https://api.github.com/repos/frs69wq/log2sim/issues{/number}","pulls_url":"https://api.github.com/repos/frs69wq/log2sim/pulls{/number}","milestones_url":"https://api.github.com/repos/frs69wq/log2sim/milestones{/number}","notifications_url":"https://api.github.com/repos/frs69wq/log2sim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frs69wq/log2sim/labels{/name}","releases_url":"https://api.github.com/repos/frs69wq/log2sim/releases{/id}","deployments_url":"https://api.github.com/repos/frs69wq/log2sim/deployments","created_at":"2015-11-10T10:19:27Z","updated_at":"2016-04-29T12:09:10Z","pushed_at":"2016-07-19T15:05:34Z","git_url":"git://github.com/frs69wq/log2sim.git","ssh_url":"git@github.com:frs69wq/log2sim.git","clone_url":"https://github.com/frs69wq/log2sim.git","svn_url":"https://github.com/frs69wq/log2sim","homepage":null,"size":138,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/frs69wq/log2sim/pulls/4"},"html":{"href":"https://github.com/frs69wq/log2sim/pull/4"},"issue":{"href":"https://api.github.com/repos/frs69wq/log2sim/issues/4"},"comments":{"href":"https://api.github.com/repos/frs69wq/log2sim/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/frs69wq/log2sim/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/frs69wq/log2sim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/frs69wq/log2sim/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/frs69wq/log2sim/statuses/0de1dd35e3054deeae83ca11420c062ea3c5a964"}}}}
{"actor":{"display_login":"frs69wq"}}