CYCAMORE
Loading...
Searching...
No Matches
build/cycamore/sink.cc
Go to the documentation of this file.
1#line 1 "/cycamore/src/sink.cc"
2// Implements the Sink class
3#include <algorithm>
4#include <sstream>
5
6#include <boost/lexical_cast.hpp>
7
8#include "sink.h"
9
10namespace cycamore {
11
12// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
13Sink::Sink(cyclus::Context* ctx)
14 : cyclus::Facility(ctx),
15 capacity(std::numeric_limits<double>::max()),
16 keep_packaging(true) {
17 SetMaxInventorySize(std::numeric_limits<double>::max());}
18
19// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
21std::string Sink::schema() {
22 return ""
23 "<interleave>\n"
24 " <optional>\n"
25 " <element name=\"latitude\">\n"
26 " <a:documentation>Latitude of the agent's geographical position. The value should be expressed in degrees as a double.</a:documentation>\n"
27 " <data type=\"double\"/>\n"
28 " </element>\n"
29 " </optional>\n"
30 " <optional>\n"
31 " <element name=\"longitude\">\n"
32 " <a:documentation>Longitude of the agent's geographical position. The value should be expressed in degrees as a double.</a:documentation>\n"
33 " <data type=\"double\"/>\n"
34 " </element>\n"
35 " </optional>\n"
36 " <element name=\"in_commods\">\n"
37 " <oneOrMore>\n"
38 " <element name=\"val\">\n"
39 " <data type=\"string\"/>\n"
40 " </element>\n"
41 " </oneOrMore>\n"
42 " </element>\n"
43 " <optional>\n"
44 " <element name=\"in_commod_prefs\">\n"
45 " <oneOrMore>\n"
46 " <element name=\"val\">\n"
47 " <data type=\"double\"/>\n"
48 " </element>\n"
49 " </oneOrMore>\n"
50 " </element>\n"
51 " </optional>\n"
52 " <optional>\n"
53 " <element name=\"recipe_name\">\n"
54 " <a:documentation>name of recipe to use for material requests, where the default (empty string) is to accept everything</a:documentation>\n"
55 " <data type=\"string\"/>\n"
56 " </element>\n"
57 " </optional>\n"
58 " <optional>\n"
59 " <element name=\"max_inv_size\">\n"
60 " <a:documentation>total maximum inventory size of sink facility</a:documentation>\n"
61 " <data type=\"double\"/>\n"
62 " </element>\n"
63 " </optional>\n"
64 " <optional>\n"
65 " <element name=\"capacity\">\n"
66 " <a:documentation>capacity the sink facility can accept at each time step</a:documentation>\n"
67 " <data type=\"double\"/>\n"
68 " </element>\n"
69 " </optional>\n"
70 " <optional>\n"
71 " <element name=\"random_size_type\">\n"
72 " <a:documentation>type of random behavior to use. Default None, other options are 'UniformReal', 'UniformInt', 'NormalReal', and 'NormalInt'</a:documentation>\n"
73 " <data type=\"string\"/>\n"
74 " </element>\n"
75 " </optional>\n"
76 " <optional>\n"
77 " <element name=\"random_size_mean\">\n"
78 " <a:documentation>When a normal distribution is used to determine the size of the request, this is the fraction of available space to use as the mean. Default 1.0. Note that values significantly above 1 without a correspondingly large std dev may result in inefficient use of the random number generator.</a:documentation>\n"
79 " <data type=\"double\"/>\n"
80 " </element>\n"
81 " </optional>\n"
82 " <optional>\n"
83 " <element name=\"random_size_stddev\">\n"
84 " <a:documentation>When a normal distribution is used to determine the size of the request, this is the fraction of available space to use as the standard deviation. Default 0.1</a:documentation>\n"
85 " <data type=\"double\"/>\n"
86 " </element>\n"
87 " </optional>\n"
88 " <optional>\n"
89 " <element name=\"random_frequency_type\">\n"
90 " <a:documentation>type of random behavior to use. Default None, other options are, 'UniformInt', and 'NormalInt'. When using 'UniformInt', also set 'random_frequency_min' and 'random_frequency_max'. For 'NormalInt', set 'random_frequency_mean' and 'random_fequency_stddev', min and max values are optional. </a:documentation>\n"
91 " <data type=\"string\"/>\n"
92 " </element>\n"
93 " </optional>\n"
94 " <optional>\n"
95 " <element name=\"random_frequency_mean\">\n"
96 " <a:documentation>When a normal distribution is used to determine the frequency of the request, this is the mean. Default 1</a:documentation>\n"
97 " <data type=\"double\"/>\n"
98 " </element>\n"
99 " </optional>\n"
100 " <optional>\n"
101 " <element name=\"random_frequency_stddev\">\n"
102 " <a:documentation>When a normal distribution is used to determine the frequency of the request, this is the standard deviation. Default 1</a:documentation>\n"
103 " <data type=\"double\"/>\n"
104 " </element>\n"
105 " </optional>\n"
106 " <optional>\n"
107 " <element name=\"random_frequency_min\">\n"
108 " <a:documentation>When a random distribution is used to determine the frequency of the request, this is the lower bound. Default 1</a:documentation>\n"
109 " <data type=\"int\"/>\n"
110 " </element>\n"
111 " </optional>\n"
112 " <optional>\n"
113 " <element name=\"random_frequency_max\">\n"
114 " <a:documentation>When a random distribution is used to determine the frequency of the request, this is the upper bound. Default 2147483647 (CY_LARGE_INT)</a:documentation>\n"
115 " <data type=\"int\"/>\n"
116 " </element>\n"
117 " </optional>\n"
118 " <optional>\n"
119 " <element name=\"keep_packaging\">\n"
120 " <a:documentation>Boolean value about whether to keep packaging. If true, packaging will not be stripped upon acceptance into the sink. If false, package type will be stripped immediately upon acceptance. Has no effect if the incoming material is not packaged.</a:documentation>\n"
121 " <data type=\"boolean\"/>\n"
122 " </element>\n"
123 " </optional>\n"
124 "</interleave>\n";
125};
126#line 20 "/cycamore/src/sink.cc"
127
128Json::Value Sink::annotations() {
129 Json::Value root;
130 Json::Reader reader;
131 bool parsed_ok = reader.parse(
132 "{\"name\":\"cycamore::Sink\",\"entity\":\"facility\",\"pare"
133 "nts\":[\"cyclus::Facility\",\"cyclus::toolkit::Positio"
134 "n\"],\"all_parents\":[\"EconomicEntity\",\"cyclus::Agent"
135 "\",\"cyclus::Facility\",\"cyclus::Ider\",\"cyclus::State"
136 "Wrangler\",\"cyclus::TimeListener\",\"cyclus::Trader\","
137 "\"cyclus::toolkit::Position\"],\"vars\":{\"latitude\":{\""
138 "default\":0.0,\"uilabel\":\"Geographical latitude in "
139 "degrees as a double\",\"doc\":\"Latitude of the "
140 "agent's geographical position. The value should be"
141 " expressed in degrees as a double.\",\"type\":\"double"
142 "\",\"index\":0,\"shape\":[-"
143 "1],\"alias\":\"latitude\",\"tooltip\":\"latitude\"},\"longi"
144 "tude\":{\"default\":0.0,\"uilabel\":\"Geographical "
145 "longitude in degrees as a double\",\"doc\":\"Longitude"
146 " of the agent's geographical position. The value "
147 "should be expressed in degrees as a double.\",\"type"
148 "\":\"double\",\"index\":1,\"shape\":[-"
149 "1],\"alias\":\"longitude\",\"tooltip\":\"longitude\"},\"in_"
150 "commods\":{\"tooltip\":[\"input "
151 "commodities\",\"\"],\"doc\":\"commodities that the sink "
152 "facility accepts\",\"uilabel\":[\"List of Input Commod"
153 "ities\",\"\"],\"uitype\":[\"oneormore\",\"incommodity\"],\"t"
154 "ype\":[\"std::vector\",\"std::string\"],\"index\":2,\"shap"
155 "e\":[-1,-"
156 "1],\"alias\":[\"in_commods\",\"val\"]},\"in_commod_prefs\""
157 ":{\"default\":[],\"doc\":\"preferences for each of the "
158 "given commodities, in the same order.Defauts to 1 "
159 "if unspecified\",\"uilabel\":[\"In Commody Preferences"
160 "\",\"\"],\"range\":[null,[1e-"
161 "08,1e+299]],\"uitype\":[\"oneormore\",\"range\"],\"type\":"
162 "[\"std::vector\",\"double\"],\"index\":3,\"shape\":[-1,-"
163 "1],\"alias\":[\"in_commod_prefs\",\"val\"],\"tooltip\":[\"i"
164 "n_commod_prefs\",\"\"]},\"recipe_name\":{\"default\":\"\",\""
165 "tooltip\":\"requested composition\",\"doc\":\"name of "
166 "recipe to use for material requests, where the "
167 "default (empty string) is to accept "
168 "everything\",\"uilabel\":\"Input Recipe\",\"uitype\":\"inr"
169 "ecipe\",\"type\":\"std::string\",\"index\":4,\"shape\":[-"
170 "1],\"alias\":\"recipe_name\"},\"max_inv_size\":{\"default"
171 "\":1e+299,\"tooltip\":\"sink maximum inventory "
172 "size\",\"uilabel\":\"Maximum Inventory\",\"uitype\":\"rang"
173 "e\",\"range\":[0.0,1e+299],\"doc\":\"total maximum "
174 "inventory size of sink facility\",\"type\":\"double\",\""
175 "index\":5,\"shape\":[-"
176 "1],\"alias\":\"max_inv_size\"},\"capacity\":{\"default\":1"
177 "e+299,\"tooltip\":\"sink capacity\",\"uilabel\":\"Maximum"
178 " Throughput\",\"uitype\":\"range\",\"range\":[0.0,1e+299]"
179 ",\"doc\":\"capacity the sink facility can accept at "
180 "each time step\",\"type\":\"double\",\"index\":6,\"shape\":"
181 "[-"
182 "1],\"alias\":\"capacity\"},\"inventory\":{\"capacity\":\"ma"
183 "x_inv_size\",\"type\":[\"cyclus::toolkit::ResBuf\",\"cyc"
184 "lus::Resource\"],\"index\":7,\"shape\":[-1,-"
185 "1]},\"random_size_type\":{\"default\":\"None\",\"tooltip\""
186 ":\"type of random behavior when setting the size of"
187 " the "
188 "request\",\"uitype\":\"combobox\",\"uilabel\":\"Random Siz"
189 "e\",\"categorical\":[\"None\",\"UniformReal\",\"UniformInt"
190 "\",\"NormalReal\",\"NormalInt\"],\"doc\":\"type of random "
191 "behavior to use. Default None, other options are "
192 "'UniformReal', 'UniformInt', 'NormalReal', and 'No"
193 "rmalInt'\",\"type\":\"std::string\",\"index\":8,\"shape\":["
194 "-1],\"alias\":\"random_size_type\"},\"random_size_mean\""
195 ":{\"default\":1.0,\"tooltip\":\"fraction of available "
196 "space to determine the mean\",\"uilabel\":\"Random "
197 "Size Mean\",\"uitype\":\"range\",\"range\":[0.0,1e+299],\""
198 "doc\":\"When a normal distribution is used to "
199 "determine the size of the request, this is the "
200 "fraction of available space to use as the mean. "
201 "Default 1.0. Note that values significantly above "
202 "1 without a correspondingly large std dev may "
203 "result in inefficient use of the random number gen"
204 "erator.\",\"type\":\"double\",\"index\":9,\"shape\":[-"
205 "1],\"alias\":\"random_size_mean\"},\"random_size_stddev"
206 "\":{\"default\":0.1,\"tooltip\":\"fraction of available "
207 "space to determine the std dev\",\"uilabel\":\"Random "
208 "Size Std Dev\",\"uitype\":\"range\",\"range\":[0.0,1e+299"
209 "],\"doc\":\"When a normal distribution is used to "
210 "determine the size of the request, this is the "
211 "fraction of available space to use as the standard"
212 " deviation. Default 0.1\",\"type\":\"double\",\"index\":1"
213 "0,\"shape\":[-"
214 "1],\"alias\":\"random_size_stddev\"},\"random_frequency"
215 "_type\":{\"default\":\"None\",\"tooltip\":\"type of random"
216 " behavior when setting the timing of the "
217 "request\",\"uitype\":\"combobox\",\"uilabel\":\"Random Tim"
218 "ing\",\"categorical\":[\"None\",\"UniformInt\",\"NormalInt"
219 "\"],\"doc\":\"type of random behavior to use. Default "
220 "None, other options are, 'UniformInt', and "
221 "'NormalInt'. When using 'UniformInt', also set "
222 "'random_frequency_min' and 'random_frequency_max'."
223 " For 'NormalInt', set 'random_frequency_mean' and "
224 "'random_fequency_stddev', min and max values are "
225 "optional. \",\"type\":\"std::string\",\"index\":11,\"shape"
226 "\":[-"
227 "1],\"alias\":\"random_frequency_type\"},\"random_freque"
228 "ncy_mean\":{\"default\":1,\"tooltip\":\"mean of the "
229 "random frequency\",\"uilabel\":\"Random Frequency Mean"
230 "\",\"uitype\":\"range\",\"range\":[0.0,1e+299],\"doc\":\"Whe"
231 "n a normal distribution is used to determine the "
232 "frequency of the request, this is the mean. "
233 "Default 1\",\"type\":\"double\",\"index\":12,\"shape\":[-"
234 "1],\"alias\":\"random_frequency_mean\"},\"random_freque"
235 "ncy_stddev\":{\"default\":1,\"tooltip\":\"std dev of the"
236 " random frequency\",\"uilabel\":\"Random Frequency Std"
237 " Dev\",\"uitype\":\"range\",\"range\":[0.0,1e+299],\"doc\":"
238 "\"When a normal distribution is used to determine "
239 "the frequency of the request, this is the standard"
240 " deviation. Default 1\",\"type\":\"double\",\"index\":13,"
241 "\"shape\":[-"
242 "1],\"alias\":\"random_frequency_stddev\"},\"random_freq"
243 "uency_min\":{\"default\":1,\"tooltip\":\"lower bound of "
244 "the random frequency\",\"uilabel\":\"Random Frequency "
245 "Lower Bound\",\"uitype\":\"range\",\"range\":[1,214748364"
246 "7],\"doc\":\"When a random distribution is used to "
247 "determine the frequency of the request, this is "
248 "the lower bound. Default 1\",\"type\":\"int\",\"index\":1"
249 "4,\"shape\":[-"
250 "1],\"alias\":\"random_frequency_min\"},\"random_frequen"
251 "cy_max\":{\"default\":2147483647,\"tooltip\":\"upper "
252 "bound of the random frequency\",\"uilabel\":\"Random "
253 "Frequency Upper Bound\",\"uitype\":\"range\",\"range\":[1"
254 ",2147483647],\"doc\":\"When a random distribution is "
255 "used to determine the frequency of the request, "
256 "this is the upper bound. Default 2147483647 (CY_LA"
257 "RGE_INT)\",\"type\":\"int\",\"index\":15,\"shape\":[-"
258 "1],\"alias\":\"random_frequency_max\"},\"keep_packaging"
259 "\":{\"default\":true,\"tooltip\":\"Whether to persist "
260 "packaging in the sink.\",\"doc\":\"Boolean value about"
261 " whether to keep packaging. If true, packaging "
262 "will not be stripped upon acceptance into the "
263 "sink. If false, package type will be stripped "
264 "immediately upon acceptance. Has no effect if the "
265 "incoming material is not "
266 "packaged.\",\"uilabel\":\"Keep Packaging\",\"uitype\":\"bo"
267 "ol\",\"type\":\"bool\",\"index\":16,\"shape\":[-"
268 "1],\"alias\":\"keep_packaging\"}},\"doc\":\" A sink "
269 "facility that accepts materials and products with "
270 "a fixed\\n throughput (per time step) capacity and "
271 "a lifetime capacity defined by\\n a total inventory"
272 " size. The inventory size and throughput "
273 "capacity\\n both default to infinite. If a recipe "
274 "is provided, it will request\\n material with that "
275 "recipe. Requests are made for any number of\\n "
276 "specified commodities.\\n\"}", root);
277 if (!parsed_ok) {
278 throw cyclus::ValueError("failed to parse annotations for cycamore::Sink.");
279 }
280 return root;
281};
282#line 22 "/cycamore/src/sink.cc"
283
284void Sink::InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di) {
285 cyclus::Facility::InfileToDb(tree, di);
286 int rawcycpp_shape_latitude[1] = {-1};
287 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
288 int rawcycpp_shape_longitude[1] = {-1};
289 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
290 int rawcycpp_shape_in_commods[2] = {-1, -1};
291 cycpp_shape_in_commods = std::vector<int>(rawcycpp_shape_in_commods, rawcycpp_shape_in_commods + 2);
292 int rawcycpp_shape_in_commod_prefs[2] = {-1, -1};
293 cycpp_shape_in_commod_prefs = std::vector<int>(rawcycpp_shape_in_commod_prefs, rawcycpp_shape_in_commod_prefs + 2);
294 int rawcycpp_shape_recipe_name[1] = {-1};
295 cycpp_shape_recipe_name = std::vector<int>(rawcycpp_shape_recipe_name, rawcycpp_shape_recipe_name + 1);
296 int rawcycpp_shape_max_inv_size[1] = {-1};
297 cycpp_shape_max_inv_size = std::vector<int>(rawcycpp_shape_max_inv_size, rawcycpp_shape_max_inv_size + 1);
298 int rawcycpp_shape_capacity[1] = {-1};
299 cycpp_shape_capacity = std::vector<int>(rawcycpp_shape_capacity, rawcycpp_shape_capacity + 1);
300 int rawcycpp_shape_inventory[2] = {-1, -1};
301 cycpp_shape_inventory = std::vector<int>(rawcycpp_shape_inventory, rawcycpp_shape_inventory + 2);
302 int rawcycpp_shape_random_size_type[1] = {-1};
303 cycpp_shape_random_size_type = std::vector<int>(rawcycpp_shape_random_size_type, rawcycpp_shape_random_size_type + 1);
304 int rawcycpp_shape_random_size_mean[1] = {-1};
305 cycpp_shape_random_size_mean = std::vector<int>(rawcycpp_shape_random_size_mean, rawcycpp_shape_random_size_mean + 1);
306 int rawcycpp_shape_random_size_stddev[1] = {-1};
307 cycpp_shape_random_size_stddev = std::vector<int>(rawcycpp_shape_random_size_stddev, rawcycpp_shape_random_size_stddev + 1);
308 int rawcycpp_shape_random_frequency_type[1] = {-1};
309 cycpp_shape_random_frequency_type = std::vector<int>(rawcycpp_shape_random_frequency_type, rawcycpp_shape_random_frequency_type + 1);
310 int rawcycpp_shape_random_frequency_mean[1] = {-1};
311 cycpp_shape_random_frequency_mean = std::vector<int>(rawcycpp_shape_random_frequency_mean, rawcycpp_shape_random_frequency_mean + 1);
312 int rawcycpp_shape_random_frequency_stddev[1] = {-1};
313 cycpp_shape_random_frequency_stddev = std::vector<int>(rawcycpp_shape_random_frequency_stddev, rawcycpp_shape_random_frequency_stddev + 1);
314 int rawcycpp_shape_random_frequency_min[1] = {-1};
315 cycpp_shape_random_frequency_min = std::vector<int>(rawcycpp_shape_random_frequency_min, rawcycpp_shape_random_frequency_min + 1);
316 int rawcycpp_shape_random_frequency_max[1] = {-1};
317 cycpp_shape_random_frequency_max = std::vector<int>(rawcycpp_shape_random_frequency_max, rawcycpp_shape_random_frequency_max + 1);
318 int rawcycpp_shape_keep_packaging[1] = {-1};
319 cycpp_shape_keep_packaging = std::vector<int>(rawcycpp_shape_keep_packaging, rawcycpp_shape_keep_packaging + 1);
320 cyclus::InfileTree* sub = tree->SubTree("config/*");
321 int i;
322 int n;
323 if (sub->NMatches("latitude") > 0) {
324 {
325 double latitude_val = cyclus::Query<double>(sub, "latitude");
326 latitude = latitude_val;
327 }
328 } else {
329 double latitude_tmp = 0.0;
330 latitude = latitude_tmp;
331 }
332 if (sub->NMatches("longitude") > 0) {
333 {
334 double longitude_val = cyclus::Query<double>(sub, "longitude");
335 longitude = longitude_val;
336 }
337 } else {
338 double longitude_tmp = 0.0;
339 longitude = longitude_tmp;
340 }
341 {
342 cyclus::InfileTree* bub = sub->SubTree("in_commods", 0);
343 cyclus::InfileTree* sub = bub;
344 int n1 = sub->NMatches("val");
345 std::vector< std::string > in_commods_val;
346 in_commods_val.resize(n1);
347 for (int i1 = 0; i1 < n1; ++i1) {
348 std::string elem;
349 {
350 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
351 elem = elem_in;
352 }
353 in_commods_val[i1] = elem;
354 }
355 in_commods = in_commods_val;
356 }
357 if (sub->NMatches("in_commod_prefs") > 0) {
358 {
359 cyclus::InfileTree* bub = sub->SubTree("in_commod_prefs", 0);
360 cyclus::InfileTree* sub = bub;
361 int n1 = sub->NMatches("val");
362 std::vector< double > in_commod_prefs_val;
363 in_commod_prefs_val.resize(n1);
364 for (int i1 = 0; i1 < n1; ++i1) {
365 double elem;
366 {
367 double elem_in = cyclus::Query<double>(sub, "val", i1);
368 elem = elem_in;
369 }
370 in_commod_prefs_val[i1] = elem;
371 }
372 in_commod_prefs = in_commod_prefs_val;
373 }
374 } else {
375 std::vector< double > in_commod_prefs_tmp;
376 in_commod_prefs_tmp.resize(0);
377 {
378 }
379 in_commod_prefs = in_commod_prefs_tmp;
380 }
381 if (sub->NMatches("recipe_name") > 0) {
382 {
383 std::string recipe_name_val = cyclus::Query<std::string>(sub, "recipe_name");
384 recipe_name = recipe_name_val;
385 }
386 } else {
387 std::string recipe_name_tmp("");
388 recipe_name = recipe_name_tmp;
389 }
390 if (sub->NMatches("max_inv_size") > 0) {
391 {
392 double max_inv_size_val = cyclus::Query<double>(sub, "max_inv_size");
393 max_inv_size = max_inv_size_val;
394 }
395 } else {
396 double max_inv_size_tmp = 1e+299;
397 max_inv_size = max_inv_size_tmp;
398 }
399 if (sub->NMatches("capacity") > 0) {
400 {
401 double capacity_val = cyclus::Query<double>(sub, "capacity");
402 capacity = capacity_val;
403 }
404 } else {
405 double capacity_tmp = 1e+299;
406 capacity = capacity_tmp;
407 }
408 if (sub->NMatches("random_size_type") > 0) {
409 {
410 std::string random_size_type_val = cyclus::Query<std::string>(sub, "random_size_type");
411 random_size_type = random_size_type_val;
412 }
413 } else {
414 std::string random_size_type_tmp("None");
415 random_size_type = random_size_type_tmp;
416 }
417 if (sub->NMatches("random_size_mean") > 0) {
418 {
419 double random_size_mean_val = cyclus::Query<double>(sub, "random_size_mean");
420 random_size_mean = random_size_mean_val;
421 }
422 } else {
423 double random_size_mean_tmp = 1.0;
424 random_size_mean = random_size_mean_tmp;
425 }
426 if (sub->NMatches("random_size_stddev") > 0) {
427 {
428 double random_size_stddev_val = cyclus::Query<double>(sub, "random_size_stddev");
429 random_size_stddev = random_size_stddev_val;
430 }
431 } else {
432 double random_size_stddev_tmp = 0.1;
433 random_size_stddev = random_size_stddev_tmp;
434 }
435 if (sub->NMatches("random_frequency_type") > 0) {
436 {
437 std::string random_frequency_type_val = cyclus::Query<std::string>(sub, "random_frequency_type");
438 random_frequency_type = random_frequency_type_val;
439 }
440 } else {
441 std::string random_frequency_type_tmp("None");
442 random_frequency_type = random_frequency_type_tmp;
443 }
444 if (sub->NMatches("random_frequency_mean") > 0) {
445 {
446 double random_frequency_mean_val = cyclus::Query<double>(sub, "random_frequency_mean");
447 random_frequency_mean = random_frequency_mean_val;
448 }
449 } else {
450 double random_frequency_mean_tmp = 1;
451 random_frequency_mean = random_frequency_mean_tmp;
452 }
453 if (sub->NMatches("random_frequency_stddev") > 0) {
454 {
455 double random_frequency_stddev_val = cyclus::Query<double>(sub, "random_frequency_stddev");
456 random_frequency_stddev = random_frequency_stddev_val;
457 }
458 } else {
459 double random_frequency_stddev_tmp = 1;
460 random_frequency_stddev = random_frequency_stddev_tmp;
461 }
462 if (sub->NMatches("random_frequency_min") > 0) {
463 {
464 int random_frequency_min_val = cyclus::Query<int>(sub, "random_frequency_min");
465 random_frequency_min = random_frequency_min_val;
466 }
467 } else {
468 int random_frequency_min_tmp = 1;
469 random_frequency_min = random_frequency_min_tmp;
470 }
471 if (sub->NMatches("random_frequency_max") > 0) {
472 {
473 int random_frequency_max_val = cyclus::Query<int>(sub, "random_frequency_max");
474 random_frequency_max = random_frequency_max_val;
475 }
476 } else {
477 int random_frequency_max_tmp = 2147483647;
478 random_frequency_max = random_frequency_max_tmp;
479 }
480 if (sub->NMatches("keep_packaging") > 0) {
481 {
482 bool keep_packaging_val = cyclus::Query<bool>(sub, "keep_packaging");
483 keep_packaging = keep_packaging_val;
484 }
485 } else {
486 bool keep_packaging_tmp = true;
487 keep_packaging = keep_packaging_tmp;
488 }
489 di.NewDatum("Info")
490 ->AddVal("latitude", latitude, &cycpp_shape_latitude)
491 ->AddVal("longitude", longitude, &cycpp_shape_longitude)
492 ->AddVal("in_commods", in_commods, &cycpp_shape_in_commods)
493 ->AddVal("in_commod_prefs", in_commod_prefs, &cycpp_shape_in_commod_prefs)
494 ->AddVal("recipe_name", recipe_name, &cycpp_shape_recipe_name)
495 ->AddVal("max_inv_size", max_inv_size, &cycpp_shape_max_inv_size)
496 ->AddVal("capacity", capacity, &cycpp_shape_capacity)
497 ->AddVal("random_size_type", random_size_type, &cycpp_shape_random_size_type)
498 ->AddVal("random_size_mean", random_size_mean, &cycpp_shape_random_size_mean)
499 ->AddVal("random_size_stddev", random_size_stddev, &cycpp_shape_random_size_stddev)
500 ->AddVal("random_frequency_type", random_frequency_type, &cycpp_shape_random_frequency_type)
501 ->AddVal("random_frequency_mean", random_frequency_mean, &cycpp_shape_random_frequency_mean)
502 ->AddVal("random_frequency_stddev", random_frequency_stddev, &cycpp_shape_random_frequency_stddev)
503 ->AddVal("random_frequency_min", random_frequency_min, &cycpp_shape_random_frequency_min)
504 ->AddVal("random_frequency_max", random_frequency_max, &cycpp_shape_random_frequency_max)
505 ->AddVal("keep_packaging", keep_packaging, &cycpp_shape_keep_packaging)
506 ->Record();
507};
508#line 24 "/cycamore/src/sink.cc"
509
510void Sink::Snapshot(cyclus::DbInit di) {
511 di.NewDatum("Info")
512 ->AddVal("latitude", latitude, &cycpp_shape_latitude)
513 ->AddVal("longitude", longitude, &cycpp_shape_longitude)
514 ->AddVal("in_commods", in_commods, &cycpp_shape_in_commods)
515 ->AddVal("in_commod_prefs", in_commod_prefs, &cycpp_shape_in_commod_prefs)
516 ->AddVal("recipe_name", recipe_name, &cycpp_shape_recipe_name)
517 ->AddVal("max_inv_size", max_inv_size, &cycpp_shape_max_inv_size)
518 ->AddVal("capacity", capacity, &cycpp_shape_capacity)
519 ->AddVal("random_size_type", random_size_type, &cycpp_shape_random_size_type)
520 ->AddVal("random_size_mean", random_size_mean, &cycpp_shape_random_size_mean)
521 ->AddVal("random_size_stddev", random_size_stddev, &cycpp_shape_random_size_stddev)
522 ->AddVal("random_frequency_type", random_frequency_type, &cycpp_shape_random_frequency_type)
523 ->AddVal("random_frequency_mean", random_frequency_mean, &cycpp_shape_random_frequency_mean)
524 ->AddVal("random_frequency_stddev", random_frequency_stddev, &cycpp_shape_random_frequency_stddev)
525 ->AddVal("random_frequency_min", random_frequency_min, &cycpp_shape_random_frequency_min)
526 ->AddVal("random_frequency_max", random_frequency_max, &cycpp_shape_random_frequency_max)
527 ->AddVal("keep_packaging", keep_packaging, &cycpp_shape_keep_packaging)
528 ->Record();
529};
530#line 26 "/cycamore/src/sink.cc"
531
532cyclus::Inventories Sink::SnapshotInv() {
533 cyclus::Inventories invs;
534 invs["inventory"] = inventory.PopNRes(inventory.count());
535 inventory.Push(invs["inventory"]);
536 return invs;
537};
538#line 28 "/cycamore/src/sink.cc"
539
540void Sink::InitInv(cyclus::Inventories& inv) {
541 inventory.Push(inv["inventory"]);
542
543};
544#line 30 "/cycamore/src/sink.cc"
545
546cyclus::Agent* Sink::Clone() {
547 cycamore::Sink* m = new cycamore::Sink(context());
548 m->InitFrom(this);
549 return m;
550};
551#line 32 "/cycamore/src/sink.cc"
552
553void Sink::InitFrom(cyclus::QueryableBackend* b) {
554 cyclus::Facility::InitFrom(b);
555 int rawcycpp_shape_latitude[1] = {-1};
556 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
557 int rawcycpp_shape_longitude[1] = {-1};
558 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
559 int rawcycpp_shape_in_commods[2] = {-1, -1};
560 cycpp_shape_in_commods = std::vector<int>(rawcycpp_shape_in_commods, rawcycpp_shape_in_commods + 2);
561 int rawcycpp_shape_in_commod_prefs[2] = {-1, -1};
562 cycpp_shape_in_commod_prefs = std::vector<int>(rawcycpp_shape_in_commod_prefs, rawcycpp_shape_in_commod_prefs + 2);
563 int rawcycpp_shape_recipe_name[1] = {-1};
564 cycpp_shape_recipe_name = std::vector<int>(rawcycpp_shape_recipe_name, rawcycpp_shape_recipe_name + 1);
565 int rawcycpp_shape_max_inv_size[1] = {-1};
566 cycpp_shape_max_inv_size = std::vector<int>(rawcycpp_shape_max_inv_size, rawcycpp_shape_max_inv_size + 1);
567 int rawcycpp_shape_capacity[1] = {-1};
568 cycpp_shape_capacity = std::vector<int>(rawcycpp_shape_capacity, rawcycpp_shape_capacity + 1);
569 int rawcycpp_shape_inventory[2] = {-1, -1};
570 cycpp_shape_inventory = std::vector<int>(rawcycpp_shape_inventory, rawcycpp_shape_inventory + 2);
571 int rawcycpp_shape_random_size_type[1] = {-1};
572 cycpp_shape_random_size_type = std::vector<int>(rawcycpp_shape_random_size_type, rawcycpp_shape_random_size_type + 1);
573 int rawcycpp_shape_random_size_mean[1] = {-1};
574 cycpp_shape_random_size_mean = std::vector<int>(rawcycpp_shape_random_size_mean, rawcycpp_shape_random_size_mean + 1);
575 int rawcycpp_shape_random_size_stddev[1] = {-1};
576 cycpp_shape_random_size_stddev = std::vector<int>(rawcycpp_shape_random_size_stddev, rawcycpp_shape_random_size_stddev + 1);
577 int rawcycpp_shape_random_frequency_type[1] = {-1};
578 cycpp_shape_random_frequency_type = std::vector<int>(rawcycpp_shape_random_frequency_type, rawcycpp_shape_random_frequency_type + 1);
579 int rawcycpp_shape_random_frequency_mean[1] = {-1};
580 cycpp_shape_random_frequency_mean = std::vector<int>(rawcycpp_shape_random_frequency_mean, rawcycpp_shape_random_frequency_mean + 1);
581 int rawcycpp_shape_random_frequency_stddev[1] = {-1};
582 cycpp_shape_random_frequency_stddev = std::vector<int>(rawcycpp_shape_random_frequency_stddev, rawcycpp_shape_random_frequency_stddev + 1);
583 int rawcycpp_shape_random_frequency_min[1] = {-1};
584 cycpp_shape_random_frequency_min = std::vector<int>(rawcycpp_shape_random_frequency_min, rawcycpp_shape_random_frequency_min + 1);
585 int rawcycpp_shape_random_frequency_max[1] = {-1};
586 cycpp_shape_random_frequency_max = std::vector<int>(rawcycpp_shape_random_frequency_max, rawcycpp_shape_random_frequency_max + 1);
587 int rawcycpp_shape_keep_packaging[1] = {-1};
588 cycpp_shape_keep_packaging = std::vector<int>(rawcycpp_shape_keep_packaging, rawcycpp_shape_keep_packaging + 1);
589 cyclus::QueryResult qr = b->Query("Info", NULL);
590 latitude = qr.GetVal<double>("latitude");
591 longitude = qr.GetVal<double>("longitude");
592 in_commods = qr.GetVal<std::vector< std::string > >("in_commods");
593 in_commod_prefs = qr.GetVal<std::vector< double > >("in_commod_prefs");
594 recipe_name = qr.GetVal<std::string>("recipe_name");
595 max_inv_size = qr.GetVal<double>("max_inv_size");
596 capacity = qr.GetVal<double>("capacity");
597 random_size_type = qr.GetVal<std::string>("random_size_type");
598 random_size_mean = qr.GetVal<double>("random_size_mean");
599 random_size_stddev = qr.GetVal<double>("random_size_stddev");
600 random_frequency_type = qr.GetVal<std::string>("random_frequency_type");
601 random_frequency_mean = qr.GetVal<double>("random_frequency_mean");
602 random_frequency_stddev = qr.GetVal<double>("random_frequency_stddev");
603 random_frequency_min = qr.GetVal<int>("random_frequency_min");
604 random_frequency_max = qr.GetVal<int>("random_frequency_max");
605 keep_packaging = qr.GetVal<bool>("keep_packaging");
606 inventory.capacity(max_inv_size);
607};
608#line 34 "/cycamore/src/sink.cc"
609
611 cyclus::Facility::InitFrom(m);
612 int rawcycpp_shape_latitude[1] = {-1};
613 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
614 int rawcycpp_shape_longitude[1] = {-1};
615 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
616 int rawcycpp_shape_in_commods[2] = {-1, -1};
617 cycpp_shape_in_commods = std::vector<int>(rawcycpp_shape_in_commods, rawcycpp_shape_in_commods + 2);
618 int rawcycpp_shape_in_commod_prefs[2] = {-1, -1};
619 cycpp_shape_in_commod_prefs = std::vector<int>(rawcycpp_shape_in_commod_prefs, rawcycpp_shape_in_commod_prefs + 2);
620 int rawcycpp_shape_recipe_name[1] = {-1};
621 cycpp_shape_recipe_name = std::vector<int>(rawcycpp_shape_recipe_name, rawcycpp_shape_recipe_name + 1);
622 int rawcycpp_shape_max_inv_size[1] = {-1};
623 cycpp_shape_max_inv_size = std::vector<int>(rawcycpp_shape_max_inv_size, rawcycpp_shape_max_inv_size + 1);
624 int rawcycpp_shape_capacity[1] = {-1};
625 cycpp_shape_capacity = std::vector<int>(rawcycpp_shape_capacity, rawcycpp_shape_capacity + 1);
626 int rawcycpp_shape_inventory[2] = {-1, -1};
627 cycpp_shape_inventory = std::vector<int>(rawcycpp_shape_inventory, rawcycpp_shape_inventory + 2);
628 int rawcycpp_shape_random_size_type[1] = {-1};
629 cycpp_shape_random_size_type = std::vector<int>(rawcycpp_shape_random_size_type, rawcycpp_shape_random_size_type + 1);
630 int rawcycpp_shape_random_size_mean[1] = {-1};
631 cycpp_shape_random_size_mean = std::vector<int>(rawcycpp_shape_random_size_mean, rawcycpp_shape_random_size_mean + 1);
632 int rawcycpp_shape_random_size_stddev[1] = {-1};
633 cycpp_shape_random_size_stddev = std::vector<int>(rawcycpp_shape_random_size_stddev, rawcycpp_shape_random_size_stddev + 1);
634 int rawcycpp_shape_random_frequency_type[1] = {-1};
635 cycpp_shape_random_frequency_type = std::vector<int>(rawcycpp_shape_random_frequency_type, rawcycpp_shape_random_frequency_type + 1);
636 int rawcycpp_shape_random_frequency_mean[1] = {-1};
637 cycpp_shape_random_frequency_mean = std::vector<int>(rawcycpp_shape_random_frequency_mean, rawcycpp_shape_random_frequency_mean + 1);
638 int rawcycpp_shape_random_frequency_stddev[1] = {-1};
639 cycpp_shape_random_frequency_stddev = std::vector<int>(rawcycpp_shape_random_frequency_stddev, rawcycpp_shape_random_frequency_stddev + 1);
640 int rawcycpp_shape_random_frequency_min[1] = {-1};
641 cycpp_shape_random_frequency_min = std::vector<int>(rawcycpp_shape_random_frequency_min, rawcycpp_shape_random_frequency_min + 1);
642 int rawcycpp_shape_random_frequency_max[1] = {-1};
643 cycpp_shape_random_frequency_max = std::vector<int>(rawcycpp_shape_random_frequency_max, rawcycpp_shape_random_frequency_max + 1);
644 int rawcycpp_shape_keep_packaging[1] = {-1};
645 cycpp_shape_keep_packaging = std::vector<int>(rawcycpp_shape_keep_packaging, rawcycpp_shape_keep_packaging + 1);
646 latitude = m->latitude;
647 longitude = m->longitude;
652 capacity = m->capacity;
662 inventory.capacity(m->inventory.capacity());
663};
664#line 38 "/cycamore/src/sink.cc"
665
666// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
668 cyclus::Facility::EnterNotify();
669 LOG(cyclus::LEV_INFO4, "SnkFac") << " using random behavior " << random_size_type;
670
671 inventory.keep_packaging(keep_packaging);
672
673 if (in_commod_prefs.size() == 0) {
674 for (int i = 0; i < in_commods.size(); ++i) {
675 in_commod_prefs.push_back(cyclus::kDefaultPref);
676 }
677 } else if (in_commod_prefs.size() != in_commods.size()) {
678 std::stringstream ss;
679 ss << "in_commod_prefs has " << in_commod_prefs.size()
680 << " values, expected " << in_commods.size();
681 throw cyclus::ValueError(ss.str());
682 }
687
688 if (random_size_type != "None") {
689 LOG(cyclus::LEV_INFO4, "SnkFac") << "Sink " << this->id()
690 << " is using random behavior "
692 << " for determining request size.";
693 }
694 if (random_frequency_type != "None") {
695 LOG(cyclus::LEV_INFO4, "SnkFac") << "Sink " << this->id()
696 << " is using random behavior "
698 << " for determining request frequency.";
699 }
700
701 InitializePosition();
702}
703
704// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
705std::string Sink::str() {
706 using std::string;
707 using std::vector;
708 std::stringstream ss;
709 ss << cyclus::Facility::str();
710
711 string msg = "";
712 msg += "accepts commodities ";
713 for (vector<string>::iterator commod = in_commods.begin();
714 commod != in_commods.end();
715 commod++) {
716 msg += (commod == in_commods.begin() ? "{" : ", ");
717 msg += (*commod);
718 }
719 msg += "} until its inventory is full at ";
720 ss << msg << inventory.capacity() << " kg.";
721 return "" + ss.str();
722}
723
724// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
725std::set<cyclus::RequestPortfolio<cyclus::Material>::Ptr>
727 using cyclus::Material;
728 using cyclus::RequestPortfolio;
729 using cyclus::Request;
730 using cyclus::Composition;
731
732 std::set<RequestPortfolio<Material>::Ptr> ports;
733 RequestPortfolio<Material>::Ptr port(new RequestPortfolio<Material>());
734 Material::Ptr mat;
735
737 if (requestAmt > SpaceAvailable()) {
739 }
740
741 if (recipe_name.empty()) {
742 mat = cyclus::NewBlankMaterial(requestAmt);
743 } else {
744 Composition::Ptr rec = this->context()->GetRecipe(recipe_name);
745 mat = cyclus::Material::CreateUntracked(requestAmt, rec);
746 }
747
748 if (requestAmt > cyclus::eps()) {
749 std::vector<Request<Material>*> mutuals;
750 for (int i = 0; i < in_commods.size(); i++) {
751 mutuals.push_back(port->AddRequest(mat, this, in_commods[i], in_commod_prefs[i]));
752
753 }
754 port->AddMutualReqs(mutuals);
755 ports.insert(port);
756 } // if amt > eps
757 return ports;
758}
759
760// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
761std::set<cyclus::RequestPortfolio<cyclus::Product>::Ptr>
763 using cyclus::CapacityConstraint;
764 using cyclus::Product;
765 using cyclus::RequestPortfolio;
766
767 std::set<RequestPortfolio<Product>::Ptr> ports;
768 RequestPortfolio<Product>::Ptr
769 port(new RequestPortfolio<Product>());
770
771 if (requestAmt > cyclus::eps()) {
772 CapacityConstraint<Product> cc(requestAmt);
773 port->AddConstraint(cc);
774
775 std::vector<std::string>::const_iterator it;
776 for (it = in_commods.begin(); it != in_commods.end(); ++it) {
777 std::string quality = ""; // not clear what this should be..
778 Product::Ptr rsrc = Product::CreateUntracked(requestAmt, quality);
779 port->AddRequest(rsrc, this, *it);
780 }
781
782 ports.insert(port);
783 } // if amt > eps
784 return ports;
785}
786
787// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
789 const std::vector< std::pair<cyclus::Trade<cyclus::Material>,
790 cyclus::Material::Ptr> >& responses) {
791 std::vector< std::pair<cyclus::Trade<cyclus::Material>,
792 cyclus::Material::Ptr> >::const_iterator it;
793 for (it = responses.begin(); it != responses.end(); ++it) {
794 inventory.Push(it->second);
795 }
796}
797
798// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
800 const std::vector< std::pair<cyclus::Trade<cyclus::Product>,
801 cyclus::Product::Ptr> >& responses) {
802 std::vector< std::pair<cyclus::Trade<cyclus::Product>,
803 cyclus::Product::Ptr> >::const_iterator it;
804 for (it = responses.begin(); it != responses.end(); ++it) {
805 inventory.Push(it->second);
806 }
807}
808
809// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
811 using std::string;
812 using std::vector;
813 LOG(cyclus::LEV_INFO3, "SnkFac") << "Sink " << this->id() << " is ticking {";
814
815 if (nextBuyTime == -1) {
817 }
818 else if (nextBuyTime == context()->time()) {
821
822 LOG(cyclus::LEV_INFO4, "SnkFac") << "Sink " << this->id()
823 << " has reached buying time. The next buy time will be time step " << nextBuyTime;
824 }
825 else {
826 requestAmt = 0;
827 }
828
829 // inform the simulation about what the sink facility will be requesting
830 if (requestAmt > cyclus::eps()) {
831 LOG(cyclus::LEV_INFO4, "SnkFac") << "Sink " << this->id()
832 << " has request amount " << requestAmt
833 << " kg of " << in_commods[0] << ".";
834 for (vector<string>::iterator commod = in_commods.begin();
835 commod != in_commods.end();
836 commod++) {
837 LOG(cyclus::LEV_INFO4, "SnkFac") << "Sink " << this->id()
838 << " will request " << requestAmt
839 << " kg of " << *commod << ".";
840 cyclus::toolkit::RecordTimeSeries<double>("demand"+*commod, this,
841 requestAmt);
842 }
843 }
844 LOG(cyclus::LEV_INFO3, "SnkFac") << "}";
845}
846
847// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
849 LOG(cyclus::LEV_INFO3, "SnkFac") << prototype() << " is tocking {";
850
851 // On the tock, the sink facility doesn't really do much.
852 // Maybe someday it will record things.
853 // For now, lets just print out what we have at each timestep.
854 LOG(cyclus::LEV_INFO4, "SnkFac") << "Sink " << this->id()
855 << " is holding " << inventory.quantity()
856 << " units of material at the close of timestep "
857 << context()->time() << ".";
858 LOG(cyclus::LEV_INFO3, "SnkFac") << "}";
859}
860
862 double amt = SpaceAvailable();
863 if (amt < cyclus::eps()) {
864 requestAmt = 0;
865 }
866
867 if (random_size_type == "None") {
868 requestAmt = amt;
869 }
870 else if (random_size_type == "UniformReal") {
871 requestAmt = context()->random_uniform_real(0, amt);
872 }
873 else if (random_size_type == "NormalReal") {
874 requestAmt = context()->random_normal_real(amt * random_size_mean,
875 amt * random_size_stddev,
876 0, amt);
877 }
878 else {
879 requestAmt = amt;
880 }
881 return;
882}
883
885 if (random_frequency_type == "None") {
886 nextBuyTime = -1;
887 }
888 else if (random_frequency_type == "UniformInt") {
889 nextBuyTime = context()->time() + context()->random_uniform_int(random_frequency_min, random_frequency_max);
890 }
891 else if (random_frequency_type == "NormalInt") {
892 nextBuyTime = context()->time() + context()->random_normal_int(random_frequency_mean, random_frequency_stddev, random_frequency_min, random_frequency_max);
893 }
894 else {
895 nextBuyTime = -1;
896 }
897 return;
898}
899
900// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
901extern "C" cyclus::Agent* ConstructSink(cyclus::Context* ctx) {
902 return new Sink(ctx);
903}
904
905} // namespace cycamore
This facility acts as a sink of materials and products with a fixed throughput (per time step) capaci...
cyclus::toolkit::ResBuf< cyclus::Resource > inventory
this facility holds material in storage.
std::vector< int > cycpp_shape_random_frequency_mean
virtual Json::Value annotations()
Sink(cyclus::Context *ctx)
virtual void SetRequestAmt()
SinkFacilities update request amount using random behavior.
virtual void InitFrom(cycamore::Sink *m)
virtual void EnterNotify()
std::vector< int > cycpp_shape_random_frequency_stddev
std::vector< int > cycpp_shape_random_frequency_max
std::vector< std::string > in_commods
all facilities must have at least one input commodity
virtual void AcceptMatlTrades(const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
SinkFacilities place accepted trade Materials in their Inventory.
std::vector< double > in_commod_prefs
std::string random_frequency_type
std::vector< int > cycpp_shape_random_frequency_type
virtual void InitInv(cyclus::Inventories &inv)
std::vector< int > cycpp_shape_in_commod_prefs
void SetMaxInventorySize(double size)
sets the size of the storage inventory for received material
std::vector< int > cycpp_shape_in_commods
std::vector< int > cycpp_shape_keep_packaging
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > GetMatlRequests()
SinkFacilities request Materials of their given commodity.
std::string random_size_type
random status (size of request)
double capacity
monthly acceptance capacity
double SpaceAvailable() const
determines the amount to request
std::vector< int > cycpp_shape_capacity
virtual std::string schema()
virtual cyclus::Inventories SnapshotInv()
std::vector< int > cycpp_shape_random_size_mean
double max_inv_size
max inventory size
virtual std::set< cyclus::RequestPortfolio< cyclus::Product >::Ptr > GetGenRsrcRequests()
SinkFacilities request Products of their given commodity.
virtual void Snapshot(cyclus::DbInit di)
std::vector< int > cycpp_shape_random_size_type
virtual void SetNextBuyTime()
SinkFacilities update request time using random behavior.
virtual void AcceptGenRsrcTrades(const std::vector< std::pair< cyclus::Trade< cyclus::Product >, cyclus::Product::Ptr > > &responses)
SinkFacilities place accepted trade Materials in their Inventory.
virtual std::string str()
virtual void InfileToDb(cyclus::InfileTree *tree, cyclus::DbInit di)
std::vector< int > cycpp_shape_random_size_stddev
std::vector< int > cycpp_shape_inventory
std::vector< int > cycpp_shape_random_frequency_min
virtual cyclus::Agent * Clone()
std::vector< int > cycpp_shape_recipe_name
std::vector< int > cycpp_shape_max_inv_size
cyclus::Agent * ConstructSink(cyclus::Context *ctx)