{"action":"created","comment":{"url":"https://api.github.com/repos/cyclus/cycamore/pulls/comments/60152365","id":60152365,"diff_hunk":"@@ -0,0 +1,151 @@\n+\n+#ifndef CYCAMORE_SRC_MIXING_FAB_H_\n+#define CYCAMORE_SRC_MIXING_FAB_H_\n+\n+#include <string>\n+#include \"cyclus.h\"\n+#include \"cycamore_version.h\"\n+\n+namespace cycamore {\n+  \n+  /// MixingFab basically mixes N streams with fixed, static, user-specified\n+  /// ratios into a single output stream. The MixingFab has N input inventories:\n+  /// one for each streams to be mixed, and one output stream. The supplying of\n+  /// mixed material is constrained by available inventory of mixed material\n+  /// quantities.\n+class MixingFab : public cyclus::Facility {\n+#pragma cyclus note {   \t  \\\n+    \"niche\": \"mixing facility\",\t\t\t\t  \\\n+    \"doc\":\t\t\t\t\t\t\t\t\\\n+    \"MixingFab basically mixes N streams with fixed, static, user-specified\" \\\n+    \" ratios into a single output stream. The MixingFab has N input inventories:\"\\\n+    \" one for each streams to be mixed, and one output stream. The supplying of\"\\\n+    \" mixed material is constrained by available inventory of mixed material\"\\\n+    \" quantities.\", \\\n+    }\n+  \n+  friend class MixingFabTest;\n+\n+  public:\n+  MixingFab(cyclus::Context* ctx);\n+  virtual ~MixingFab() {};\n+  \n+  virtual void Tick();\n+  virtual void Tock(){};\n+  virtual void EnterNotify();\n+  \n+  virtual void AcceptMatlTrades(const std::vector<std::pair<\n+                                cyclus::Trade<cyclus::Material>, cyclus::Material::Ptr> >& responses);\n+  \n+  virtual std::set<cyclus::RequestPortfolio<cyclus::Material>::Ptr>\n+      GetMatlRequests();\n+\n+\n+  #pragma cyclus clone\n+  #pragma cyclus initfromcopy\n+  #pragma cyclus infiletodb\n+  #pragma cyclus initfromdb\n+  #pragma cyclus schema\n+  #pragma cyclus annotations\n+  #pragma cyclus snapshot\n+  // the following pragmas are ommitted and the functions are written\n+  // manually in order to handle the vector of resource buffers:\n+  //\n+  //     #pragma cyclus snapshotinv\n+  //     #pragma cyclus initinv\n+  \n+  virtual cyclus::Inventories SnapshotInv();\n+  virtual void InitInv(cyclus::Inventories& inv);\n+\n+  \n+  protected:\n+    \n+    \n+  #pragma cyclus var { \\\n+    \"doc\": \"Ordered list of commodities on which to request material stream\" \\\n+    \" material, each commodity corresponds to an input stream.\", \\\n+    \"uilabel\": \"Stream Commodities\", \\\n+    \"uitype\": [\"oneormore\", \"incommodity\"], \\\n+  }\n+  std::vector<std::string> in_commods;\n+  #pragma cyclus var { \\\n+    \"default\": [], \\\n+    \"uilabel\": \" Stream Preferences\", \\\n+    \"doc\": \"Stream commodity request preferences for each of the given commodities (same order).\" \\\n+    \" If unspecified, default is to use 1.0 for all preferences.\", \\\n+  }\n+  std::vector<double> fill_commod_prefs;\n+  \n+  #pragma cyclus var { \\\n+  \"doc\": \"Size of input material stream inventory - i.e. the quantity of each\" \\\n+  \" stream type to keep on-hand)\", \\\n+  \"uilabel\": \" Stream Inventory Capacity\", \\\n+  \"units\": \"kg\", \\\n+  }\n+  std::vector<double> in_buf_size;\n+  \n+  \n+  // custom SnapshotInv and InitInv and EnterNotify are used to persist this\n+  // state var.\n+  std::map<std::string, cyclus::toolkit::ResBuf<cyclus::Material> > streambufs;\n+\n+  \n+  #pragma cyclus var { \\\n+    \"default\": [], \\\n+    \"uilabel\": \"Commodities Mass Fraction\", \\\n+    \"doc\": \"Massic mixing ratio of each input commodity requested (same order).\" \\\n+    \" If unspecified, default is to use 1/N for each fraction.\" \\\n+    \" Stream ratios can total to any arbitrary value \" \\\n+    \"and will be automatically normalized internally.\" \\\n+  }\n+  std::vector<double> mixing_ratio;\n+  \n+  \n+  #pragma cyclus var { \\\n+    \"doc\": \"Commodity on which to offer/supply mixed fuel material.\", \\\n+    \"uilabel\": \"Output Commodity\", \\\n+    \"uitype\": \"outcommodity\", \\\n+  }\n+  std::string out_commod;","path":"src/mixing_fab.h","position":109,"original_position":109,"commit_id":"59317a080510165297d6727ba21a7fe252bab03e","original_commit_id":"59317a080510165297d6727ba21a7fe252bab03e","user":{"login":"Baaaaam","id":15145274,"avatar_url":"https://avatars.githubusercontent.com/u/15145274?v=3","gravatar_id":"","url":"https://api.github.com/users/Baaaaam","html_url":"https://github.com/Baaaaam","followers_url":"https://api.github.com/users/Baaaaam/followers","following_url":"https://api.github.com/users/Baaaaam/following{/other_user}","gists_url":"https://api.github.com/users/Baaaaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Baaaaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baaaaam/subscriptions","organizations_url":"https://api.github.com/users/Baaaaam/orgs","repos_url":"https://api.github.com/users/Baaaaam/repos","events_url":"https://api.github.com/users/Baaaaam/events{/privacy}","received_events_url":"https://api.github.com/users/Baaaaam/received_events","type":"User","site_admin":false},"body":"same as incommods : \r\n`source` -> `outcommod` \r\n`sink` -> `in_commods`\r\n`storage` -> `in_commods` / `out_commods` \r\n`separation` -> `feed_commods` / `streams_`\r\n`reactor` -> `fuel_incommods` / `fuel_outcommods`\r\n`fuel_fab` -> `outcommod` -- `fill_commods` / `fiss_commods` \r\n`enrichment` -> `feed_commod`","created_at":"2016-04-18T23:31:01Z","updated_at":"2016-04-18T23:31:01Z","html_url":"https://github.com/cyclus/cycamore/pull/399#discussion_r60152365","pull_request_url":"https://api.github.com/repos/cyclus/cycamore/pulls/399","_links":{"self":{"href":"https://api.github.com/repos/cyclus/cycamore/pulls/comments/60152365"},"html":{"href":"https://github.com/cyclus/cycamore/pull/399#discussion_r60152365"},"pull_request":{"href":"https://api.github.com/repos/cyclus/cycamore/pulls/399"}}},"pull_request":{"url":"https://api.github.com/repos/cyclus/cycamore/pulls/399","id":66487911,"html_url":"https://github.com/cyclus/cycamore/pull/399","diff_url":"https://github.com/cyclus/cycamore/pull/399.diff","patch_url":"https://github.com/cyclus/cycamore/pull/399.patch","issue_url":"https://api.github.com/repos/cyclus/cycamore/issues/399","number":399,"state":"open","locked":false,"title":"Add a Mixing fab","user":{"login":"Baaaaam","id":15145274,"avatar_url":"https://avatars.githubusercontent.com/u/15145274?v=3","gravatar_id":"","url":"https://api.github.com/users/Baaaaam","html_url":"https://github.com/Baaaaam","followers_url":"https://api.github.com/users/Baaaaam/followers","following_url":"https://api.github.com/users/Baaaaam/following{/other_user}","gists_url":"https://api.github.com/users/Baaaaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Baaaaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baaaaam/subscriptions","organizations_url":"https://api.github.com/users/Baaaaam/orgs","repos_url":"https://api.github.com/users/Baaaaam/repos","events_url":"https://api.github.com/users/Baaaaam/events{/privacy}","received_events_url":"https://api.github.com/users/Baaaaam/received_events","type":"User","site_admin":false},"body":"This PR is probably not ready to merge.\r\n\r\nThere is probably some improvement to make in the documentation as well, I relie on you comment to improve it.\r\n\r\nThank You\r\nBaM","created_at":"2016-04-14T13:55:15Z","updated_at":"2016-04-18T23:31:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"572fc054027f7008b9918400d27f3aa7b29357df","assignee":{"login":"Baaaaam","id":15145274,"avatar_url":"https://avatars.githubusercontent.com/u/15145274?v=3","gravatar_id":"","url":"https://api.github.com/users/Baaaaam","html_url":"https://github.com/Baaaaam","followers_url":"https://api.github.com/users/Baaaaam/followers","following_url":"https://api.github.com/users/Baaaaam/following{/other_user}","gists_url":"https://api.github.com/users/Baaaaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Baaaaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baaaaam/subscriptions","organizations_url":"https://api.github.com/users/Baaaaam/orgs","repos_url":"https://api.github.com/users/Baaaaam/repos","events_url":"https://api.github.com/users/Baaaaam/events{/privacy}","received_events_url":"https://api.github.com/users/Baaaaam/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cyclus/cycamore/milestones/14","html_url":"https://github.com/cyclus/cycamore/milestones/v1.4","labels_url":"https://api.github.com/repos/cyclus/cycamore/milestones/14/labels","id":1077347,"number":14,"title":"v1.4","description":null,"creator":{"login":"mbmcgarry","id":8630709,"avatar_url":"https://avatars.githubusercontent.com/u/8630709?v=3","gravatar_id":"","url":"https://api.github.com/users/mbmcgarry","html_url":"https://github.com/mbmcgarry","followers_url":"https://api.github.com/users/mbmcgarry/followers","following_url":"https://api.github.com/users/mbmcgarry/following{/other_user}","gists_url":"https://api.github.com/users/mbmcgarry/gists{/gist_id}","starred_url":"https://api.github.com/users/mbmcgarry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbmcgarry/subscriptions","organizations_url":"https://api.github.com/users/mbmcgarry/orgs","repos_url":"https://api.github.com/users/mbmcgarry/repos","events_url":"https://api.github.com/users/mbmcgarry/events{/privacy}","received_events_url":"https://api.github.com/users/mbmcgarry/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":22,"state":"open","created_at":"2015-04-21T15:22:54Z","updated_at":"2016-04-14T18:30:03Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/cyclus/cycamore/pulls/399/commits","review_comments_url":"https://api.github.com/repos/cyclus/cycamore/pulls/399/comments","review_comment_url":"https://api.github.com/repos/cyclus/cycamore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cyclus/cycamore/issues/399/comments","statuses_url":"https://api.github.com/repos/cyclus/cycamore/statuses/59317a080510165297d6727ba21a7fe252bab03e","head":{"label":"Baaaaam:mixing_fab","ref":"mixing_fab","sha":"59317a080510165297d6727ba21a7fe252bab03e","user":{"login":"Baaaaam","id":15145274,"avatar_url":"https://avatars.githubusercontent.com/u/15145274?v=3","gravatar_id":"","url":"https://api.github.com/users/Baaaaam","html_url":"https://github.com/Baaaaam","followers_url":"https://api.github.com/users/Baaaaam/followers","following_url":"https://api.github.com/users/Baaaaam/following{/other_user}","gists_url":"https://api.github.com/users/Baaaaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Baaaaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baaaaam/subscriptions","organizations_url":"https://api.github.com/users/Baaaaam/orgs","repos_url":"https://api.github.com/users/Baaaaam/repos","events_url":"https://api.github.com/users/Baaaaam/events{/privacy}","received_events_url":"https://api.github.com/users/Baaaaam/received_events","type":"User","site_admin":false},"repo":{"id":44553413,"name":"cycamore","full_name":"Baaaaam/cycamore","owner":{"login":"Baaaaam","id":15145274,"avatar_url":"https://avatars.githubusercontent.com/u/15145274?v=3","gravatar_id":"","url":"https://api.github.com/users/Baaaaam","html_url":"https://github.com/Baaaaam","followers_url":"https://api.github.com/users/Baaaaam/followers","following_url":"https://api.github.com/users/Baaaaam/following{/other_user}","gists_url":"https://api.github.com/users/Baaaaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Baaaaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baaaaam/subscriptions","organizations_url":"https://api.github.com/users/Baaaaam/orgs","repos_url":"https://api.github.com/users/Baaaaam/repos","events_url":"https://api.github.com/users/Baaaaam/events{/privacy}","received_events_url":"https://api.github.com/users/Baaaaam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Baaaaam/cycamore","description":"The CYClus Additional Module REpository","fork":true,"url":"https://api.github.com/repos/Baaaaam/cycamore","forks_url":"https://api.github.com/repos/Baaaaam/cycamore/forks","keys_url":"https://api.github.com/repos/Baaaaam/cycamore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Baaaaam/cycamore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Baaaaam/cycamore/teams","hooks_url":"https://api.github.com/repos/Baaaaam/cycamore/hooks","issue_events_url":"https://api.github.com/repos/Baaaaam/cycamore/issues/events{/number}","events_url":"https://api.github.com/repos/Baaaaam/cycamore/events","assignees_url":"https://api.github.com/repos/Baaaaam/cycamore/assignees{/user}","branches_url":"https://api.github.com/repos/Baaaaam/cycamore/branches{/branch}","tags_url":"https://api.github.com/repos/Baaaaam/cycamore/tags","blobs_url":"https://api.github.com/repos/Baaaaam/cycamore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Baaaaam/cycamore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Baaaaam/cycamore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Baaaaam/cycamore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Baaaaam/cycamore/statuses/{sha}","languages_url":"https://api.github.com/repos/Baaaaam/cycamore/languages","stargazers_url":"https://api.github.com/repos/Baaaaam/cycamore/stargazers","contributors_url":"https://api.github.com/repos/Baaaaam/cycamore/contributors","subscribers_url":"https://api.github.com/repos/Baaaaam/cycamore/subscribers","subscription_url":"https://api.github.com/repos/Baaaaam/cycamore/subscription","commits_url":"https://api.github.com/repos/Baaaaam/cycamore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Baaaaam/cycamore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Baaaaam/cycamore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Baaaaam/cycamore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Baaaaam/cycamore/contents/{+path}","compare_url":"https://api.github.com/repos/Baaaaam/cycamore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Baaaaam/cycamore/merges","archive_url":"https://api.github.com/repos/Baaaaam/cycamore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Baaaaam/cycamore/downloads","issues_url":"https://api.github.com/repos/Baaaaam/cycamore/issues{/number}","pulls_url":"https://api.github.com/repos/Baaaaam/cycamore/pulls{/number}","milestones_url":"https://api.github.com/repos/Baaaaam/cycamore/milestones{/number}","notifications_url":"https://api.github.com/repos/Baaaaam/cycamore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Baaaaam/cycamore/labels{/name}","releases_url":"https://api.github.com/repos/Baaaaam/cycamore/releases{/id}","deployments_url":"https://api.github.com/repos/Baaaaam/cycamore/deployments","created_at":"2015-10-19T18:00:40Z","updated_at":"2016-02-22T19:41:55Z","pushed_at":"2016-04-18T19:28:40Z","git_url":"git://github.com/Baaaaam/cycamore.git","ssh_url":"git@github.com:Baaaaam/cycamore.git","clone_url":"https://github.com/Baaaaam/cycamore.git","svn_url":"https://github.com/Baaaaam/cycamore","homepage":"","size":8014,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"cyclus:develop","ref":"develop","sha":"25edd2fe1137e6b607e4dd98d38335bd63990adf","user":{"login":"cyclus","id":1355686,"avatar_url":"https://avatars.githubusercontent.com/u/1355686?v=3","gravatar_id":"","url":"https://api.github.com/users/cyclus","html_url":"https://github.com/cyclus","followers_url":"https://api.github.com/users/cyclus/followers","following_url":"https://api.github.com/users/cyclus/following{/other_user}","gists_url":"https://api.github.com/users/cyclus/gists{/gist_id}","starred_url":"https://api.github.com/users/cyclus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyclus/subscriptions","organizations_url":"https://api.github.com/users/cyclus/orgs","repos_url":"https://api.github.com/users/cyclus/repos","events_url":"https://api.github.com/users/cyclus/events{/privacy}","received_events_url":"https://api.github.com/users/cyclus/received_events","type":"Organization","site_admin":false},"repo":{"id":4973784,"name":"cycamore","full_name":"cyclus/cycamore","owner":{"login":"cyclus","id":1355686,"avatar_url":"https://avatars.githubusercontent.com/u/1355686?v=3","gravatar_id":"","url":"https://api.github.com/users/cyclus","html_url":"https://github.com/cyclus","followers_url":"https://api.github.com/users/cyclus/followers","following_url":"https://api.github.com/users/cyclus/following{/other_user}","gists_url":"https://api.github.com/users/cyclus/gists{/gist_id}","starred_url":"https://api.github.com/users/cyclus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyclus/subscriptions","organizations_url":"https://api.github.com/users/cyclus/orgs","repos_url":"https://api.github.com/users/cyclus/repos","events_url":"https://api.github.com/users/cyclus/events{/privacy}","received_events_url":"https://api.github.com/users/cyclus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cyclus/cycamore","description":"The CYClus Additional Module REpository","fork":false,"url":"https://api.github.com/repos/cyclus/cycamore","forks_url":"https://api.github.com/repos/cyclus/cycamore/forks","keys_url":"https://api.github.com/repos/cyclus/cycamore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cyclus/cycamore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cyclus/cycamore/teams","hooks_url":"https://api.github.com/repos/cyclus/cycamore/hooks","issue_events_url":"https://api.github.com/repos/cyclus/cycamore/issues/events{/number}","events_url":"https://api.github.com/repos/cyclus/cycamore/events","assignees_url":"https://api.github.com/repos/cyclus/cycamore/assignees{/user}","branches_url":"https://api.github.com/repos/cyclus/cycamore/branches{/branch}","tags_url":"https://api.github.com/repos/cyclus/cycamore/tags","blobs_url":"https://api.github.com/repos/cyclus/cycamore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cyclus/cycamore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cyclus/cycamore/git/refs{/sha}","trees_url":"https://api.github.com/repos/cyclus/cycamore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cyclus/cycamore/statuses/{sha}","languages_url":"https://api.github.com/repos/cyclus/cycamore/languages","stargazers_url":"https://api.github.com/repos/cyclus/cycamore/stargazers","contributors_url":"https://api.github.com/repos/cyclus/cycamore/contributors","subscribers_url":"https://api.github.com/repos/cyclus/cycamore/subscribers","subscription_url":"https://api.github.com/repos/cyclus/cycamore/subscription","commits_url":"https://api.github.com/repos/cyclus/cycamore/commits{/sha}","git_commits_url":"https://api.github.com/repos/cyclus/cycamore/git/commits{/sha}","comments_url":"https://api.github.com/repos/cyclus/cycamore/comments{/number}","issue_comment_url":"https://api.github.com/repos/cyclus/cycamore/issues/comments{/number}","contents_url":"https://api.github.com/repos/cyclus/cycamore/contents/{+path}","compare_url":"https://api.github.com/repos/cyclus/cycamore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cyclus/cycamore/merges","archive_url":"https://api.github.com/repos/cyclus/cycamore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cyclus/cycamore/downloads","issues_url":"https://api.github.com/repos/cyclus/cycamore/issues{/number}","pulls_url":"https://api.github.com/repos/cyclus/cycamore/pulls{/number}","milestones_url":"https://api.github.com/repos/cyclus/cycamore/milestones{/number}","notifications_url":"https://api.github.com/repos/cyclus/cycamore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cyclus/cycamore/labels{/name}","releases_url":"https://api.github.com/repos/cyclus/cycamore/releases{/id}","deployments_url":"https://api.github.com/repos/cyclus/cycamore/deployments","created_at":"2012-07-10T12:41:38Z","updated_at":"2016-02-17T20:45:11Z","pushed_at":"2016-04-18T19:28:40Z","git_url":"git://github.com/cyclus/cycamore.git","ssh_url":"git@github.com:cyclus/cycamore.git","clone_url":"https://github.com/cyclus/cycamore.git","svn_url":"https://github.com/cyclus/cycamore","homepage":"","size":8377,"stargazers_count":8,"watchers_count":8,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":21,"mirror_url":null,"open_issues_count":27,"forks":21,"open_issues":27,"watchers":8,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cyclus/cycamore/pulls/399"},"html":{"href":"https://github.com/cyclus/cycamore/pull/399"},"issue":{"href":"https://api.github.com/repos/cyclus/cycamore/issues/399"},"comments":{"href":"https://api.github.com/repos/cyclus/cycamore/issues/399/comments"},"review_comments":{"href":"https://api.github.com/repos/cyclus/cycamore/pulls/399/comments"},"review_comment":{"href":"https://api.github.com/repos/cyclus/cycamore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cyclus/cycamore/pulls/399/commits"},"statuses":{"href":"https://api.github.com/repos/cyclus/cycamore/statuses/59317a080510165297d6727ba21a7fe252bab03e"}}}}