{"action":"created","comment":{"url":"https://api.github.com/repos/trifectalabs/myriad/pulls/comments/41109973","id":41109973,"diff_hunk":"@@ -18,26 +18,33 @@\n package com.trifectalabs.myriad\n package pso\n \n+import akka.pattern.ask\n+import akka.util.Timeout\n+import scala.concurrent.duration._\n+\n import scala.concurrent.Future\n-import scala.concurrent.ExecutionContext.Implicits.global\n \n class PSOExecutor(pso: PSOSystem) extends Executor {\n-  override def run(): Future[Result] = {\n-    val particleCount = pso.particles.length\n-\n-    println(s\"\\nExecuting job with:\")\n-    println(s\"\\tParticle count: $particleCount\")\n-    println(s\"\\tOptimization Function: ${pso.config.objectiveFunction}\")\n-    println(s\"\\tTermination Criteria: ${pso.config.terminationCriteria}\")\n-\n-    pso.master ! PrintSwarmScore\n-\n-    // termination criteria is # of iterations\n-    for(i <- 1 to 1000) {\n-      pso.particles.foreach(p => p ! ComputeIteration)\n+  override def run: Future[Result] = {\n+    // Kick off computation for each particle\n+    pso.particles.foreach(_ ! ComputeIteration)\n+    // TODO: make timeout variable depending on length of computation\n+    implicit val timeout = Timeout(5.seconds)\n+    implicit val ec = pso.system.dispatcher\n+    // retrieve the near-optimal value from the swarm master\n+    val best: Future[Any] = pso.master ? ResultRequest\n+    // wrap value in Result\n+    for {","path":"src/main/scala/PSO/PSOExecutor.scala","position":34,"original_position":34,"commit_id":"b3c930dd618511f55dcf2ad1c10f928ec5bc9a56","original_commit_id":"b3c930dd618511f55dcf2ad1c10f928ec5bc9a56","user":{"login":"kiambogo","id":4472397,"avatar_url":"https://avatars.githubusercontent.com/u/4472397?v=3","gravatar_id":"","url":"https://api.github.com/users/kiambogo","html_url":"https://github.com/kiambogo","followers_url":"https://api.github.com/users/kiambogo/followers","following_url":"https://api.github.com/users/kiambogo/following{/other_user}","gists_url":"https://api.github.com/users/kiambogo/gists{/gist_id}","starred_url":"https://api.github.com/users/kiambogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiambogo/subscriptions","organizations_url":"https://api.github.com/users/kiambogo/orgs","repos_url":"https://api.github.com/users/kiambogo/repos","events_url":"https://api.github.com/users/kiambogo/events{/privacy}","received_events_url":"https://api.github.com/users/kiambogo/received_events","type":"User","site_admin":false},"body":"If this is the only thing in your for comprehension, you probably don't need to use a for comprehension. Map on the future instead. \r\n\r\n`best map { b => b match ....`","created_at":"2015-10-05T04:26:19Z","updated_at":"2015-10-05T04:26:19Z","html_url":"https://github.com/trifectalabs/myriad/pull/5#discussion_r41109973","pull_request_url":"https://api.github.com/repos/trifectalabs/myriad/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/trifectalabs/myriad/pulls/comments/41109973"},"html":{"href":"https://github.com/trifectalabs/myriad/pull/5#discussion_r41109973"},"pull_request":{"href":"https://api.github.com/repos/trifectalabs/myriad/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/trifectalabs/myriad/pulls/5","id":46739038,"html_url":"https://github.com/trifectalabs/myriad/pull/5","diff_url":"https://github.com/trifectalabs/myriad/pull/5.diff","patch_url":"https://github.com/trifectalabs/myriad/pull/5.patch","issue_url":"https://api.github.com/repos/trifectalabs/myriad/issues/5","number":5,"state":"open","locked":false,"title":"Better testing-ish","user":{"login":"wittjosiah","id":4529818,"avatar_url":"https://avatars.githubusercontent.com/u/4529818?v=3","gravatar_id":"","url":"https://api.github.com/users/wittjosiah","html_url":"https://github.com/wittjosiah","followers_url":"https://api.github.com/users/wittjosiah/followers","following_url":"https://api.github.com/users/wittjosiah/following{/other_user}","gists_url":"https://api.github.com/users/wittjosiah/gists{/gist_id}","starred_url":"https://api.github.com/users/wittjosiah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wittjosiah/subscriptions","organizations_url":"https://api.github.com/users/wittjosiah/orgs","repos_url":"https://api.github.com/users/wittjosiah/repos","events_url":"https://api.github.com/users/wittjosiah/events{/privacy}","received_events_url":"https://api.github.com/users/wittjosiah/received_events","type":"User","site_admin":false},"body":"duuuuuude it's working","created_at":"2015-10-05T01:47:42Z","updated_at":"2015-10-05T04:26:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b1910362ebef33c4b289895aa268a1a555a0607","assignee":{"login":"kiambogo","id":4472397,"avatar_url":"https://avatars.githubusercontent.com/u/4472397?v=3","gravatar_id":"","url":"https://api.github.com/users/kiambogo","html_url":"https://github.com/kiambogo","followers_url":"https://api.github.com/users/kiambogo/followers","following_url":"https://api.github.com/users/kiambogo/following{/other_user}","gists_url":"https://api.github.com/users/kiambogo/gists{/gist_id}","starred_url":"https://api.github.com/users/kiambogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiambogo/subscriptions","organizations_url":"https://api.github.com/users/kiambogo/orgs","repos_url":"https://api.github.com/users/kiambogo/repos","events_url":"https://api.github.com/users/kiambogo/events{/privacy}","received_events_url":"https://api.github.com/users/kiambogo/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/trifectalabs/myriad/pulls/5/commits","review_comments_url":"https://api.github.com/repos/trifectalabs/myriad/pulls/5/comments","review_comment_url":"https://api.github.com/repos/trifectalabs/myriad/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trifectalabs/myriad/issues/5/comments","statuses_url":"https://api.github.com/repos/trifectalabs/myriad/statuses/b3c930dd618511f55dcf2ad1c10f928ec5bc9a56","head":{"label":"trifectalabs:better-testing","ref":"better-testing","sha":"b3c930dd618511f55dcf2ad1c10f928ec5bc9a56","user":{"login":"trifectalabs","id":11180339,"avatar_url":"https://avatars.githubusercontent.com/u/11180339?v=3","gravatar_id":"","url":"https://api.github.com/users/trifectalabs","html_url":"https://github.com/trifectalabs","followers_url":"https://api.github.com/users/trifectalabs/followers","following_url":"https://api.github.com/users/trifectalabs/following{/other_user}","gists_url":"https://api.github.com/users/trifectalabs/gists{/gist_id}","starred_url":"https://api.github.com/users/trifectalabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trifectalabs/subscriptions","organizations_url":"https://api.github.com/users/trifectalabs/orgs","repos_url":"https://api.github.com/users/trifectalabs/repos","events_url":"https://api.github.com/users/trifectalabs/events{/privacy}","received_events_url":"https://api.github.com/users/trifectalabs/received_events","type":"Organization","site_admin":false},"repo":{"id":42083796,"name":"myriad","full_name":"trifectalabs/myriad","owner":{"login":"trifectalabs","id":11180339,"avatar_url":"https://avatars.githubusercontent.com/u/11180339?v=3","gravatar_id":"","url":"https://api.github.com/users/trifectalabs","html_url":"https://github.com/trifectalabs","followers_url":"https://api.github.com/users/trifectalabs/followers","following_url":"https://api.github.com/users/trifectalabs/following{/other_user}","gists_url":"https://api.github.com/users/trifectalabs/gists{/gist_id}","starred_url":"https://api.github.com/users/trifectalabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trifectalabs/subscriptions","organizations_url":"https://api.github.com/users/trifectalabs/orgs","repos_url":"https://api.github.com/users/trifectalabs/repos","events_url":"https://api.github.com/users/trifectalabs/events{/privacy}","received_events_url":"https://api.github.com/users/trifectalabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trifectalabs/myriad","description":"A Scala Akka library for swarm intelligence algorithms","fork":false,"url":"https://api.github.com/repos/trifectalabs/myriad","forks_url":"https://api.github.com/repos/trifectalabs/myriad/forks","keys_url":"https://api.github.com/repos/trifectalabs/myriad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trifectalabs/myriad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trifectalabs/myriad/teams","hooks_url":"https://api.github.com/repos/trifectalabs/myriad/hooks","issue_events_url":"https://api.github.com/repos/trifectalabs/myriad/issues/events{/number}","events_url":"https://api.github.com/repos/trifectalabs/myriad/events","assignees_url":"https://api.github.com/repos/trifectalabs/myriad/assignees{/user}","branches_url":"https://api.github.com/repos/trifectalabs/myriad/branches{/branch}","tags_url":"https://api.github.com/repos/trifectalabs/myriad/tags","blobs_url":"https://api.github.com/repos/trifectalabs/myriad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trifectalabs/myriad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trifectalabs/myriad/git/refs{/sha}","trees_url":"https://api.github.com/repos/trifectalabs/myriad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trifectalabs/myriad/statuses/{sha}","languages_url":"https://api.github.com/repos/trifectalabs/myriad/languages","stargazers_url":"https://api.github.com/repos/trifectalabs/myriad/stargazers","contributors_url":"https://api.github.com/repos/trifectalabs/myriad/contributors","subscribers_url":"https://api.github.com/repos/trifectalabs/myriad/subscribers","subscription_url":"https://api.github.com/repos/trifectalabs/myriad/subscription","commits_url":"https://api.github.com/repos/trifectalabs/myriad/commits{/sha}","git_commits_url":"https://api.github.com/repos/trifectalabs/myriad/git/commits{/sha}","comments_url":"https://api.github.com/repos/trifectalabs/myriad/comments{/number}","issue_comment_url":"https://api.github.com/repos/trifectalabs/myriad/issues/comments{/number}","contents_url":"https://api.github.com/repos/trifectalabs/myriad/contents/{+path}","compare_url":"https://api.github.com/repos/trifectalabs/myriad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trifectalabs/myriad/merges","archive_url":"https://api.github.com/repos/trifectalabs/myriad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trifectalabs/myriad/downloads","issues_url":"https://api.github.com/repos/trifectalabs/myriad/issues{/number}","pulls_url":"https://api.github.com/repos/trifectalabs/myriad/pulls{/number}","milestones_url":"https://api.github.com/repos/trifectalabs/myriad/milestones{/number}","notifications_url":"https://api.github.com/repos/trifectalabs/myriad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trifectalabs/myriad/labels{/name}","releases_url":"https://api.github.com/repos/trifectalabs/myriad/releases{/id}","created_at":"2015-09-08T01:54:17Z","updated_at":"2015-09-19T12:29:05Z","pushed_at":"2015-10-05T02:56:44Z","git_url":"git://github.com/trifectalabs/myriad.git","ssh_url":"git@github.com:trifectalabs/myriad.git","clone_url":"https://github.com/trifectalabs/myriad.git","svn_url":"https://github.com/trifectalabs/myriad","homepage":null,"size":368,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"trifectalabs:master","ref":"master","sha":"1e4fbcb25eefd598b2322dd796ee2e1c540f693a","user":{"login":"trifectalabs","id":11180339,"avatar_url":"https://avatars.githubusercontent.com/u/11180339?v=3","gravatar_id":"","url":"https://api.github.com/users/trifectalabs","html_url":"https://github.com/trifectalabs","followers_url":"https://api.github.com/users/trifectalabs/followers","following_url":"https://api.github.com/users/trifectalabs/following{/other_user}","gists_url":"https://api.github.com/users/trifectalabs/gists{/gist_id}","starred_url":"https://api.github.com/users/trifectalabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trifectalabs/subscriptions","organizations_url":"https://api.github.com/users/trifectalabs/orgs","repos_url":"https://api.github.com/users/trifectalabs/repos","events_url":"https://api.github.com/users/trifectalabs/events{/privacy}","received_events_url":"https://api.github.com/users/trifectalabs/received_events","type":"Organization","site_admin":false},"repo":{"id":42083796,"name":"myriad","full_name":"trifectalabs/myriad","owner":{"login":"trifectalabs","id":11180339,"avatar_url":"https://avatars.githubusercontent.com/u/11180339?v=3","gravatar_id":"","url":"https://api.github.com/users/trifectalabs","html_url":"https://github.com/trifectalabs","followers_url":"https://api.github.com/users/trifectalabs/followers","following_url":"https://api.github.com/users/trifectalabs/following{/other_user}","gists_url":"https://api.github.com/users/trifectalabs/gists{/gist_id}","starred_url":"https://api.github.com/users/trifectalabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trifectalabs/subscriptions","organizations_url":"https://api.github.com/users/trifectalabs/orgs","repos_url":"https://api.github.com/users/trifectalabs/repos","events_url":"https://api.github.com/users/trifectalabs/events{/privacy}","received_events_url":"https://api.github.com/users/trifectalabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trifectalabs/myriad","description":"A Scala Akka library for swarm intelligence algorithms","fork":false,"url":"https://api.github.com/repos/trifectalabs/myriad","forks_url":"https://api.github.com/repos/trifectalabs/myriad/forks","keys_url":"https://api.github.com/repos/trifectalabs/myriad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trifectalabs/myriad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trifectalabs/myriad/teams","hooks_url":"https://api.github.com/repos/trifectalabs/myriad/hooks","issue_events_url":"https://api.github.com/repos/trifectalabs/myriad/issues/events{/number}","events_url":"https://api.github.com/repos/trifectalabs/myriad/events","assignees_url":"https://api.github.com/repos/trifectalabs/myriad/assignees{/user}","branches_url":"https://api.github.com/repos/trifectalabs/myriad/branches{/branch}","tags_url":"https://api.github.com/repos/trifectalabs/myriad/tags","blobs_url":"https://api.github.com/repos/trifectalabs/myriad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trifectalabs/myriad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trifectalabs/myriad/git/refs{/sha}","trees_url":"https://api.github.com/repos/trifectalabs/myriad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trifectalabs/myriad/statuses/{sha}","languages_url":"https://api.github.com/repos/trifectalabs/myriad/languages","stargazers_url":"https://api.github.com/repos/trifectalabs/myriad/stargazers","contributors_url":"https://api.github.com/repos/trifectalabs/myriad/contributors","subscribers_url":"https://api.github.com/repos/trifectalabs/myriad/subscribers","subscription_url":"https://api.github.com/repos/trifectalabs/myriad/subscription","commits_url":"https://api.github.com/repos/trifectalabs/myriad/commits{/sha}","git_commits_url":"https://api.github.com/repos/trifectalabs/myriad/git/commits{/sha}","comments_url":"https://api.github.com/repos/trifectalabs/myriad/comments{/number}","issue_comment_url":"https://api.github.com/repos/trifectalabs/myriad/issues/comments{/number}","contents_url":"https://api.github.com/repos/trifectalabs/myriad/contents/{+path}","compare_url":"https://api.github.com/repos/trifectalabs/myriad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trifectalabs/myriad/merges","archive_url":"https://api.github.com/repos/trifectalabs/myriad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trifectalabs/myriad/downloads","issues_url":"https://api.github.com/repos/trifectalabs/myriad/issues{/number}","pulls_url":"https://api.github.com/repos/trifectalabs/myriad/pulls{/number}","milestones_url":"https://api.github.com/repos/trifectalabs/myriad/milestones{/number}","notifications_url":"https://api.github.com/repos/trifectalabs/myriad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trifectalabs/myriad/labels{/name}","releases_url":"https://api.github.com/repos/trifectalabs/myriad/releases{/id}","created_at":"2015-09-08T01:54:17Z","updated_at":"2015-09-19T12:29:05Z","pushed_at":"2015-10-05T02:56:44Z","git_url":"git://github.com/trifectalabs/myriad.git","ssh_url":"git@github.com:trifectalabs/myriad.git","clone_url":"https://github.com/trifectalabs/myriad.git","svn_url":"https://github.com/trifectalabs/myriad","homepage":null,"size":368,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trifectalabs/myriad/pulls/5"},"html":{"href":"https://github.com/trifectalabs/myriad/pull/5"},"issue":{"href":"https://api.github.com/repos/trifectalabs/myriad/issues/5"},"comments":{"href":"https://api.github.com/repos/trifectalabs/myriad/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/trifectalabs/myriad/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/trifectalabs/myriad/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trifectalabs/myriad/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/trifectalabs/myriad/statuses/b3c930dd618511f55dcf2ad1c10f928ec5bc9a56"}}}}