CYCAMORE
Loading...
Searching...
No Matches
build/cycamore/storage.cc
Go to the documentation of this file.
1#line 1 "/cycamore/src/storage.cc"
2// storage.cc
3// Implements the Storage class
4#include "storage.h"
5
6namespace cycamore {
7
8// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9Storage::Storage(cyclus::Context* ctx)
10 : cyclus::Facility(ctx),
11 latitude(0.0),
12 longitude(0.0),
14 inventory_tracker.Init({&inventory, &stocks, &ready, &processing}, cyclus::CY_LARGE_DOUBLE);
15 cyclus::Warn<cyclus::EXPERIMENTAL_WARNING>(
16 "The Storage Facility is experimental.");};
17
18// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
19// pragmas
20
21std::string Storage::schema() {
22 return ""
23 "<interleave>\n"
24 " <element name=\"in_commods\">\n"
25 " <oneOrMore>\n"
26 " <element name=\"val\">\n"
27 " <data type=\"string\"/>\n"
28 " </element>\n"
29 " </oneOrMore>\n"
30 " </element>\n"
31 " <optional>\n"
32 " <element name=\"in_commod_prefs\">\n"
33 " <oneOrMore>\n"
34 " <element name=\"val\">\n"
35 " <data type=\"double\"/>\n"
36 " </element>\n"
37 " </oneOrMore>\n"
38 " </element>\n"
39 " </optional>\n"
40 " <element name=\"out_commods\">\n"
41 " <oneOrMore>\n"
42 " <element name=\"val\">\n"
43 " <data type=\"string\"/>\n"
44 " </element>\n"
45 " </oneOrMore>\n"
46 " </element>\n"
47 " <optional>\n"
48 " <element name=\"in_recipe\">\n"
49 " <data type=\"string\"/>\n"
50 " </element>\n"
51 " </optional>\n"
52 " <optional>\n"
53 " <element name=\"residence_time\">\n"
54 " <data type=\"int\"/>\n"
55 " </element>\n"
56 " </optional>\n"
57 " <optional>\n"
58 " <element name=\"sell_quantity\">\n"
59 " <data type=\"double\"/>\n"
60 " </element>\n"
61 " </optional>\n"
62 " <optional>\n"
63 " <element name=\"throughput\">\n"
64 " <data type=\"double\"/>\n"
65 " </element>\n"
66 " </optional>\n"
67 " <optional>\n"
68 " <element name=\"max_inv_size\">\n"
69 " <data type=\"double\"/>\n"
70 " </element>\n"
71 " </optional>\n"
72 " <optional>\n"
73 " <element name=\"discrete_handling\">\n"
74 " <data type=\"boolean\"/>\n"
75 " </element>\n"
76 " </optional>\n"
77 " <optional>\n"
78 " <element name=\"active_buying_frequency_type\">\n"
79 " <data type=\"string\"/>\n"
80 " </element>\n"
81 " </optional>\n"
82 " <optional>\n"
83 " <element name=\"active_buying_val\">\n"
84 " <data type=\"int\"/>\n"
85 " </element>\n"
86 " </optional>\n"
87 " <optional>\n"
88 " <element name=\"active_buying_min\">\n"
89 " <data type=\"int\"/>\n"
90 " </element>\n"
91 " </optional>\n"
92 " <optional>\n"
93 " <element name=\"active_buying_max\">\n"
94 " <data type=\"int\"/>\n"
95 " </element>\n"
96 " </optional>\n"
97 " <optional>\n"
98 " <element name=\"active_buying_mean\">\n"
99 " <data type=\"double\"/>\n"
100 " </element>\n"
101 " </optional>\n"
102 " <optional>\n"
103 " <element name=\"active_buying_stddev\">\n"
104 " <data type=\"double\"/>\n"
105 " </element>\n"
106 " </optional>\n"
107 " <optional>\n"
108 " <element name=\"dormant_buying_frequency_type\">\n"
109 " <data type=\"string\"/>\n"
110 " </element>\n"
111 " </optional>\n"
112 " <optional>\n"
113 " <element name=\"dormant_buying_val\">\n"
114 " <data type=\"int\"/>\n"
115 " </element>\n"
116 " </optional>\n"
117 " <optional>\n"
118 " <element name=\"dormant_buying_min\">\n"
119 " <data type=\"int\"/>\n"
120 " </element>\n"
121 " </optional>\n"
122 " <optional>\n"
123 " <element name=\"dormant_buying_max\">\n"
124 " <data type=\"int\"/>\n"
125 " </element>\n"
126 " </optional>\n"
127 " <optional>\n"
128 " <element name=\"dormant_buying_mean\">\n"
129 " <data type=\"double\"/>\n"
130 " </element>\n"
131 " </optional>\n"
132 " <optional>\n"
133 " <element name=\"dormant_buying_stddev\">\n"
134 " <data type=\"double\"/>\n"
135 " </element>\n"
136 " </optional>\n"
137 " <optional>\n"
138 " <element name=\"buying_size_type\">\n"
139 " <data type=\"string\"/>\n"
140 " </element>\n"
141 " </optional>\n"
142 " <optional>\n"
143 " <element name=\"buying_size_val\">\n"
144 " <data type=\"double\"/>\n"
145 " </element>\n"
146 " </optional>\n"
147 " <optional>\n"
148 " <element name=\"buying_size_min\">\n"
149 " <data type=\"double\"/>\n"
150 " </element>\n"
151 " </optional>\n"
152 " <optional>\n"
153 " <element name=\"buying_size_max\">\n"
154 " <data type=\"double\"/>\n"
155 " </element>\n"
156 " </optional>\n"
157 " <optional>\n"
158 " <element name=\"buying_size_mean\">\n"
159 " <data type=\"double\"/>\n"
160 " </element>\n"
161 " </optional>\n"
162 " <optional>\n"
163 " <element name=\"buying_size_stddev\">\n"
164 " <data type=\"double\"/>\n"
165 " </element>\n"
166 " </optional>\n"
167 " <optional>\n"
168 " <element name=\"reorder_point\">\n"
169 " <data type=\"double\"/>\n"
170 " </element>\n"
171 " </optional>\n"
172 " <optional>\n"
173 " <element name=\"reorder_quantity\">\n"
174 " <data type=\"double\"/>\n"
175 " </element>\n"
176 " </optional>\n"
177 " <optional>\n"
178 " <element name=\"cumulative_cap\">\n"
179 " <data type=\"double\"/>\n"
180 " </element>\n"
181 " </optional>\n"
182 " <optional>\n"
183 " <element name=\"package\">\n"
184 " <data type=\"string\"/>\n"
185 " </element>\n"
186 " </optional>\n"
187 " <optional>\n"
188 " <element name=\"transport_unit\">\n"
189 " <data type=\"string\"/>\n"
190 " </element>\n"
191 " </optional>\n"
192 " <optional>\n"
193 " <element name=\"latitude\">\n"
194 " <data type=\"double\"/>\n"
195 " </element>\n"
196 " </optional>\n"
197 " <optional>\n"
198 " <element name=\"longitude\">\n"
199 " <data type=\"double\"/>\n"
200 " </element>\n"
201 " </optional>\n"
202 "</interleave>\n";
203};
204#line 21 "/cycamore/src/storage.cc"
205
206Json::Value Storage::annotations() {
207 Json::Value root;
208 Json::Reader reader;
209 bool parsed_ok = reader.parse(
210 "{\"name\":\"cycamore::Storage\",\"entity\":\"facility\",\"p"
211 "arents\":[\"cyclus::Facility\",\"cyclus::toolkit::Comm"
212 "odityProducer\",\"cyclus::toolkit::Position\"],\"all_p"
213 "arents\":[\"cyclus::Agent\",\"cyclus::Facility\",\"cyclu"
214 "s::Ider\",\"cyclus::StateWrangler\",\"cyclus::TimeList"
215 "ener\",\"cyclus::Trader\",\"cyclus::toolkit::AgentMana"
216 "ged\",\"cyclus::toolkit::CommodityProducer\",\"cyclus:"
217 ":toolkit::Position\"],\"vars\":{\"in_commods\":{\"toolti"
218 "p\":[\"input commodity\",\"\"],\"doc\":\"commodities "
219 "accepted by this facility\",\"uilabel\":[\"Input Commo"
220 "dities\",\"\"],\"uitype\":[\"oneormore\",\"incommodity\"],\""
221 "type\":[\"std::vector\",\"std::string\"],\"index\":0,\"sha"
222 "pe\":[-1,-"
223 "1],\"alias\":[\"in_commods\",\"val\"]},\"in_commod_prefs\""
224 ":{\"default\":[],\"doc\":\"preferences for each of the "
225 "given commodities, in the same order.Defauts to 1 "
226 "if unspecified\",\"uilabel\":[\"In Commody Preferences"
227 "\",\"\"],\"range\":[null,[1e-"
228 "08,1e+299]],\"uitype\":[\"oneormore\",\"range\"],\"type\":"
229 "[\"std::vector\",\"double\"],\"index\":1,\"shape\":[-1,-"
230 "1],\"alias\":[\"in_commod_prefs\",\"val\"],\"tooltip\":[\"i"
231 "n_commod_prefs\",\"\"]},\"out_commods\":{\"tooltip\":[\"ou"
232 "tput commodity\",\"\"],\"doc\":\"commodity produced by "
233 "this facility. Multiple commodity tracking is "
234 "currently not supported, one output commodity "
235 "catches all input commodities.\",\"uilabel\":[\"Output"
236 " Commodities\",\"\"],\"uitype\":[\"oneormore\",\"outcommod"
237 "ity\"],\"type\":[\"std::vector\",\"std::string\"],\"index\""
238 ":2,\"shape\":[-1,-"
239 "1],\"alias\":[\"out_commods\",\"val\"]},\"in_recipe\":{\"de"
240 "fault\":\"\",\"tooltip\":\"input recipe\",\"doc\":\"recipe "
241 "accepted by this facility, if unspecified a dummy "
242 "recipe is used\",\"uilabel\":\"Input Recipe\",\"uitype\":"
243 "\"inrecipe\",\"type\":\"std::string\",\"index\":3,\"shape\":"
244 "[-"
245 "1],\"alias\":\"in_recipe\"},\"residence_time\":{\"default"
246 "\":0,\"tooltip\":\"residence time "
247 "(timesteps)\",\"doc\":\"the minimum holding time for a"
248 " received commodity (timesteps).\",\"units\":\"time "
249 "steps\",\"uilabel\":\"Residence Time\",\"uitype\":\"range\""
250 ",\"range\":[0,12000],\"type\":\"int\",\"index\":4,\"shape\":"
251 "[-"
252 "1],\"alias\":\"residence_time\"},\"sell_quantity\":{\"def"
253 "ault\":0,\"tooltip\":\"sell quantity "
254 "(kg)\",\"doc\":\"material will be sold in integer "
255 "multiples of this quantity. If the buffer contains"
256 " less than the sell quantity, no material will be "
257 "offered\",\"uilabel\":\"Sell Quantity\",\"uitype\":\"range"
258 "\",\"range\":[0.0,1e+299],\"units\":\"kg\",\"type\":\"double"
259 "\",\"index\":5,\"shape\":[-"
260 "1],\"alias\":\"sell_quantity\"},\"throughput\":{\"default"
261 "\":1e+299,\"tooltip\":\"throughput per timestep "
262 "(kg)\",\"doc\":\"the max amount that can be moved "
263 "through the facility per timestep (kg)\",\"uilabel\":"
264 "\"Throughput\",\"uitype\":\"range\",\"range\":[0.0,1e+299]"
265 ",\"units\":\"kg\",\"type\":\"double\",\"index\":6,\"shape\":[-"
266 "1],\"alias\":\"throughput\"},\"max_inv_size\":{\"default\""
267 ":1e+299,\"tooltip\":\"maximum inventory size "
268 "(kg)\",\"doc\":\"the maximum amount of material that "
269 "can be in all storage buffer "
270 "stages\",\"uilabel\":\"Maximum Inventory Size\",\"uitype"
271 "\":\"range\",\"range\":[0.0,1e+299],\"units\":\"kg\",\"type\""
272 ":\"double\",\"index\":7,\"shape\":[-"
273 "1],\"alias\":\"max_inv_size\"},\"discrete_handling\":{\"d"
274 "efault\":false,\"tooltip\":\"Bool to determine how "
275 "Storage handles batches\",\"doc\":\"Determines if "
276 "Storage will divide resource objects. Only "
277 "controls material handling within this facility, "
278 "has no effect on DRE material handling. If true, "
279 "batches are handled as discrete quanta, neither "
280 "split nor combined. Otherwise, batches may be "
281 "divided during processing. Default to false "
282 "(continuous))\",\"uilabel\":\"Batch Handling\",\"type\":\""
283 "bool\",\"index\":8,\"shape\":[-"
284 "1],\"alias\":\"discrete_handling\"},\"active_buying_fre"
285 "quency_type\":{\"default\":\"Fixed\",\"tooltip\":\"Type of"
286 " active buying frequency\",\"doc\":\"Options: Fixed, "
287 "Uniform, Normal. Fixed requires active_buying_val."
288 " Uniform requires active_buying_min and "
289 "active_buying_max. Normal requires "
290 "active_buying_mean and active_buying_std, with "
291 "optional active_buying_min and active_buying_max.\""
292 ",\"uitype\":\"combobox\",\"categorical\":[\"Fixed\",\"Unifo"
293 "rm\",\"Normal\"],\"uilabel\":\"Active Buying Frequency T"
294 "ype\",\"type\":\"std::string\",\"index\":9,\"shape\":[-"
295 "1],\"alias\":\"active_buying_frequency_type\"},\"active"
296 "_buying_val\":{\"default\":-1,\"tooltip\":\"Fixed active"
297 " buying frequency\",\"doc\":\"The length in time steps"
298 " of the active buying period. Required for fixed "
299 "active_buying_frequency_type. Must be greater than"
300 " or equal to 1 (i.e., agent cannot always be dorma"
301 "nt)\",\"uitype\":\"range\",\"range\":[1,2147483647],\"uila"
302 "bel\":\"Active Buying Frequency Value\",\"type\":\"int\","
303 "\"index\":10,\"shape\":[-"
304 "1],\"alias\":\"active_buying_val\"},\"active_buying_min"
305 "\":{\"default\":-1,\"tooltip\":\"Active buying "
306 "distribution minimum\",\"doc\":\"The minimum length in"
307 " time steps of the active buying period. Required "
308 "for Uniform and optional for Normal "
309 "active_buying_frequency_type. Must be greater than"
310 " or equal to 1 \",\"uitype\":\"range\",\"range\":[1,21474"
311 "83647],\"uilabel\":\"Active Buying Frequency Minimum\""
312 ",\"type\":\"int\",\"index\":11,\"shape\":[-"
313 "1],\"alias\":\"active_buying_min\"},\"active_buying_max"
314 "\":{\"default\":-1,\"tooltip\":\"Active buying "
315 "distribution maximum\",\"doc\":\"The maximum length in"
316 " time steps of the active buying period. Required "
317 "for Uniform active_buying_frequency_type, optional"
318 " for Normal. Must be greater than or equal to "
319 "active_buying_min \",\"uitype\":\"range\",\"range\":[1,21"
320 "47483647],\"uilabel\":\"Active Buying Frequency Maxim"
321 "um\",\"type\":\"int\",\"index\":12,\"shape\":[-"
322 "1],\"alias\":\"active_buying_max\"},\"active_buying_mea"
323 "n\":{\"default\":-1,\"tooltip\":\"Active buying "
324 "distribution mean\",\"doc\":\"The mean length in time "
325 "steps of the active buying period. Required for "
326 "Normal active_buying_frequency_type. Must be "
327 "greater than or equal to 1 \",\"uitype\":\"range\",\"ran"
328 "ge\":[1.0,1e+299],\"uilabel\":\"Active Buying "
329 "Frequency Mean\",\"type\":\"double\",\"index\":13,\"shape\""
330 ":[-"
331 "1],\"alias\":\"active_buying_mean\"},\"active_buying_st"
332 "ddev\":{\"default\":-1,\"tooltip\":\"Active buying "
333 "distribution standard deviation\",\"doc\":\"The "
334 "standard deviation of the length in time steps of "
335 "the active buying period. Required for Normal "
336 "active_buying_frequency_type. Must be greater than"
337 " or equal to 0 \",\"uitype\":\"range\",\"range\":[0.0,1e+"
338 "299],\"uilabel\":\"Active Buying Frequency Standard D"
339 "eviation\",\"type\":\"double\",\"index\":14,\"shape\":[-"
340 "1],\"alias\":\"active_buying_stddev\"},\"dormant_buying"
341 "_frequency_type\":{\"default\":\"Fixed\",\"tooltip\":\"Typ"
342 "e of dormant buying frequency\",\"doc\":\"Options: "
343 "Fixed, Uniform, Normal. Fixed requires "
344 "dormant_buying_val. Uniform requires "
345 "dormant_buying_min and dormant_buying_max. Normal "
346 "requires dormant_buying_mean and "
347 "dormant_buying_std, with optional "
348 "dormant_buying_min and dormant_buying_max.\",\"uityp"
349 "e\":\"combobox\",\"categorical\":[\"Fixed\",\"Uniform\",\"No"
350 "rmal\"],\"uilabel\":\"Dormant Buying Frequency Type\",\""
351 "type\":\"std::string\",\"index\":15,\"shape\":[-"
352 "1],\"alias\":\"dormant_buying_frequency_type\"},\"dorma"
353 "nt_buying_val\":{\"default\":-1,\"tooltip\":\"Fixed "
354 "dormant buying frequency\",\"doc\":\"The length in "
355 "time steps of the dormant buying period. Required "
356 "for fixed dormant_buying_frequency_type. Default "
357 "is -1, agent has no dormant period and stays activ"
358 "e.\",\"uitype\":\"range\",\"range\":[-"
359 "1,2147483647],\"uilabel\":\"Dormant Buying Frequency "
360 "Value\",\"type\":\"int\",\"index\":16,\"shape\":[-"
361 "1],\"alias\":\"dormant_buying_val\"},\"dormant_buying_m"
362 "in\":{\"default\":-1,\"tooltip\":\"Dormant buying "
363 "distribution minimum\",\"doc\":\"The minimum length in"
364 " time steps of the dormant buying period. Required"
365 " for Uniform and optional for Normal dormant_buyin"
366 "g_frequency_type.\",\"uitype\":\"range\",\"range\":[0,214"
367 "7483647],\"uilabel\":\"Dormant Buying Frequency Minim"
368 "um\",\"type\":\"int\",\"index\":17,\"shape\":[-"
369 "1],\"alias\":\"dormant_buying_min\"},\"dormant_buying_m"
370 "ax\":{\"default\":-1,\"tooltip\":\"Dormant buying "
371 "distribution maximum\",\"doc\":\"The maximum length in"
372 " time steps of the dormant buying period. Required"
373 " for Uniform dormant_buying_frequency_type, "
374 "optional for Normal. Must be greater than or equal"
375 " to dormant_buying_min \",\"uitype\":\"range\",\"range\":"
376 "[0,2147483647],\"uilabel\":\"Dormant Buying Frequency"
377 " Maximum\",\"type\":\"int\",\"index\":18,\"shape\":[-"
378 "1],\"alias\":\"dormant_buying_max\"},\"dormant_buying_m"
379 "ean\":{\"default\":-1,\"tooltip\":\"Dormant buying "
380 "distribution mean\",\"doc\":\"The mean length in time "
381 "steps of the dormant buying period. Required for "
382 "Normal dormant_buying_frequency_type. Must be "
383 "greater than or equal to 0 \",\"uitype\":\"range\",\"ran"
384 "ge\":[0.0,1e+299],\"uilabel\":\"Dormant Buying "
385 "Frequency Mean\",\"type\":\"double\",\"index\":19,\"shape\""
386 ":[-"
387 "1],\"alias\":\"dormant_buying_mean\"},\"dormant_buying_"
388 "stddev\":{\"default\":-1,\"tooltip\":\"Dormant buying "
389 "distribution standard deviation\",\"doc\":\"The "
390 "standard deviation of the length in time steps of "
391 "the dormant buying period. Required for Normal "
392 "dormant_buying_frequency_type. Must be greater "
393 "than or equal to 0 \",\"uitype\":\"range\",\"range\":[0.0"
394 ",1e+299],\"uilabel\":\"Dormant Buying Frequency "
395 "Standard Deviation\",\"type\":\"double\",\"index\":20,\"sh"
396 "ape\":[-"
397 "1],\"alias\":\"dormant_buying_stddev\"},\"buying_size_t"
398 "ype\":{\"default\":\"Fixed\",\"tooltip\":\"Type of "
399 "behavior used to determine size of buy "
400 "request\",\"doc\":\"Behavior function used to "
401 "determine the size of requests made. All values "
402 "are a fraction of maximum capacity, determined by "
403 "the throughput and capacity remaining. Options: "
404 "Fixed, Uniform, Normal. Fixed is default behavior."
405 " Uniform requires buying_size_min and "
406 "buying_size_max. Normal requires buying_size_mean "
407 "and buying_size_stddev, optional buying_size_min "
408 "and buying_size_max.\",\"uitype\":\"combobox\",\"categor"
409 "ical\":[\"Fixed\",\"Uniform\",\"Normal\"],\"uilabel\":\"Buyi"
410 "ng Size Type\",\"type\":\"std::string\",\"index\":21,\"sha"
411 "pe\":[-"
412 "1],\"alias\":\"buying_size_type\"},\"buying_size_val\":{"
413 "\"default\":1.0,\"tooltip\":\"Fixed buying "
414 "size\",\"doc\":\"The size of the buy request as a "
415 "fraction of maximum capacity. Optional for Fixed "
416 "buying_size_type. Must be greater than or equal to"
417 " 0.0\",\"uitype\":\"range\",\"range\":[0.0,1.0],\"uilabel\""
418 ":\"Buying Size Value\",\"type\":\"double\",\"index\":22,\"s"
419 "hape\":[-"
420 "1],\"alias\":\"buying_size_val\"},\"buying_size_min\":{\""
421 "default\":-1.0,\"tooltip\":\"Buying size distribution "
422 "minimum\",\"doc\":\"The minimum size of the buy "
423 "request as a fraction of maximum capacity. "
424 "Required for Uniform and optional for Normal "
425 "buying_size_type. Must be greater than or equal to"
426 " zero.\",\"uitype\":\"range\",\"range\":[0.0,1.0],\"uilabe"
427 "l\":\"Buying Size Minimum\",\"type\":\"double\",\"index\":2"
428 "3,\"shape\":[-"
429 "1],\"alias\":\"buying_size_min\"},\"buying_size_max\":{\""
430 "default\":-1.0,\"tooltip\":\"Buying size distribution "
431 "maximum\",\"doc\":\"The maximum size of the buy "
432 "request as a fraction of maximum capacity. "
433 "Required for Uniform buying_size_type, optional "
434 "for Normal. Must be greater than or equal to "
435 "buying_size_min \",\"uitype\":\"range\",\"range\":[0.0,1."
436 "0],\"uilabel\":\"Buying Size Maximum\",\"type\":\"double\""
437 ",\"index\":24,\"shape\":[-"
438 "1],\"alias\":\"buying_size_max\"},\"buying_size_mean\":{"
439 "\"default\":-1.0,\"tooltip\":\"Buying size distribution"
440 " mean\",\"doc\":\"The mean size of the buy request as "
441 "a fraction of maximum capacity. Required for "
442 "Normal buying_size_type.\",\"uitype\":\"range\",\"range\""
443 ":[0.0,1.0],\"uilabel\":\"Buying Size Mean\",\"type\":\"do"
444 "uble\",\"index\":25,\"shape\":[-"
445 "1],\"alias\":\"buying_size_mean\"},\"buying_size_stddev"
446 "\":{\"default\":-1.0,\"tooltip\":\"Buying size "
447 "distribution standard deviation\",\"doc\":\"The "
448 "standard deviation of the size of the buy request "
449 "as a fraction of maximum capacity. Required for "
450 "Normal buying_size_type.\",\"uitype\":\"range\",\"range\""
451 ":[0.0,1.0],\"uilabel\":\"Buying Size Standard Deviati"
452 "on\",\"type\":\"double\",\"index\":26,\"shape\":[-"
453 "1],\"alias\":\"buying_size_stddev\"},\"reorder_point\":{"
454 "\"default\":-1,\"tooltip\":\"Reorder point\",\"doc\":\"The "
455 "point at which the facility will request more "
456 "material. Above this point, no request will be "
457 "made. Must be less than max_inv_size.If paired "
458 "with reorder_quantity, this agent will have an "
459 "(R,Q) inventory policy. If reorder_point is used "
460 "alone, this agent will have an (s,S) inventory "
461 "policy, with S (the maximum) being set at "
462 "max_inv_size.\",\"uilabel\":\"Reorder Point\",\"type\":\"d"
463 "ouble\",\"index\":27,\"shape\":[-"
464 "1],\"alias\":\"reorder_point\"},\"reorder_quantity\":{\"d"
465 "efault\":-1,\"tooltip\":\"Reorder amount (R,Q "
466 "inventory policy)\",\"doc\":\"The amount of material "
467 "that will be requested when the reorder point is "
468 "reached. Exclusive request, so will demand exactly"
469 " reorder_quantity.Reorder_point + reorder_quantity"
470 " must be less than "
471 "max_inv_size.\",\"uilabel\":\"Reorder Quantity\",\"type\""
472 ":\"double\",\"index\":28,\"shape\":[-"
473 "1],\"alias\":\"reorder_quantity\"},\"cumulative_cap\":{\""
474 "default\":-1,\"tooltip\":\"Total amount of material "
475 "that can be recieved per cycle.\",\"doc\":\"After "
476 "receiving this much material cumulatively, the "
477 "agent will go dormant. Must be paired with "
478 "dormant_buying_frequency_type and any other "
479 "dormant parameters. The per-time step demand is "
480 "unchanged except the cycle cap is almost "
481 "reached.\",\"uilabel\":\"Cumulative Cap\",\"type\":\"doubl"
482 "e\",\"index\":29,\"shape\":[-"
483 "1],\"alias\":\"cumulative_cap\"},\"package\":{\"default\":"
484 "\"unpackaged\",\"tooltip\":\"Output "
485 "package\",\"doc\":\"Outgoing material will be packaged"
486 " when trading.\",\"uitype\":\"package\",\"uilabel\":\"Pack"
487 "age\",\"type\":\"std::string\",\"index\":30,\"shape\":[-"
488 "1],\"alias\":\"package\"},\"transport_unit\":{\"default\":"
489 "\"unrestricted\",\"tooltip\":\"Output transport "
490 "unit\",\"doc\":\"Outgoing material, after packaging, "
491 "will be further restricted by transport unit when "
492 "trading.\",\"uitype\":\"transportunit\",\"uilabel\":\"Tran"
493 "sport Unit\",\"type\":\"std::string\",\"index\":31,\"shape"
494 "\":[-"
495 "1],\"alias\":\"transport_unit\"},\"inventory\":{\"tooltip"
496 "\":\"Incoming material buffer\",\"type\":[\"cyclus::tool"
497 "kit::ResBuf\",\"cyclus::Material\"],\"index\":32,\"shape"
498 "\":[-1,-1]},\"stocks\":{\"tooltip\":\"Output material bu"
499 "ffer\",\"type\":[\"cyclus::toolkit::ResBuf\",\"cyclus::M"
500 "aterial\"],\"index\":33,\"shape\":[-1,-"
501 "1]},\"ready\":{\"tooltip\":\"Buffer for material held "
502 "for required residence_time\",\"type\":[\"cyclus::tool"
503 "kit::ResBuf\",\"cyclus::Material\"],\"index\":34,\"shape"
504 "\":[-1,-1]},\"processing\":{\"tooltip\":\"Buffer for "
505 "material still waiting for required residence_time"
506 "\",\"type\":[\"cyclus::toolkit::ResBuf\",\"cyclus::Mater"
507 "ial\"],\"index\":35,\"shape\":[-1,-"
508 "1]},\"inventory_tracker\":{\"tooltip\":\"Total "
509 "Inventory Tracker to restrict maximum agent invent"
510 "ory\",\"type\":\"cyclus::toolkit::TotalInvTracker\",\"in"
511 "dex\":36,\"shape\":[-"
512 "1],\"alias\":\"inventory_tracker\",\"uilabel\":\"inventor"
513 "y_tracker\"},\"latitude\":{\"default\":0.0,\"uilabel\":\"G"
514 "eographical latitude in degrees as a "
515 "double\",\"doc\":\"Latitude of the agent's "
516 "geographical position. The value should be "
517 "expressed in degrees as a double.\",\"type\":\"double\""
518 ",\"index\":37,\"shape\":[-"
519 "1],\"alias\":\"latitude\",\"tooltip\":\"latitude\"},\"longi"
520 "tude\":{\"default\":0.0,\"uilabel\":\"Geographical "
521 "longitude in degrees as a double\",\"doc\":\"Longitude"
522 " of the agent's geographical position. The value "
523 "should be expressed in degrees as a double.\",\"type"
524 "\":\"double\",\"index\":38,\"shape\":[-"
525 "1],\"alias\":\"longitude\",\"tooltip\":\"longitude\"}},\"do"
526 "c\":\"Storage is a simple facility which accepts any"
527 " number of commodities and holds them for a user "
528 "specified amount of time. The commodities accepted"
529 " are chosen based on the specified preferences "
530 "list. Once the desired amount of material has "
531 "entered the facility it is passed into a "
532 "'processing' buffer where it is held until the "
533 "residence time has passed. The material is then "
534 "passed into a 'ready' buffer where it is queued "
535 "for removal. Currently, all input commodities are "
536 "lumped into a single output commodity. Storage "
537 "also has the functionality to handle materials in "
538 "discrete or continuous batches. Discrete mode, "
539 "which is the default, does not split or combine "
540 "material batches. Continuous mode, however, "
541 "divides material batches if necessary in order to "
542 "push materials through the facility as quickly as "
543 "possible.\"}", root);
544 if (!parsed_ok) {
545 throw cyclus::ValueError("failed to parse annotations for cycamore::Storage.");
546 }
547 return root;
548};
549#line 23 "/cycamore/src/storage.cc"
550
551void Storage::InitInv(cyclus::Inventories& inv) {
552 inventory.Push(inv["inventory"]);
553 stocks.Push(inv["stocks"]);
554 ready.Push(inv["ready"]);
555 processing.Push(inv["processing"]);
556 ;
557
558};
559#line 25 "/cycamore/src/storage.cc"
560
561cyclus::Inventories Storage::SnapshotInv() {
562 cyclus::Inventories invs;
563 invs["inventory"] = inventory.PopNRes(inventory.count());
564 inventory.Push(invs["inventory"]);
565 invs["stocks"] = stocks.PopNRes(stocks.count());
566 stocks.Push(invs["stocks"]);
567 invs["ready"] = ready.PopNRes(ready.count());
568 ready.Push(invs["ready"]);
569 invs["processing"] = processing.PopNRes(processing.count());
570 processing.Push(invs["processing"]);
571 ;
572 return invs;
573};
574#line 27 "/cycamore/src/storage.cc"
575
576void Storage::InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di) {
577 cyclus::Facility::InfileToDb(tree, di);
578 int rawcycpp_shape_in_commods[2] = {-1, -1};
579 cycpp_shape_in_commods = std::vector<int>(rawcycpp_shape_in_commods, rawcycpp_shape_in_commods + 2);
580 int rawcycpp_shape_in_commod_prefs[2] = {-1, -1};
581 cycpp_shape_in_commod_prefs = std::vector<int>(rawcycpp_shape_in_commod_prefs, rawcycpp_shape_in_commod_prefs + 2);
582 int rawcycpp_shape_out_commods[2] = {-1, -1};
583 cycpp_shape_out_commods = std::vector<int>(rawcycpp_shape_out_commods, rawcycpp_shape_out_commods + 2);
584 int rawcycpp_shape_in_recipe[1] = {-1};
585 cycpp_shape_in_recipe = std::vector<int>(rawcycpp_shape_in_recipe, rawcycpp_shape_in_recipe + 1);
586 int rawcycpp_shape_residence_time[1] = {-1};
587 cycpp_shape_residence_time = std::vector<int>(rawcycpp_shape_residence_time, rawcycpp_shape_residence_time + 1);
588 int rawcycpp_shape_sell_quantity[1] = {-1};
589 cycpp_shape_sell_quantity = std::vector<int>(rawcycpp_shape_sell_quantity, rawcycpp_shape_sell_quantity + 1);
590 int rawcycpp_shape_throughput[1] = {-1};
591 cycpp_shape_throughput = std::vector<int>(rawcycpp_shape_throughput, rawcycpp_shape_throughput + 1);
592 int rawcycpp_shape_max_inv_size[1] = {-1};
593 cycpp_shape_max_inv_size = std::vector<int>(rawcycpp_shape_max_inv_size, rawcycpp_shape_max_inv_size + 1);
594 int rawcycpp_shape_discrete_handling[1] = {-1};
595 cycpp_shape_discrete_handling = std::vector<int>(rawcycpp_shape_discrete_handling, rawcycpp_shape_discrete_handling + 1);
596 int rawcycpp_shape_active_buying_frequency_type[1] = {-1};
597 cycpp_shape_active_buying_frequency_type = std::vector<int>(rawcycpp_shape_active_buying_frequency_type, rawcycpp_shape_active_buying_frequency_type + 1);
598 int rawcycpp_shape_active_buying_val[1] = {-1};
599 cycpp_shape_active_buying_val = std::vector<int>(rawcycpp_shape_active_buying_val, rawcycpp_shape_active_buying_val + 1);
600 int rawcycpp_shape_active_buying_min[1] = {-1};
601 cycpp_shape_active_buying_min = std::vector<int>(rawcycpp_shape_active_buying_min, rawcycpp_shape_active_buying_min + 1);
602 int rawcycpp_shape_active_buying_max[1] = {-1};
603 cycpp_shape_active_buying_max = std::vector<int>(rawcycpp_shape_active_buying_max, rawcycpp_shape_active_buying_max + 1);
604 int rawcycpp_shape_active_buying_mean[1] = {-1};
605 cycpp_shape_active_buying_mean = std::vector<int>(rawcycpp_shape_active_buying_mean, rawcycpp_shape_active_buying_mean + 1);
606 int rawcycpp_shape_active_buying_stddev[1] = {-1};
607 cycpp_shape_active_buying_stddev = std::vector<int>(rawcycpp_shape_active_buying_stddev, rawcycpp_shape_active_buying_stddev + 1);
608 int rawcycpp_shape_dormant_buying_frequency_type[1] = {-1};
609 cycpp_shape_dormant_buying_frequency_type = std::vector<int>(rawcycpp_shape_dormant_buying_frequency_type, rawcycpp_shape_dormant_buying_frequency_type + 1);
610 int rawcycpp_shape_dormant_buying_val[1] = {-1};
611 cycpp_shape_dormant_buying_val = std::vector<int>(rawcycpp_shape_dormant_buying_val, rawcycpp_shape_dormant_buying_val + 1);
612 int rawcycpp_shape_dormant_buying_min[1] = {-1};
613 cycpp_shape_dormant_buying_min = std::vector<int>(rawcycpp_shape_dormant_buying_min, rawcycpp_shape_dormant_buying_min + 1);
614 int rawcycpp_shape_dormant_buying_max[1] = {-1};
615 cycpp_shape_dormant_buying_max = std::vector<int>(rawcycpp_shape_dormant_buying_max, rawcycpp_shape_dormant_buying_max + 1);
616 int rawcycpp_shape_dormant_buying_mean[1] = {-1};
617 cycpp_shape_dormant_buying_mean = std::vector<int>(rawcycpp_shape_dormant_buying_mean, rawcycpp_shape_dormant_buying_mean + 1);
618 int rawcycpp_shape_dormant_buying_stddev[1] = {-1};
619 cycpp_shape_dormant_buying_stddev = std::vector<int>(rawcycpp_shape_dormant_buying_stddev, rawcycpp_shape_dormant_buying_stddev + 1);
620 int rawcycpp_shape_buying_size_type[1] = {-1};
621 cycpp_shape_buying_size_type = std::vector<int>(rawcycpp_shape_buying_size_type, rawcycpp_shape_buying_size_type + 1);
622 int rawcycpp_shape_buying_size_val[1] = {-1};
623 cycpp_shape_buying_size_val = std::vector<int>(rawcycpp_shape_buying_size_val, rawcycpp_shape_buying_size_val + 1);
624 int rawcycpp_shape_buying_size_min[1] = {-1};
625 cycpp_shape_buying_size_min = std::vector<int>(rawcycpp_shape_buying_size_min, rawcycpp_shape_buying_size_min + 1);
626 int rawcycpp_shape_buying_size_max[1] = {-1};
627 cycpp_shape_buying_size_max = std::vector<int>(rawcycpp_shape_buying_size_max, rawcycpp_shape_buying_size_max + 1);
628 int rawcycpp_shape_buying_size_mean[1] = {-1};
629 cycpp_shape_buying_size_mean = std::vector<int>(rawcycpp_shape_buying_size_mean, rawcycpp_shape_buying_size_mean + 1);
630 int rawcycpp_shape_buying_size_stddev[1] = {-1};
631 cycpp_shape_buying_size_stddev = std::vector<int>(rawcycpp_shape_buying_size_stddev, rawcycpp_shape_buying_size_stddev + 1);
632 int rawcycpp_shape_reorder_point[1] = {-1};
633 cycpp_shape_reorder_point = std::vector<int>(rawcycpp_shape_reorder_point, rawcycpp_shape_reorder_point + 1);
634 int rawcycpp_shape_reorder_quantity[1] = {-1};
635 cycpp_shape_reorder_quantity = std::vector<int>(rawcycpp_shape_reorder_quantity, rawcycpp_shape_reorder_quantity + 1);
636 int rawcycpp_shape_cumulative_cap[1] = {-1};
637 cycpp_shape_cumulative_cap = std::vector<int>(rawcycpp_shape_cumulative_cap, rawcycpp_shape_cumulative_cap + 1);
638 int rawcycpp_shape_package[1] = {-1};
639 cycpp_shape_package = std::vector<int>(rawcycpp_shape_package, rawcycpp_shape_package + 1);
640 int rawcycpp_shape_transport_unit[1] = {-1};
641 cycpp_shape_transport_unit = std::vector<int>(rawcycpp_shape_transport_unit, rawcycpp_shape_transport_unit + 1);
642 int rawcycpp_shape_inventory[2] = {-1, -1};
643 cycpp_shape_inventory = std::vector<int>(rawcycpp_shape_inventory, rawcycpp_shape_inventory + 2);
644 int rawcycpp_shape_stocks[2] = {-1, -1};
645 cycpp_shape_stocks = std::vector<int>(rawcycpp_shape_stocks, rawcycpp_shape_stocks + 2);
646 int rawcycpp_shape_ready[2] = {-1, -1};
647 cycpp_shape_ready = std::vector<int>(rawcycpp_shape_ready, rawcycpp_shape_ready + 2);
648 int rawcycpp_shape_processing[2] = {-1, -1};
649 cycpp_shape_processing = std::vector<int>(rawcycpp_shape_processing, rawcycpp_shape_processing + 2);
650 int rawcycpp_shape_inventory_tracker[1] = {-1};
651 cycpp_shape_inventory_tracker = std::vector<int>(rawcycpp_shape_inventory_tracker, rawcycpp_shape_inventory_tracker + 1);
652 int rawcycpp_shape_latitude[1] = {-1};
653 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
654 int rawcycpp_shape_longitude[1] = {-1};
655 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
656 cyclus::InfileTree* sub = tree->SubTree("config/*");
657 int i;
658 int n;
659 {
660 cyclus::InfileTree* bub = sub->SubTree("in_commods", 0);
661 cyclus::InfileTree* sub = bub;
662 int n1 = sub->NMatches("val");
663 std::vector< std::string > in_commods_val;
664 in_commods_val.resize(n1);
665 for (int i1 = 0; i1 < n1; ++i1) {
666 std::string elem;
667 {
668 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
669 elem = elem_in;
670 }
671 in_commods_val[i1] = elem;
672 }
673 in_commods = in_commods_val;
674 }
675 if (sub->NMatches("in_commod_prefs") > 0) {
676 {
677 cyclus::InfileTree* bub = sub->SubTree("in_commod_prefs", 0);
678 cyclus::InfileTree* sub = bub;
679 int n1 = sub->NMatches("val");
680 std::vector< double > in_commod_prefs_val;
681 in_commod_prefs_val.resize(n1);
682 for (int i1 = 0; i1 < n1; ++i1) {
683 double elem;
684 {
685 double elem_in = cyclus::Query<double>(sub, "val", i1);
686 elem = elem_in;
687 }
688 in_commod_prefs_val[i1] = elem;
689 }
690 in_commod_prefs = in_commod_prefs_val;
691 }
692 } else {
693 std::vector< double > in_commod_prefs_tmp;
694 in_commod_prefs_tmp.resize(0);
695 {
696 }
697 in_commod_prefs = in_commod_prefs_tmp;
698 }
699 {
700 cyclus::InfileTree* bub = sub->SubTree("out_commods", 0);
701 cyclus::InfileTree* sub = bub;
702 int n1 = sub->NMatches("val");
703 std::vector< std::string > out_commods_val;
704 out_commods_val.resize(n1);
705 for (int i1 = 0; i1 < n1; ++i1) {
706 std::string elem;
707 {
708 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
709 elem = elem_in;
710 }
711 out_commods_val[i1] = elem;
712 }
713 out_commods = out_commods_val;
714 }
715 if (sub->NMatches("in_recipe") > 0) {
716 {
717 std::string in_recipe_val = cyclus::Query<std::string>(sub, "in_recipe");
718 in_recipe = in_recipe_val;
719 }
720 } else {
721 std::string in_recipe_tmp("");
722 in_recipe = in_recipe_tmp;
723 }
724 if (sub->NMatches("residence_time") > 0) {
725 {
726 int residence_time_val = cyclus::Query<int>(sub, "residence_time");
727 residence_time = residence_time_val;
728 }
729 } else {
730 int residence_time_tmp = 0;
731 residence_time = residence_time_tmp;
732 }
733 if (sub->NMatches("sell_quantity") > 0) {
734 {
735 double sell_quantity_val = cyclus::Query<double>(sub, "sell_quantity");
736 sell_quantity = sell_quantity_val;
737 }
738 } else {
739 double sell_quantity_tmp = 0;
740 sell_quantity = sell_quantity_tmp;
741 }
742 if (sub->NMatches("throughput") > 0) {
743 {
744 double throughput_val = cyclus::Query<double>(sub, "throughput");
745 throughput = throughput_val;
746 }
747 } else {
748 double throughput_tmp = 1e+299;
749 throughput = throughput_tmp;
750 }
751 if (sub->NMatches("max_inv_size") > 0) {
752 {
753 double max_inv_size_val = cyclus::Query<double>(sub, "max_inv_size");
754 max_inv_size = max_inv_size_val;
755 }
756 } else {
757 double max_inv_size_tmp = 1e+299;
758 max_inv_size = max_inv_size_tmp;
759 }
760 if (sub->NMatches("discrete_handling") > 0) {
761 {
762 bool discrete_handling_val = cyclus::Query<bool>(sub, "discrete_handling");
763 discrete_handling = discrete_handling_val;
764 }
765 } else {
766 bool discrete_handling_tmp = false;
767 discrete_handling = discrete_handling_tmp;
768 }
769 if (sub->NMatches("active_buying_frequency_type") > 0) {
770 {
771 std::string active_buying_frequency_type_val = cyclus::Query<std::string>(sub, "active_buying_frequency_type");
772 active_buying_frequency_type = active_buying_frequency_type_val;
773 }
774 } else {
775 std::string active_buying_frequency_type_tmp("Fixed");
776 active_buying_frequency_type = active_buying_frequency_type_tmp;
777 }
778 if (sub->NMatches("active_buying_val") > 0) {
779 {
780 int active_buying_val_val = cyclus::Query<int>(sub, "active_buying_val");
781 active_buying_val = active_buying_val_val;
782 }
783 } else {
784 int active_buying_val_tmp = -1;
785 active_buying_val = active_buying_val_tmp;
786 }
787 if (sub->NMatches("active_buying_min") > 0) {
788 {
789 int active_buying_min_val = cyclus::Query<int>(sub, "active_buying_min");
790 active_buying_min = active_buying_min_val;
791 }
792 } else {
793 int active_buying_min_tmp = -1;
794 active_buying_min = active_buying_min_tmp;
795 }
796 if (sub->NMatches("active_buying_max") > 0) {
797 {
798 int active_buying_max_val = cyclus::Query<int>(sub, "active_buying_max");
799 active_buying_max = active_buying_max_val;
800 }
801 } else {
802 int active_buying_max_tmp = -1;
803 active_buying_max = active_buying_max_tmp;
804 }
805 if (sub->NMatches("active_buying_mean") > 0) {
806 {
807 double active_buying_mean_val = cyclus::Query<double>(sub, "active_buying_mean");
808 active_buying_mean = active_buying_mean_val;
809 }
810 } else {
811 double active_buying_mean_tmp = -1;
812 active_buying_mean = active_buying_mean_tmp;
813 }
814 if (sub->NMatches("active_buying_stddev") > 0) {
815 {
816 double active_buying_stddev_val = cyclus::Query<double>(sub, "active_buying_stddev");
817 active_buying_stddev = active_buying_stddev_val;
818 }
819 } else {
820 double active_buying_stddev_tmp = -1;
821 active_buying_stddev = active_buying_stddev_tmp;
822 }
823 if (sub->NMatches("dormant_buying_frequency_type") > 0) {
824 {
825 std::string dormant_buying_frequency_type_val = cyclus::Query<std::string>(sub, "dormant_buying_frequency_type");
826 dormant_buying_frequency_type = dormant_buying_frequency_type_val;
827 }
828 } else {
829 std::string dormant_buying_frequency_type_tmp("Fixed");
830 dormant_buying_frequency_type = dormant_buying_frequency_type_tmp;
831 }
832 if (sub->NMatches("dormant_buying_val") > 0) {
833 {
834 int dormant_buying_val_val = cyclus::Query<int>(sub, "dormant_buying_val");
835 dormant_buying_val = dormant_buying_val_val;
836 }
837 } else {
838 int dormant_buying_val_tmp = -1;
839 dormant_buying_val = dormant_buying_val_tmp;
840 }
841 if (sub->NMatches("dormant_buying_min") > 0) {
842 {
843 int dormant_buying_min_val = cyclus::Query<int>(sub, "dormant_buying_min");
844 dormant_buying_min = dormant_buying_min_val;
845 }
846 } else {
847 int dormant_buying_min_tmp = -1;
848 dormant_buying_min = dormant_buying_min_tmp;
849 }
850 if (sub->NMatches("dormant_buying_max") > 0) {
851 {
852 int dormant_buying_max_val = cyclus::Query<int>(sub, "dormant_buying_max");
853 dormant_buying_max = dormant_buying_max_val;
854 }
855 } else {
856 int dormant_buying_max_tmp = -1;
857 dormant_buying_max = dormant_buying_max_tmp;
858 }
859 if (sub->NMatches("dormant_buying_mean") > 0) {
860 {
861 double dormant_buying_mean_val = cyclus::Query<double>(sub, "dormant_buying_mean");
862 dormant_buying_mean = dormant_buying_mean_val;
863 }
864 } else {
865 double dormant_buying_mean_tmp = -1;
866 dormant_buying_mean = dormant_buying_mean_tmp;
867 }
868 if (sub->NMatches("dormant_buying_stddev") > 0) {
869 {
870 double dormant_buying_stddev_val = cyclus::Query<double>(sub, "dormant_buying_stddev");
871 dormant_buying_stddev = dormant_buying_stddev_val;
872 }
873 } else {
874 double dormant_buying_stddev_tmp = -1;
875 dormant_buying_stddev = dormant_buying_stddev_tmp;
876 }
877 if (sub->NMatches("buying_size_type") > 0) {
878 {
879 std::string buying_size_type_val = cyclus::Query<std::string>(sub, "buying_size_type");
880 buying_size_type = buying_size_type_val;
881 }
882 } else {
883 std::string buying_size_type_tmp("Fixed");
884 buying_size_type = buying_size_type_tmp;
885 }
886 if (sub->NMatches("buying_size_val") > 0) {
887 {
888 double buying_size_val_val = cyclus::Query<double>(sub, "buying_size_val");
889 buying_size_val = buying_size_val_val;
890 }
891 } else {
892 double buying_size_val_tmp = 1.0;
893 buying_size_val = buying_size_val_tmp;
894 }
895 if (sub->NMatches("buying_size_min") > 0) {
896 {
897 double buying_size_min_val = cyclus::Query<double>(sub, "buying_size_min");
898 buying_size_min = buying_size_min_val;
899 }
900 } else {
901 double buying_size_min_tmp = -1.0;
902 buying_size_min = buying_size_min_tmp;
903 }
904 if (sub->NMatches("buying_size_max") > 0) {
905 {
906 double buying_size_max_val = cyclus::Query<double>(sub, "buying_size_max");
907 buying_size_max = buying_size_max_val;
908 }
909 } else {
910 double buying_size_max_tmp = -1.0;
911 buying_size_max = buying_size_max_tmp;
912 }
913 if (sub->NMatches("buying_size_mean") > 0) {
914 {
915 double buying_size_mean_val = cyclus::Query<double>(sub, "buying_size_mean");
916 buying_size_mean = buying_size_mean_val;
917 }
918 } else {
919 double buying_size_mean_tmp = -1.0;
920 buying_size_mean = buying_size_mean_tmp;
921 }
922 if (sub->NMatches("buying_size_stddev") > 0) {
923 {
924 double buying_size_stddev_val = cyclus::Query<double>(sub, "buying_size_stddev");
925 buying_size_stddev = buying_size_stddev_val;
926 }
927 } else {
928 double buying_size_stddev_tmp = -1.0;
929 buying_size_stddev = buying_size_stddev_tmp;
930 }
931 if (sub->NMatches("reorder_point") > 0) {
932 {
933 double reorder_point_val = cyclus::Query<double>(sub, "reorder_point");
934 reorder_point = reorder_point_val;
935 }
936 } else {
937 double reorder_point_tmp = -1;
938 reorder_point = reorder_point_tmp;
939 }
940 if (sub->NMatches("reorder_quantity") > 0) {
941 {
942 double reorder_quantity_val = cyclus::Query<double>(sub, "reorder_quantity");
943 reorder_quantity = reorder_quantity_val;
944 }
945 } else {
946 double reorder_quantity_tmp = -1;
947 reorder_quantity = reorder_quantity_tmp;
948 }
949 if (sub->NMatches("cumulative_cap") > 0) {
950 {
951 double cumulative_cap_val = cyclus::Query<double>(sub, "cumulative_cap");
952 cumulative_cap = cumulative_cap_val;
953 }
954 } else {
955 double cumulative_cap_tmp = -1;
956 cumulative_cap = cumulative_cap_tmp;
957 }
958 if (sub->NMatches("package") > 0) {
959 {
960 std::string package_val = cyclus::Query<std::string>(sub, "package");
961 package = package_val;
962 }
963 } else {
964 std::string package_tmp("unpackaged");
965 package = package_tmp;
966 }
967 if (sub->NMatches("transport_unit") > 0) {
968 {
969 std::string transport_unit_val = cyclus::Query<std::string>(sub, "transport_unit");
970 transport_unit = transport_unit_val;
971 }
972 } else {
973 std::string transport_unit_tmp("unrestricted");
974 transport_unit = transport_unit_tmp;
975 }
976 if (sub->NMatches("latitude") > 0) {
977 {
978 double latitude_val = cyclus::Query<double>(sub, "latitude");
979 latitude = latitude_val;
980 }
981 } else {
982 double latitude_tmp = 0.0;
983 latitude = latitude_tmp;
984 }
985 if (sub->NMatches("longitude") > 0) {
986 {
987 double longitude_val = cyclus::Query<double>(sub, "longitude");
988 longitude = longitude_val;
989 }
990 } else {
991 double longitude_tmp = 0.0;
992 longitude = longitude_tmp;
993 }
994 di.NewDatum("Info")
995 ->AddVal("in_commods", in_commods, &cycpp_shape_in_commods)
996 ->AddVal("in_commod_prefs", in_commod_prefs, &cycpp_shape_in_commod_prefs)
997 ->AddVal("out_commods", out_commods, &cycpp_shape_out_commods)
998 ->AddVal("in_recipe", in_recipe, &cycpp_shape_in_recipe)
999 ->AddVal("residence_time", residence_time, &cycpp_shape_residence_time)
1000 ->AddVal("sell_quantity", sell_quantity, &cycpp_shape_sell_quantity)
1001 ->AddVal("throughput", throughput, &cycpp_shape_throughput)
1002 ->AddVal("max_inv_size", max_inv_size, &cycpp_shape_max_inv_size)
1003 ->AddVal("discrete_handling", discrete_handling, &cycpp_shape_discrete_handling)
1004 ->AddVal("active_buying_frequency_type", active_buying_frequency_type, &cycpp_shape_active_buying_frequency_type)
1005 ->AddVal("active_buying_val", active_buying_val, &cycpp_shape_active_buying_val)
1006 ->AddVal("active_buying_min", active_buying_min, &cycpp_shape_active_buying_min)
1007 ->AddVal("active_buying_max", active_buying_max, &cycpp_shape_active_buying_max)
1008 ->AddVal("active_buying_mean", active_buying_mean, &cycpp_shape_active_buying_mean)
1009 ->AddVal("active_buying_stddev", active_buying_stddev, &cycpp_shape_active_buying_stddev)
1010 ->AddVal("dormant_buying_frequency_type", dormant_buying_frequency_type, &cycpp_shape_dormant_buying_frequency_type)
1011 ->AddVal("dormant_buying_val", dormant_buying_val, &cycpp_shape_dormant_buying_val)
1012 ->AddVal("dormant_buying_min", dormant_buying_min, &cycpp_shape_dormant_buying_min)
1013 ->AddVal("dormant_buying_max", dormant_buying_max, &cycpp_shape_dormant_buying_max)
1014 ->AddVal("dormant_buying_mean", dormant_buying_mean, &cycpp_shape_dormant_buying_mean)
1015 ->AddVal("dormant_buying_stddev", dormant_buying_stddev, &cycpp_shape_dormant_buying_stddev)
1016 ->AddVal("buying_size_type", buying_size_type, &cycpp_shape_buying_size_type)
1017 ->AddVal("buying_size_val", buying_size_val, &cycpp_shape_buying_size_val)
1018 ->AddVal("buying_size_min", buying_size_min, &cycpp_shape_buying_size_min)
1019 ->AddVal("buying_size_max", buying_size_max, &cycpp_shape_buying_size_max)
1020 ->AddVal("buying_size_mean", buying_size_mean, &cycpp_shape_buying_size_mean)
1021 ->AddVal("buying_size_stddev", buying_size_stddev, &cycpp_shape_buying_size_stddev)
1022 ->AddVal("reorder_point", reorder_point, &cycpp_shape_reorder_point)
1023 ->AddVal("reorder_quantity", reorder_quantity, &cycpp_shape_reorder_quantity)
1024 ->AddVal("cumulative_cap", cumulative_cap, &cycpp_shape_cumulative_cap)
1025 ->AddVal("package", package, &cycpp_shape_package)
1026 ->AddVal("transport_unit", transport_unit, &cycpp_shape_transport_unit)
1027 ->AddVal("latitude", latitude, &cycpp_shape_latitude)
1028 ->AddVal("longitude", longitude, &cycpp_shape_longitude)
1029 ->Record();
1030};
1031#line 29 "/cycamore/src/storage.cc"
1032
1033void Storage::Snapshot(cyclus::DbInit di) {
1034 di.NewDatum("Info")
1035 ->AddVal("in_commods", in_commods, &cycpp_shape_in_commods)
1036 ->AddVal("in_commod_prefs", in_commod_prefs, &cycpp_shape_in_commod_prefs)
1037 ->AddVal("out_commods", out_commods, &cycpp_shape_out_commods)
1038 ->AddVal("in_recipe", in_recipe, &cycpp_shape_in_recipe)
1039 ->AddVal("residence_time", residence_time, &cycpp_shape_residence_time)
1040 ->AddVal("sell_quantity", sell_quantity, &cycpp_shape_sell_quantity)
1041 ->AddVal("throughput", throughput, &cycpp_shape_throughput)
1042 ->AddVal("max_inv_size", max_inv_size, &cycpp_shape_max_inv_size)
1043 ->AddVal("discrete_handling", discrete_handling, &cycpp_shape_discrete_handling)
1044 ->AddVal("active_buying_frequency_type", active_buying_frequency_type, &cycpp_shape_active_buying_frequency_type)
1045 ->AddVal("active_buying_val", active_buying_val, &cycpp_shape_active_buying_val)
1046 ->AddVal("active_buying_min", active_buying_min, &cycpp_shape_active_buying_min)
1047 ->AddVal("active_buying_max", active_buying_max, &cycpp_shape_active_buying_max)
1048 ->AddVal("active_buying_mean", active_buying_mean, &cycpp_shape_active_buying_mean)
1049 ->AddVal("active_buying_stddev", active_buying_stddev, &cycpp_shape_active_buying_stddev)
1050 ->AddVal("dormant_buying_frequency_type", dormant_buying_frequency_type, &cycpp_shape_dormant_buying_frequency_type)
1051 ->AddVal("dormant_buying_val", dormant_buying_val, &cycpp_shape_dormant_buying_val)
1052 ->AddVal("dormant_buying_min", dormant_buying_min, &cycpp_shape_dormant_buying_min)
1053 ->AddVal("dormant_buying_max", dormant_buying_max, &cycpp_shape_dormant_buying_max)
1054 ->AddVal("dormant_buying_mean", dormant_buying_mean, &cycpp_shape_dormant_buying_mean)
1055 ->AddVal("dormant_buying_stddev", dormant_buying_stddev, &cycpp_shape_dormant_buying_stddev)
1056 ->AddVal("buying_size_type", buying_size_type, &cycpp_shape_buying_size_type)
1057 ->AddVal("buying_size_val", buying_size_val, &cycpp_shape_buying_size_val)
1058 ->AddVal("buying_size_min", buying_size_min, &cycpp_shape_buying_size_min)
1059 ->AddVal("buying_size_max", buying_size_max, &cycpp_shape_buying_size_max)
1060 ->AddVal("buying_size_mean", buying_size_mean, &cycpp_shape_buying_size_mean)
1061 ->AddVal("buying_size_stddev", buying_size_stddev, &cycpp_shape_buying_size_stddev)
1062 ->AddVal("reorder_point", reorder_point, &cycpp_shape_reorder_point)
1063 ->AddVal("reorder_quantity", reorder_quantity, &cycpp_shape_reorder_quantity)
1064 ->AddVal("cumulative_cap", cumulative_cap, &cycpp_shape_cumulative_cap)
1065 ->AddVal("package", package, &cycpp_shape_package)
1066 ->AddVal("transport_unit", transport_unit, &cycpp_shape_transport_unit)
1067 ->AddVal("latitude", latitude, &cycpp_shape_latitude)
1068 ->AddVal("longitude", longitude, &cycpp_shape_longitude)
1069 ->Record();
1070};
1071#line 31 "/cycamore/src/storage.cc"
1072
1073cyclus::Agent* Storage::Clone() {
1074 cycamore::Storage* m = new cycamore::Storage(context());
1075 m->InitFrom(this);
1076 return m;
1077};
1078#line 33 "/cycamore/src/storage.cc"
1079
1080//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1081void Storage::InitFrom(Storage* m) { cyclus::Facility::InitFrom(m);
1082 int rawcycpp_shape_in_commods[2] = {-1, -1};
1083 cycpp_shape_in_commods = std::vector<int>(rawcycpp_shape_in_commods, rawcycpp_shape_in_commods + 2);
1084 int rawcycpp_shape_in_commod_prefs[2] = {-1, -1};
1085 cycpp_shape_in_commod_prefs = std::vector<int>(rawcycpp_shape_in_commod_prefs, rawcycpp_shape_in_commod_prefs + 2);
1086 int rawcycpp_shape_out_commods[2] = {-1, -1};
1087 cycpp_shape_out_commods = std::vector<int>(rawcycpp_shape_out_commods, rawcycpp_shape_out_commods + 2);
1088 int rawcycpp_shape_in_recipe[1] = {-1};
1089 cycpp_shape_in_recipe = std::vector<int>(rawcycpp_shape_in_recipe, rawcycpp_shape_in_recipe + 1);
1090 int rawcycpp_shape_residence_time[1] = {-1};
1091 cycpp_shape_residence_time = std::vector<int>(rawcycpp_shape_residence_time, rawcycpp_shape_residence_time + 1);
1092 int rawcycpp_shape_sell_quantity[1] = {-1};
1093 cycpp_shape_sell_quantity = std::vector<int>(rawcycpp_shape_sell_quantity, rawcycpp_shape_sell_quantity + 1);
1094 int rawcycpp_shape_throughput[1] = {-1};
1095 cycpp_shape_throughput = std::vector<int>(rawcycpp_shape_throughput, rawcycpp_shape_throughput + 1);
1096 int rawcycpp_shape_max_inv_size[1] = {-1};
1097 cycpp_shape_max_inv_size = std::vector<int>(rawcycpp_shape_max_inv_size, rawcycpp_shape_max_inv_size + 1);
1098 int rawcycpp_shape_discrete_handling[1] = {-1};
1099 cycpp_shape_discrete_handling = std::vector<int>(rawcycpp_shape_discrete_handling, rawcycpp_shape_discrete_handling + 1);
1100 int rawcycpp_shape_active_buying_frequency_type[1] = {-1};
1101 cycpp_shape_active_buying_frequency_type = std::vector<int>(rawcycpp_shape_active_buying_frequency_type, rawcycpp_shape_active_buying_frequency_type + 1);
1102 int rawcycpp_shape_active_buying_val[1] = {-1};
1103 cycpp_shape_active_buying_val = std::vector<int>(rawcycpp_shape_active_buying_val, rawcycpp_shape_active_buying_val + 1);
1104 int rawcycpp_shape_active_buying_min[1] = {-1};
1105 cycpp_shape_active_buying_min = std::vector<int>(rawcycpp_shape_active_buying_min, rawcycpp_shape_active_buying_min + 1);
1106 int rawcycpp_shape_active_buying_max[1] = {-1};
1107 cycpp_shape_active_buying_max = std::vector<int>(rawcycpp_shape_active_buying_max, rawcycpp_shape_active_buying_max + 1);
1108 int rawcycpp_shape_active_buying_mean[1] = {-1};
1109 cycpp_shape_active_buying_mean = std::vector<int>(rawcycpp_shape_active_buying_mean, rawcycpp_shape_active_buying_mean + 1);
1110 int rawcycpp_shape_active_buying_stddev[1] = {-1};
1111 cycpp_shape_active_buying_stddev = std::vector<int>(rawcycpp_shape_active_buying_stddev, rawcycpp_shape_active_buying_stddev + 1);
1112 int rawcycpp_shape_dormant_buying_frequency_type[1] = {-1};
1113 cycpp_shape_dormant_buying_frequency_type = std::vector<int>(rawcycpp_shape_dormant_buying_frequency_type, rawcycpp_shape_dormant_buying_frequency_type + 1);
1114 int rawcycpp_shape_dormant_buying_val[1] = {-1};
1115 cycpp_shape_dormant_buying_val = std::vector<int>(rawcycpp_shape_dormant_buying_val, rawcycpp_shape_dormant_buying_val + 1);
1116 int rawcycpp_shape_dormant_buying_min[1] = {-1};
1117 cycpp_shape_dormant_buying_min = std::vector<int>(rawcycpp_shape_dormant_buying_min, rawcycpp_shape_dormant_buying_min + 1);
1118 int rawcycpp_shape_dormant_buying_max[1] = {-1};
1119 cycpp_shape_dormant_buying_max = std::vector<int>(rawcycpp_shape_dormant_buying_max, rawcycpp_shape_dormant_buying_max + 1);
1120 int rawcycpp_shape_dormant_buying_mean[1] = {-1};
1121 cycpp_shape_dormant_buying_mean = std::vector<int>(rawcycpp_shape_dormant_buying_mean, rawcycpp_shape_dormant_buying_mean + 1);
1122 int rawcycpp_shape_dormant_buying_stddev[1] = {-1};
1123 cycpp_shape_dormant_buying_stddev = std::vector<int>(rawcycpp_shape_dormant_buying_stddev, rawcycpp_shape_dormant_buying_stddev + 1);
1124 int rawcycpp_shape_buying_size_type[1] = {-1};
1125 cycpp_shape_buying_size_type = std::vector<int>(rawcycpp_shape_buying_size_type, rawcycpp_shape_buying_size_type + 1);
1126 int rawcycpp_shape_buying_size_val[1] = {-1};
1127 cycpp_shape_buying_size_val = std::vector<int>(rawcycpp_shape_buying_size_val, rawcycpp_shape_buying_size_val + 1);
1128 int rawcycpp_shape_buying_size_min[1] = {-1};
1129 cycpp_shape_buying_size_min = std::vector<int>(rawcycpp_shape_buying_size_min, rawcycpp_shape_buying_size_min + 1);
1130 int rawcycpp_shape_buying_size_max[1] = {-1};
1131 cycpp_shape_buying_size_max = std::vector<int>(rawcycpp_shape_buying_size_max, rawcycpp_shape_buying_size_max + 1);
1132 int rawcycpp_shape_buying_size_mean[1] = {-1};
1133 cycpp_shape_buying_size_mean = std::vector<int>(rawcycpp_shape_buying_size_mean, rawcycpp_shape_buying_size_mean + 1);
1134 int rawcycpp_shape_buying_size_stddev[1] = {-1};
1135 cycpp_shape_buying_size_stddev = std::vector<int>(rawcycpp_shape_buying_size_stddev, rawcycpp_shape_buying_size_stddev + 1);
1136 int rawcycpp_shape_reorder_point[1] = {-1};
1137 cycpp_shape_reorder_point = std::vector<int>(rawcycpp_shape_reorder_point, rawcycpp_shape_reorder_point + 1);
1138 int rawcycpp_shape_reorder_quantity[1] = {-1};
1139 cycpp_shape_reorder_quantity = std::vector<int>(rawcycpp_shape_reorder_quantity, rawcycpp_shape_reorder_quantity + 1);
1140 int rawcycpp_shape_cumulative_cap[1] = {-1};
1141 cycpp_shape_cumulative_cap = std::vector<int>(rawcycpp_shape_cumulative_cap, rawcycpp_shape_cumulative_cap + 1);
1142 int rawcycpp_shape_package[1] = {-1};
1143 cycpp_shape_package = std::vector<int>(rawcycpp_shape_package, rawcycpp_shape_package + 1);
1144 int rawcycpp_shape_transport_unit[1] = {-1};
1145 cycpp_shape_transport_unit = std::vector<int>(rawcycpp_shape_transport_unit, rawcycpp_shape_transport_unit + 1);
1146 int rawcycpp_shape_inventory[2] = {-1, -1};
1147 cycpp_shape_inventory = std::vector<int>(rawcycpp_shape_inventory, rawcycpp_shape_inventory + 2);
1148 int rawcycpp_shape_stocks[2] = {-1, -1};
1149 cycpp_shape_stocks = std::vector<int>(rawcycpp_shape_stocks, rawcycpp_shape_stocks + 2);
1150 int rawcycpp_shape_ready[2] = {-1, -1};
1151 cycpp_shape_ready = std::vector<int>(rawcycpp_shape_ready, rawcycpp_shape_ready + 2);
1152 int rawcycpp_shape_processing[2] = {-1, -1};
1153 cycpp_shape_processing = std::vector<int>(rawcycpp_shape_processing, rawcycpp_shape_processing + 2);
1154 int rawcycpp_shape_inventory_tracker[1] = {-1};
1155 cycpp_shape_inventory_tracker = std::vector<int>(rawcycpp_shape_inventory_tracker, rawcycpp_shape_inventory_tracker + 1);
1156 int rawcycpp_shape_latitude[1] = {-1};
1157 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
1158 int rawcycpp_shape_longitude[1] = {-1};
1159 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
1160 in_commods = m->in_commods;
1161 in_commod_prefs = m->in_commod_prefs;
1162 out_commods = m->out_commods;
1163 in_recipe = m->in_recipe;
1164 residence_time = m->residence_time;
1165 sell_quantity = m->sell_quantity;
1166 throughput = m->throughput;
1167 max_inv_size = m->max_inv_size;
1168 discrete_handling = m->discrete_handling;
1169 active_buying_frequency_type = m->active_buying_frequency_type;
1170 active_buying_val = m->active_buying_val;
1171 active_buying_min = m->active_buying_min;
1172 active_buying_max = m->active_buying_max;
1173 active_buying_mean = m->active_buying_mean;
1174 active_buying_stddev = m->active_buying_stddev;
1175 dormant_buying_frequency_type = m->dormant_buying_frequency_type;
1176 dormant_buying_val = m->dormant_buying_val;
1177 dormant_buying_min = m->dormant_buying_min;
1178 dormant_buying_max = m->dormant_buying_max;
1179 dormant_buying_mean = m->dormant_buying_mean;
1180 dormant_buying_stddev = m->dormant_buying_stddev;
1181 buying_size_type = m->buying_size_type;
1182 buying_size_val = m->buying_size_val;
1183 buying_size_min = m->buying_size_min;
1184 buying_size_max = m->buying_size_max;
1185 buying_size_mean = m->buying_size_mean;
1186 buying_size_stddev = m->buying_size_stddev;
1187 reorder_point = m->reorder_point;
1188 reorder_quantity = m->reorder_quantity;
1189 cumulative_cap = m->cumulative_cap;
1190 package = m->package;
1191 transport_unit = m->transport_unit;
1192 latitude = m->latitude;
1193 longitude = m->longitude;
1194 inventory.capacity(m->inventory.capacity());
1195 stocks.capacity(m->stocks.capacity());
1196 ready.capacity(m->ready.capacity());
1197 processing.capacity(m->processing.capacity());
1198 inventory_tracker.capacity();
1199#line 37 "/cycamore/src/storage.cc"
1200 cyclus::toolkit::CommodityProducer::Copy(m);
1201}
1202
1203//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1204void Storage::InitFrom(cyclus::QueryableBackend* b) { cyclus::Facility::InitFrom(b);
1205 int rawcycpp_shape_in_commods[2] = {-1, -1};
1206 cycpp_shape_in_commods = std::vector<int>(rawcycpp_shape_in_commods, rawcycpp_shape_in_commods + 2);
1207 int rawcycpp_shape_in_commod_prefs[2] = {-1, -1};
1208 cycpp_shape_in_commod_prefs = std::vector<int>(rawcycpp_shape_in_commod_prefs, rawcycpp_shape_in_commod_prefs + 2);
1209 int rawcycpp_shape_out_commods[2] = {-1, -1};
1210 cycpp_shape_out_commods = std::vector<int>(rawcycpp_shape_out_commods, rawcycpp_shape_out_commods + 2);
1211 int rawcycpp_shape_in_recipe[1] = {-1};
1212 cycpp_shape_in_recipe = std::vector<int>(rawcycpp_shape_in_recipe, rawcycpp_shape_in_recipe + 1);
1213 int rawcycpp_shape_residence_time[1] = {-1};
1214 cycpp_shape_residence_time = std::vector<int>(rawcycpp_shape_residence_time, rawcycpp_shape_residence_time + 1);
1215 int rawcycpp_shape_sell_quantity[1] = {-1};
1216 cycpp_shape_sell_quantity = std::vector<int>(rawcycpp_shape_sell_quantity, rawcycpp_shape_sell_quantity + 1);
1217 int rawcycpp_shape_throughput[1] = {-1};
1218 cycpp_shape_throughput = std::vector<int>(rawcycpp_shape_throughput, rawcycpp_shape_throughput + 1);
1219 int rawcycpp_shape_max_inv_size[1] = {-1};
1220 cycpp_shape_max_inv_size = std::vector<int>(rawcycpp_shape_max_inv_size, rawcycpp_shape_max_inv_size + 1);
1221 int rawcycpp_shape_discrete_handling[1] = {-1};
1222 cycpp_shape_discrete_handling = std::vector<int>(rawcycpp_shape_discrete_handling, rawcycpp_shape_discrete_handling + 1);
1223 int rawcycpp_shape_active_buying_frequency_type[1] = {-1};
1224 cycpp_shape_active_buying_frequency_type = std::vector<int>(rawcycpp_shape_active_buying_frequency_type, rawcycpp_shape_active_buying_frequency_type + 1);
1225 int rawcycpp_shape_active_buying_val[1] = {-1};
1226 cycpp_shape_active_buying_val = std::vector<int>(rawcycpp_shape_active_buying_val, rawcycpp_shape_active_buying_val + 1);
1227 int rawcycpp_shape_active_buying_min[1] = {-1};
1228 cycpp_shape_active_buying_min = std::vector<int>(rawcycpp_shape_active_buying_min, rawcycpp_shape_active_buying_min + 1);
1229 int rawcycpp_shape_active_buying_max[1] = {-1};
1230 cycpp_shape_active_buying_max = std::vector<int>(rawcycpp_shape_active_buying_max, rawcycpp_shape_active_buying_max + 1);
1231 int rawcycpp_shape_active_buying_mean[1] = {-1};
1232 cycpp_shape_active_buying_mean = std::vector<int>(rawcycpp_shape_active_buying_mean, rawcycpp_shape_active_buying_mean + 1);
1233 int rawcycpp_shape_active_buying_stddev[1] = {-1};
1234 cycpp_shape_active_buying_stddev = std::vector<int>(rawcycpp_shape_active_buying_stddev, rawcycpp_shape_active_buying_stddev + 1);
1235 int rawcycpp_shape_dormant_buying_frequency_type[1] = {-1};
1236 cycpp_shape_dormant_buying_frequency_type = std::vector<int>(rawcycpp_shape_dormant_buying_frequency_type, rawcycpp_shape_dormant_buying_frequency_type + 1);
1237 int rawcycpp_shape_dormant_buying_val[1] = {-1};
1238 cycpp_shape_dormant_buying_val = std::vector<int>(rawcycpp_shape_dormant_buying_val, rawcycpp_shape_dormant_buying_val + 1);
1239 int rawcycpp_shape_dormant_buying_min[1] = {-1};
1240 cycpp_shape_dormant_buying_min = std::vector<int>(rawcycpp_shape_dormant_buying_min, rawcycpp_shape_dormant_buying_min + 1);
1241 int rawcycpp_shape_dormant_buying_max[1] = {-1};
1242 cycpp_shape_dormant_buying_max = std::vector<int>(rawcycpp_shape_dormant_buying_max, rawcycpp_shape_dormant_buying_max + 1);
1243 int rawcycpp_shape_dormant_buying_mean[1] = {-1};
1244 cycpp_shape_dormant_buying_mean = std::vector<int>(rawcycpp_shape_dormant_buying_mean, rawcycpp_shape_dormant_buying_mean + 1);
1245 int rawcycpp_shape_dormant_buying_stddev[1] = {-1};
1246 cycpp_shape_dormant_buying_stddev = std::vector<int>(rawcycpp_shape_dormant_buying_stddev, rawcycpp_shape_dormant_buying_stddev + 1);
1247 int rawcycpp_shape_buying_size_type[1] = {-1};
1248 cycpp_shape_buying_size_type = std::vector<int>(rawcycpp_shape_buying_size_type, rawcycpp_shape_buying_size_type + 1);
1249 int rawcycpp_shape_buying_size_val[1] = {-1};
1250 cycpp_shape_buying_size_val = std::vector<int>(rawcycpp_shape_buying_size_val, rawcycpp_shape_buying_size_val + 1);
1251 int rawcycpp_shape_buying_size_min[1] = {-1};
1252 cycpp_shape_buying_size_min = std::vector<int>(rawcycpp_shape_buying_size_min, rawcycpp_shape_buying_size_min + 1);
1253 int rawcycpp_shape_buying_size_max[1] = {-1};
1254 cycpp_shape_buying_size_max = std::vector<int>(rawcycpp_shape_buying_size_max, rawcycpp_shape_buying_size_max + 1);
1255 int rawcycpp_shape_buying_size_mean[1] = {-1};
1256 cycpp_shape_buying_size_mean = std::vector<int>(rawcycpp_shape_buying_size_mean, rawcycpp_shape_buying_size_mean + 1);
1257 int rawcycpp_shape_buying_size_stddev[1] = {-1};
1258 cycpp_shape_buying_size_stddev = std::vector<int>(rawcycpp_shape_buying_size_stddev, rawcycpp_shape_buying_size_stddev + 1);
1259 int rawcycpp_shape_reorder_point[1] = {-1};
1260 cycpp_shape_reorder_point = std::vector<int>(rawcycpp_shape_reorder_point, rawcycpp_shape_reorder_point + 1);
1261 int rawcycpp_shape_reorder_quantity[1] = {-1};
1262 cycpp_shape_reorder_quantity = std::vector<int>(rawcycpp_shape_reorder_quantity, rawcycpp_shape_reorder_quantity + 1);
1263 int rawcycpp_shape_cumulative_cap[1] = {-1};
1264 cycpp_shape_cumulative_cap = std::vector<int>(rawcycpp_shape_cumulative_cap, rawcycpp_shape_cumulative_cap + 1);
1265 int rawcycpp_shape_package[1] = {-1};
1266 cycpp_shape_package = std::vector<int>(rawcycpp_shape_package, rawcycpp_shape_package + 1);
1267 int rawcycpp_shape_transport_unit[1] = {-1};
1268 cycpp_shape_transport_unit = std::vector<int>(rawcycpp_shape_transport_unit, rawcycpp_shape_transport_unit + 1);
1269 int rawcycpp_shape_inventory[2] = {-1, -1};
1270 cycpp_shape_inventory = std::vector<int>(rawcycpp_shape_inventory, rawcycpp_shape_inventory + 2);
1271 int rawcycpp_shape_stocks[2] = {-1, -1};
1272 cycpp_shape_stocks = std::vector<int>(rawcycpp_shape_stocks, rawcycpp_shape_stocks + 2);
1273 int rawcycpp_shape_ready[2] = {-1, -1};
1274 cycpp_shape_ready = std::vector<int>(rawcycpp_shape_ready, rawcycpp_shape_ready + 2);
1275 int rawcycpp_shape_processing[2] = {-1, -1};
1276 cycpp_shape_processing = std::vector<int>(rawcycpp_shape_processing, rawcycpp_shape_processing + 2);
1277 int rawcycpp_shape_inventory_tracker[1] = {-1};
1278 cycpp_shape_inventory_tracker = std::vector<int>(rawcycpp_shape_inventory_tracker, rawcycpp_shape_inventory_tracker + 1);
1279 int rawcycpp_shape_latitude[1] = {-1};
1280 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
1281 int rawcycpp_shape_longitude[1] = {-1};
1282 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
1283 cyclus::QueryResult qr = b->Query("Info", NULL);
1284 in_commods = qr.GetVal<std::vector< std::string > >("in_commods");
1285 in_commod_prefs = qr.GetVal<std::vector< double > >("in_commod_prefs");
1286 out_commods = qr.GetVal<std::vector< std::string > >("out_commods");
1287 in_recipe = qr.GetVal<std::string>("in_recipe");
1288 residence_time = qr.GetVal<int>("residence_time");
1289 sell_quantity = qr.GetVal<double>("sell_quantity");
1290 throughput = qr.GetVal<double>("throughput");
1291 max_inv_size = qr.GetVal<double>("max_inv_size");
1292 discrete_handling = qr.GetVal<bool>("discrete_handling");
1293 active_buying_frequency_type = qr.GetVal<std::string>("active_buying_frequency_type");
1294 active_buying_val = qr.GetVal<int>("active_buying_val");
1295 active_buying_min = qr.GetVal<int>("active_buying_min");
1296 active_buying_max = qr.GetVal<int>("active_buying_max");
1297 active_buying_mean = qr.GetVal<double>("active_buying_mean");
1298 active_buying_stddev = qr.GetVal<double>("active_buying_stddev");
1299 dormant_buying_frequency_type = qr.GetVal<std::string>("dormant_buying_frequency_type");
1300 dormant_buying_val = qr.GetVal<int>("dormant_buying_val");
1301 dormant_buying_min = qr.GetVal<int>("dormant_buying_min");
1302 dormant_buying_max = qr.GetVal<int>("dormant_buying_max");
1303 dormant_buying_mean = qr.GetVal<double>("dormant_buying_mean");
1304 dormant_buying_stddev = qr.GetVal<double>("dormant_buying_stddev");
1305 buying_size_type = qr.GetVal<std::string>("buying_size_type");
1306 buying_size_val = qr.GetVal<double>("buying_size_val");
1307 buying_size_min = qr.GetVal<double>("buying_size_min");
1308 buying_size_max = qr.GetVal<double>("buying_size_max");
1309 buying_size_mean = qr.GetVal<double>("buying_size_mean");
1310 buying_size_stddev = qr.GetVal<double>("buying_size_stddev");
1311 reorder_point = qr.GetVal<double>("reorder_point");
1312 reorder_quantity = qr.GetVal<double>("reorder_quantity");
1313 cumulative_cap = qr.GetVal<double>("cumulative_cap");
1314 package = qr.GetVal<std::string>("package");
1315 transport_unit = qr.GetVal<std::string>("transport_unit");
1316 latitude = qr.GetVal<double>("latitude");
1317 longitude = qr.GetVal<double>("longitude");
1318 inventory.capacity(1e+300);
1319 stocks.capacity(1e+300);
1320 ready.capacity(1e+300);
1321 processing.capacity(1e+300);
1322 inventory_tracker.capacity();
1323#line 43 "/cycamore/src/storage.cc"
1324
1325 cyclus::toolkit::Commodity commod = cyclus::toolkit::Commodity(out_commods.front());
1326 cyclus::toolkit::CommodityProducer::Add(commod);
1327 cyclus::toolkit::CommodityProducer::SetCapacity(commod, throughput);
1328}
1329
1333 throw cyclus::ValueError("Active min larger than max.");
1334 }
1336 throw cyclus::ValueError("Dormant min larger than max.");
1337 }
1339 throw cyclus::ValueError("Buying size min larger than max.");
1340 }
1341
1342 if (active_buying_frequency_type == "Fixed") {
1343 active_dist_ = cyclus::FixedIntDist::Ptr (new cyclus::FixedIntDist(active_buying_val));
1344 }
1345 else if (active_buying_frequency_type == "Uniform") {
1346 if ((active_buying_min == -1) || (active_buying_max == -1)) {
1347 throw cyclus::ValueError("Invalid active buying frequency range. Please provide both a min and max value.");
1348 }
1349 active_dist_ = cyclus::UniformIntDist::Ptr (new cyclus::UniformIntDist(active_buying_min, active_buying_max));
1350 }
1351 else if (active_buying_frequency_type == "Normal") {
1352 if ((active_buying_mean == -1) || (active_buying_stddev == -1)) {
1353 throw cyclus::ValueError("Invalid active buying frequency range. Please provide both a mean and standard deviation value.");
1354 }
1355 if (active_buying_min == -1) {active_buying_min = 1;}
1356 if (active_buying_max == -1) {
1357 active_buying_max = std::numeric_limits<int>::max();}
1358
1359 active_dist_ = cyclus::NormalIntDist::Ptr (new cyclus::NormalIntDist(active_buying_mean, active_buying_stddev,
1361 }
1362 else {
1363 throw cyclus::ValueError("Invalid active buying frequency type");}
1364
1366 if (dormant_buying_frequency_type == "Fixed") {
1367 dormant_dist_ = cyclus::FixedIntDist::Ptr (new cyclus::FixedIntDist(dormant_buying_val));
1368 }
1369 else if (dormant_buying_frequency_type == "Uniform") {
1370 if ((dormant_buying_min == -1) || (dormant_buying_max == -1)) {
1371 throw cyclus::ValueError("Invalid dormant buying frequency range. Please provide both a min and max value.");
1372 }
1373 dormant_dist_ = cyclus::UniformIntDist::Ptr (new cyclus::UniformIntDist(dormant_buying_min, dormant_buying_max));
1374 }
1375 else if (dormant_buying_frequency_type == "Normal") {
1376 if ((dormant_buying_mean == -1) || (dormant_buying_stddev == -1)) {
1377 throw cyclus::ValueError("Invalid dormant buying frequency range. Please provide both a mean and standard deviation value.");
1378 }
1379 if (dormant_buying_min == -1) {dormant_buying_min = 1;}
1380 if (dormant_buying_max == -1) {
1381 dormant_buying_max = std::numeric_limits<int>::max();}
1382 dormant_dist_ = cyclus::NormalIntDist::Ptr (new cyclus::NormalIntDist(dormant_buying_mean, dormant_buying_stddev,
1384 }
1385 else {
1386 throw cyclus::ValueError("Invalid dormant buying frequency type");}
1387
1389 if (buying_size_type == "Fixed") {
1390 size_dist_ = cyclus::FixedDoubleDist::Ptr (new cyclus::FixedDoubleDist(buying_size_val));
1391 }
1392 else if (buying_size_type == "Uniform") {
1393 if ((buying_size_min == -1) || (buying_size_max == -1)) {
1394 throw cyclus::ValueError("Invalid buying size range. Please provide both a min and max value.");
1395 }
1396 size_dist_ = cyclus::UniformDoubleDist::Ptr (new cyclus::UniformDoubleDist(buying_size_min, buying_size_max));
1397 }
1398 else if (buying_size_type == "Normal") {
1399 if ((buying_size_mean == -1) || (buying_size_stddev == -1)) {
1400 throw cyclus::ValueError("Invalid buying size range. Please provide both a mean and standard deviation value.");
1401 }
1402 if (buying_size_min == -1) {buying_size_min = 0;}
1403 if (buying_size_max == -1) {buying_size_max = 1;}
1404 size_dist_ = cyclus::NormalDoubleDist::Ptr (new cyclus::NormalDoubleDist(buying_size_mean, buying_size_stddev,
1406 }
1407 else {
1408 throw cyclus::ValueError("Invalid buying size type");}
1409}
1410
1411//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1413 cyclus::Facility::EnterNotify();
1414
1415 inventory_tracker.set_capacity(max_inv_size);
1416 if (reorder_point < 0 && cumulative_cap <= 0) {
1418 buy_policy.Init(this, &inventory, std::string("inventory"),
1421 }
1422 else if (cumulative_cap > 0) {
1424 buy_policy.Init(this, &inventory, std::string("inventory"),
1427 }
1428 else if (reorder_quantity > 0) {
1430 throw cyclus::ValueError(
1431 "reorder_point + reorder_quantity must be less than or equal to max_inv_size");
1432 }
1433 buy_policy.Init(this, &inventory, std::string("inventory"),
1436 }
1437 else {
1438 buy_policy.Init(this, &inventory, std::string("inventory"),
1441 }
1442
1443 // dummy comp, use in_recipe if provided
1444 cyclus::CompMap v;
1445 cyclus::Composition::Ptr comp = cyclus::Composition::CreateFromAtom(v);
1446 if (in_recipe != "") {
1447 comp = context()->GetRecipe(in_recipe);
1448 }
1449
1450 if (in_commod_prefs.size() == 0) {
1451 for (int i = 0; i < in_commods.size(); ++i) {
1452 in_commod_prefs.push_back(cyclus::kDefaultPref);
1453 }
1454 } else if (in_commod_prefs.size() != in_commods.size()) {
1455 std::stringstream ss;
1456 ss << "in_commod_prefs has " << in_commod_prefs.size()
1457 << " values, expected " << in_commods.size();
1458 throw cyclus::ValueError(ss.str());
1459 }
1460
1461 for (int i = 0; i != in_commods.size(); ++i) {
1462 buy_policy.Set(in_commods[i], comp, in_commod_prefs[i]);
1463 }
1464 buy_policy.Start();
1465
1466 std::string package_name_ = context()->GetPackage(package)->name();
1467 std::string tu_name_ = context()->GetTransportUnit(transport_unit)->name();
1468 if (out_commods.size() == 1) {
1469 sell_policy.Init(this, &stocks, std::string("stocks"), cyclus::CY_LARGE_DOUBLE, false,
1470 sell_quantity, package_name_, tu_name_)
1471 .Set(out_commods.front())
1472 .Start();
1473
1474 } else {
1475 std::stringstream ss;
1476 ss << "out_commods has " << out_commods.size() << " values, expected 1.";
1477 throw cyclus::ValueError(ss.str());
1478 }
1480}
1481
1482//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1483std::string Storage::str() {
1484 std::stringstream ss;
1485 std::string ans, out_str;
1486 if (out_commods.size() == 1) {
1487 out_str = out_commods.front();
1488 } else {
1489 out_str = "";
1490 }
1491 if (cyclus::toolkit::CommodityProducer::Produces(
1492 cyclus::toolkit::Commodity(out_str))) {
1493 ans = "yes";
1494 } else {
1495 ans = "no";
1496 }
1497 ss << cyclus::Facility::str();
1498 ss << " has facility parameters {"
1499 << "\n"
1500 << " Output Commodity = " << out_str << ",\n"
1501 << " Residence Time = " << residence_time << ",\n"
1502 << " Throughput = " << throughput << ",\n"
1503 << " commod producer members: "
1504 << " produces " << out_str << "?:" << ans << "'}";
1505 return ss.str();
1506}
1507
1508//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1510
1511
1512 LOG(cyclus::LEV_INFO3, "ComCnv") << prototype() << " is ticking {";
1513
1514 LOG(cyclus::LEV_INFO5, "ComCnv") << "Processing = " << processing.quantity() << ", ready = " << ready.quantity() << ", stocks = " << stocks.quantity() << " and max inventory = " << max_inv_size;
1515
1516 LOG(cyclus::LEV_INFO4, "ComCnv") << "current capacity " << max_inv_size << " - " << processing.quantity() << " - " << ready.quantity() << " - " << stocks.quantity() << " = " << current_capacity();
1517
1518 if (current_capacity() > cyclus::eps_rsrc()) {
1519 LOG(cyclus::LEV_INFO4, "ComCnv")
1520 << " has capacity for " << current_capacity() << ".";
1521 }
1522 LOG(cyclus::LEV_INFO3, "ComCnv") << "}";
1523}
1524
1525//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1527 LOG(cyclus::LEV_INFO3, "ComCnv") << prototype() << " is tocking {";
1528
1529 BeginProcessing_(); // place unprocessed inventory into processing
1530
1531 LOG(cyclus::LEV_INFO4, "ComCnv") << "processing currently holds " << processing.quantity() << ". ready currently holds " << ready.quantity() << ".";
1532
1533 if (ready_time() >= 0 || residence_time == 0 && !inventory.empty()) {
1534 ReadyMatl_(ready_time()); // place processing into ready
1535 }
1536
1537 LOG(cyclus::LEV_INFO5, "ComCnv") << "Ready now holds " << ready.quantity() << " kg.";
1538
1539 if (ready.quantity() > throughput) {
1540 LOG(cyclus::LEV_INFO5, "ComCnv") << "Up to " << throughput << " kg will be placed in stocks based on throughput limits. ";
1541 }
1542
1543 ProcessMat_(throughput); // place ready into stocks
1544
1545 std::vector<double>::iterator result;
1546 result = std::max_element(in_commod_prefs.begin(), in_commod_prefs.end());
1547 int maxindx = std::distance(in_commod_prefs.begin(), result);
1548 double demand = 0;
1549 demand = current_capacity();
1550
1551 cyclus::toolkit::RecordTimeSeries<double>("demand"+in_commods[maxindx], this, demand);
1552
1553 // Multiple commodity tracking is not supported, user can only
1554 // provide one value for out_commods, despite it being a vector of strings.
1555 cyclus::toolkit::RecordTimeSeries<double>("supply"+out_commods[0], this,
1556 stocks.quantity());
1557
1558 LOG(cyclus::LEV_INFO4, "ComCnv") << "process has "
1559 << processing.quantity() << ". Ready has " << ready.quantity() << ". Stocks has " << stocks.quantity() << ".";
1560 LOG(cyclus::LEV_INFO3, "ComCnv") << "}";
1561}
1562
1563//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1564void Storage::AddMat_(cyclus::Material::Ptr mat) {
1565 LOG(cyclus::LEV_INFO5, "ComCnv") << prototype() << " is initially holding "
1566 << inventory.quantity() << " total.";
1567
1568 try {
1569 inventory.Push(mat);
1570 } catch (cyclus::Error& e) {
1571 e.msg(Agent::InformErrorMsg(e.msg()));
1572 throw e;
1573 }
1574
1575 LOG(cyclus::LEV_INFO5, "ComCnv")
1576 << prototype() << " added " << mat->quantity()
1577 << " of material to its inventory, which is holding "
1578 << inventory.quantity() << " total.";
1579}
1580
1581//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1583 while (inventory.count() > 0) {
1584 try {
1585 processing.Push(inventory.Pop());
1586 entry_times.push_back(context()->time());
1587
1588 LOG(cyclus::LEV_DEBUG2, "ComCnv")
1589 << "Storage " << prototype()
1590 << " added resources to processing at t= " << context()->time();
1591 } catch (cyclus::Error& e) {
1592 e.msg(Agent::InformErrorMsg(e.msg()));
1593 throw e;
1594 }
1595 }
1596}
1597
1598//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1599void Storage::ProcessMat_(double cap) {
1600 if (!ready.empty()) {
1601 try {
1602 double max_pop = std::min(cap, ready.quantity());
1603
1604 if (discrete_handling) {
1605 if (max_pop == ready.quantity()) {
1606 stocks.Push(ready.PopN(ready.count()));
1607 } else {
1608 double cap_pop = ready.Peek()->quantity();
1609 while (cap_pop <= max_pop && !ready.empty()) {
1610 stocks.Push(ready.Pop());
1611 cap_pop += ready.empty() ? 0 : ready.Peek()->quantity();
1612 }
1613 }
1614 } else {
1615 stocks.Push(ready.Pop(max_pop, cyclus::eps_rsrc()));
1616 }
1617
1618 LOG(cyclus::LEV_INFO4, "ComCnv") << "Storage " << prototype()
1619 << " moved resources"
1620 << " from ready to stocks"
1621 << " at t= " << context()->time();
1622 } catch (cyclus::Error& e) {
1623 e.msg(Agent::InformErrorMsg(e.msg()));
1624 throw e;
1625 }
1626 }
1627}
1628
1629//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1630void Storage::ReadyMatl_(int time) {
1631 LOG(cyclus::LEV_INFO5, "ComCnv") << "Placing material into ready";
1632
1633 int to_ready = 0;
1634
1635 while (!entry_times.empty() && entry_times.front() <= time) {
1636 entry_times.pop_front();
1637 ++to_ready;
1638 }
1639
1640 ready.Push(processing.PopN(to_ready));
1641}
1642
1644 std::string specification = this->spec();
1645 context()
1646 ->NewDatum("AgentPosition")
1647 ->AddVal("Spec", specification)
1648 ->AddVal("Prototype", this->prototype())
1649 ->AddVal("AgentId", id())
1650 ->AddVal("Latitude", latitude)
1651 ->AddVal("Longitude", longitude)
1652 ->Record();
1653}
1654
1655
1656// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1657extern "C" cyclus::Agent* ConstructStorage(cyclus::Context* ctx) {
1658 return new Storage(ctx);
1659}
1660
1661} // namespace cycamore
cyclus::toolkit::ResBuf< cyclus::Material > inventory
This Facility is intended to hold materials for a user specified amount of time in order to model a s...
Storage(cyclus::Context *ctx)
void AddMat_(cyclus::Material::Ptr mat)
adds a material into the incoming commodity inventory
std::vector< int > cycpp_shape_dormant_buying_min
virtual std::string str()
A verbose printer for the Storage Facility.
std::vector< int > cycpp_shape_inventory_tracker
double current_capacity()
current maximum amount that can be added to processing
std::vector< int > cycpp_shape_buying_size_stddev
cyclus::IntDistribution::Ptr active_dist_
cyclus::toolkit::MatlSellPolicy sell_policy
std::vector< int > cycpp_shape_buying_size_max
std::vector< int > cycpp_shape_active_buying_val
virtual std::string schema()
std::vector< int > cycpp_shape_processing
cyclus::toolkit::ResBuf< cyclus::Material > ready
cyclus::DoubleDistribution::Ptr size_dist_
std::vector< int > cycpp_shape_reorder_point
std::vector< int > cycpp_shape_cumulative_cap
std::vector< double > in_commod_prefs
std::vector< int > cycpp_shape_longitude
std::vector< int > cycpp_shape_dormant_buying_max
std::vector< int > cycpp_shape_dormant_buying_mean
std::vector< int > cycpp_shape_buying_size_type
cyclus::toolkit::ResBuf< cyclus::Material > processing
virtual void InitFrom(cycamore::Storage *m)
std::vector< int > cycpp_shape_residence_time
std::vector< int > cycpp_shape_out_commods
cyclus::toolkit::TotalInvTracker inventory_tracker
std::vector< int > cycpp_shape_dormant_buying_stddev
virtual cyclus::Agent * Clone()
std::vector< int > cycpp_shape_package
std::vector< int > cycpp_shape_in_commods
virtual void InfileToDb(cyclus::InfileTree *tree, cyclus::DbInit di)
std::vector< std::string > in_commods
std::vector< int > cycpp_shape_active_buying_stddev
cyclus::IntDistribution::Ptr dormant_dist_
std::vector< int > cycpp_shape_buying_size_min
virtual void Tock()
The handleTick function specific to the Storage.
std::vector< int > cycpp_shape_max_inv_size
void InitBuyPolicyParameters()
sets up the distributions for the buy policy
std::vector< int > cycpp_shape_buying_size_mean
std::string active_buying_frequency_type
std::string dormant_buying_frequency_type
cyclus::toolkit::ResBuf< cyclus::Material > inventory
int ready_time()
returns the time key for ready materials
std::vector< int > cycpp_shape_buying_size_val
std::vector< int > cycpp_shape_dormant_buying_val
void ProcessMat_(double cap)
Move as many ready resources as allowable into stocks.
std::vector< int > cycpp_shape_discrete_handling
std::vector< int > cycpp_shape_sell_quantity
std::vector< int > cycpp_shape_reorder_quantity
virtual void InitInv(cyclus::Inventories &inv)
std::vector< int > cycpp_shape_active_buying_min
std::vector< std::string > out_commods
std::list< int > entry_times
std::vector< int > cycpp_shape_dormant_buying_frequency_type
std::vector< int > cycpp_shape_latitude
std::vector< int > cycpp_shape_active_buying_max
void ReadyMatl_(int time)
move ready resources from processing to ready at a certain time
std::vector< int > cycpp_shape_active_buying_mean
std::vector< int > cycpp_shape_active_buying_frequency_type
void BeginProcessing_()
Move all unprocessed inventory to processing.
std::vector< int > cycpp_shape_inventory
std::vector< int > cycpp_shape_transport_unit
cyclus::toolkit::ResBuf< cyclus::Material > stocks
virtual void EnterNotify()
Sets up the Storage Facility's trade requests.
virtual Json::Value annotations()
std::vector< int > cycpp_shape_in_commod_prefs
virtual cyclus::Inventories SnapshotInv()
std::vector< int > cycpp_shape_stocks
virtual void Snapshot(cyclus::DbInit di)
std::vector< int > cycpp_shape_throughput
cyclus::toolkit::MatlBuyPolicy buy_policy
std::vector< int > cycpp_shape_ready
virtual void Tick()
The handleTick function specific to the Storage.
std::vector< int > cycpp_shape_in_recipe
cyclus::Agent * ConstructStorage(cyclus::Context *ctx)
cyclus::toolkit::Position coordinates