CYCAMORE
Loading...
Searching...
No Matches
build/cycamore/reactor.cc
Go to the documentation of this file.
1
2#line 1 "/cycamore/src/reactor.cc"
3#include "reactor.h"
4
5using cyclus::Material;
6using cyclus::toolkit::MatVec;
7using cyclus::KeyError;
8using cyclus::ValueError;
9using cyclus::Request;
10
11namespace cycamore {
12
13Reactor::Reactor(cyclus::Context* ctx)
14 : cyclus::Facility(ctx),
16 assem_size(0),
17 n_assem_core(0),
20 cycle_time(0),
21 refuel_time(0),
22 cycle_step(0),
23 power_cap(0),
24 power_name("power"),
25 discharged(false),
26 keep_packaging(true) {}
27cyclus::Agent* Reactor::Clone() {
28 cycamore::Reactor* m = new cycamore::Reactor(context());
29 m->InitFrom(this);
30 return m;
31};
32#line 25 "/cycamore/src/reactor.cc"
33
34std::string Reactor::schema() {
35 return ""
36 "<interleave>\n"
37 " <optional>\n"
38 " <element name=\"latitude\">\n"
39 " <a:documentation>Latitude of the agent's geographical position. The value should be expressed in degrees as a double.</a:documentation>\n"
40 " <data type=\"double\"/>\n"
41 " </element>\n"
42 " </optional>\n"
43 " <optional>\n"
44 " <element name=\"longitude\">\n"
45 " <a:documentation>Longitude of the agent's geographical position. The value should be expressed in degrees as a double.</a:documentation>\n"
46 " <data type=\"double\"/>\n"
47 " </element>\n"
48 " </optional>\n"
49 " <element name=\"fuel_incommods\">\n"
50 " <oneOrMore>\n"
51 " <element name=\"val\">\n"
52 " <data type=\"string\"/>\n"
53 " </element>\n"
54 " </oneOrMore>\n"
55 " </element>\n"
56 " <element name=\"fuel_inrecipes\">\n"
57 " <oneOrMore>\n"
58 " <element name=\"val\">\n"
59 " <data type=\"string\"/>\n"
60 " </element>\n"
61 " </oneOrMore>\n"
62 " </element>\n"
63 " <optional>\n"
64 " <element name=\"fuel_prefs\">\n"
65 " <oneOrMore>\n"
66 " <element name=\"val\">\n"
67 " <data type=\"double\"/>\n"
68 " </element>\n"
69 " </oneOrMore>\n"
70 " </element>\n"
71 " </optional>\n"
72 " <element name=\"fuel_outcommods\">\n"
73 " <oneOrMore>\n"
74 " <element name=\"val\">\n"
75 " <data type=\"string\"/>\n"
76 " </element>\n"
77 " </oneOrMore>\n"
78 " </element>\n"
79 " <element name=\"fuel_outrecipes\">\n"
80 " <oneOrMore>\n"
81 " <element name=\"val\">\n"
82 " <data type=\"string\"/>\n"
83 " </element>\n"
84 " </oneOrMore>\n"
85 " </element>\n"
86 " <optional>\n"
87 " <element name=\"recipe_change_times\">\n"
88 " <oneOrMore>\n"
89 " <element name=\"val\">\n"
90 " <data type=\"int\"/>\n"
91 " </element>\n"
92 " </oneOrMore>\n"
93 " </element>\n"
94 " </optional>\n"
95 " <optional>\n"
96 " <element name=\"recipe_change_commods\">\n"
97 " <oneOrMore>\n"
98 " <element name=\"val\">\n"
99 " <data type=\"string\"/>\n"
100 " </element>\n"
101 " </oneOrMore>\n"
102 " </element>\n"
103 " </optional>\n"
104 " <optional>\n"
105 " <element name=\"recipe_change_in\">\n"
106 " <oneOrMore>\n"
107 " <element name=\"val\">\n"
108 " <data type=\"string\"/>\n"
109 " </element>\n"
110 " </oneOrMore>\n"
111 " </element>\n"
112 " </optional>\n"
113 " <optional>\n"
114 " <element name=\"recipe_change_out\">\n"
115 " <oneOrMore>\n"
116 " <element name=\"val\">\n"
117 " <data type=\"string\"/>\n"
118 " </element>\n"
119 " </oneOrMore>\n"
120 " </element>\n"
121 " </optional>\n"
122 " <element name=\"assem_size\">\n"
123 " <a:documentation>Mass (kg) of a single assembly.</a:documentation>\n"
124 " <data type=\"double\"/>\n"
125 " </element>\n"
126 " <element name=\"n_assem_batch\">\n"
127 " <a:documentation>Number of assemblies that constitute a single batch. This is the number of assemblies discharged from the core fully burned each cycle.Batch size is equivalent to ``n_assem_batch / n_assem_core``.</a:documentation>\n"
128 " <data type=\"int\"/>\n"
129 " </element>\n"
130 " <optional>\n"
131 " <element name=\"n_assem_core\">\n"
132 " <a:documentation>Number of assemblies that constitute a full core.</a:documentation>\n"
133 " <data type=\"int\"/>\n"
134 " </element>\n"
135 " </optional>\n"
136 " <optional>\n"
137 " <element name=\"n_assem_fresh\">\n"
138 " <a:documentation>Number of fresh fuel assemblies to keep on-hand if possible.</a:documentation>\n"
139 " <data type=\"int\"/>\n"
140 " </element>\n"
141 " </optional>\n"
142 " <optional>\n"
143 " <element name=\"n_assem_spent\">\n"
144 " <a:documentation>Number of spent fuel assemblies that can be stored on-site before reactor operation stalls.</a:documentation>\n"
145 " <data type=\"int\"/>\n"
146 " </element>\n"
147 " </optional>\n"
148 " <optional>\n"
149 " <element name=\"cycle_time\">\n"
150 " <a:documentation>The duration of a full operational cycle (excluding refueling time) in time steps.</a:documentation>\n"
151 " <data type=\"int\"/>\n"
152 " </element>\n"
153 " </optional>\n"
154 " <optional>\n"
155 " <element name=\"refuel_time\">\n"
156 " <a:documentation>The duration of a full refueling period - the minimum time between the end of a cycle and the start of the next cycle.</a:documentation>\n"
157 " <data type=\"int\"/>\n"
158 " </element>\n"
159 " </optional>\n"
160 " <optional>\n"
161 " <element name=\"cycle_step\">\n"
162 " <a:documentation>Number of time steps since the start of the last cycle. Only set this if you know what you are doing</a:documentation>\n"
163 " <data type=\"int\"/>\n"
164 " </element>\n"
165 " </optional>\n"
166 " <optional>\n"
167 " <element name=\"power_cap\">\n"
168 " <a:documentation>Amount of electrical power the facility produces when operating normally.</a:documentation>\n"
169 " <data type=\"double\"/>\n"
170 " </element>\n"
171 " </optional>\n"
172 " <optional>\n"
173 " <element name=\"power_name\">\n"
174 " <a:documentation>The name of the 'power' commodity used in conjunction with a deployment curve.</a:documentation>\n"
175 " <data type=\"string\"/>\n"
176 " </element>\n"
177 " </optional>\n"
178 " <optional>\n"
179 " <element name=\"side_products\">\n"
180 " <oneOrMore>\n"
181 " <element name=\"val\">\n"
182 " <data type=\"string\"/>\n"
183 " </element>\n"
184 " </oneOrMore>\n"
185 " </element>\n"
186 " </optional>\n"
187 " <optional>\n"
188 " <element name=\"side_product_quantity\">\n"
189 " <oneOrMore>\n"
190 " <element name=\"val\">\n"
191 " <data type=\"double\"/>\n"
192 " </element>\n"
193 " </oneOrMore>\n"
194 " </element>\n"
195 " </optional>\n"
196 " <optional>\n"
197 " <element name=\"decom_transmute_all\">\n"
198 " <a:documentation>If true, the archetype transmutes all assemblies upon decommissioning If false, the archetype only transmutes half.</a:documentation>\n"
199 " <data type=\"boolean\"/>\n"
200 " </element>\n"
201 " </optional>\n"
202 " <optional>\n"
203 " <element name=\"pref_change_times\">\n"
204 " <oneOrMore>\n"
205 " <element name=\"val\">\n"
206 " <data type=\"int\"/>\n"
207 " </element>\n"
208 " </oneOrMore>\n"
209 " </element>\n"
210 " </optional>\n"
211 " <optional>\n"
212 " <element name=\"pref_change_commods\">\n"
213 " <oneOrMore>\n"
214 " <element name=\"val\">\n"
215 " <data type=\"string\"/>\n"
216 " </element>\n"
217 " </oneOrMore>\n"
218 " </element>\n"
219 " </optional>\n"
220 " <optional>\n"
221 " <element name=\"pref_change_values\">\n"
222 " <oneOrMore>\n"
223 " <element name=\"val\">\n"
224 " <data type=\"double\"/>\n"
225 " </element>\n"
226 " </oneOrMore>\n"
227 " </element>\n"
228 " </optional>\n"
229 " <optional>\n"
230 " <element name=\"keep_packaging\">\n"
231 " <a:documentation>Boolean value about whether to keep packaging. If true, packaging will not be stripped upon acceptance into the reactor. If false, package type will be stripped immediately upon acceptance. Has no effect if the incoming material is not packaged.</a:documentation>\n"
232 " <data type=\"boolean\"/>\n"
233 " </element>\n"
234 " </optional>\n"
235 "</interleave>\n";
236};
237#line 26 "/cycamore/src/reactor.cc"
238
239Json::Value Reactor::annotations() {
240 Json::Value root;
241 Json::Reader reader;
242 bool parsed_ok = reader.parse(
243 "{\"name\":\"cycamore::Reactor\",\"entity\":\"facility\",\"p"
244 "arents\":[\"cyclus::Facility\",\"cyclus::toolkit::Comm"
245 "odityProducer\",\"cyclus::toolkit::Position\"],\"all_p"
246 "arents\":[\"EconomicEntity\",\"cyclus::Agent\",\"cyclus:"
247 ":Facility\",\"cyclus::Ider\",\"cyclus::StateWrangler\","
248 "\"cyclus::TimeListener\",\"cyclus::Trader\",\"cyclus::t"
249 "oolkit::AgentManaged\",\"cyclus::toolkit::CommodityP"
250 "roducer\",\"cyclus::toolkit::Position\"],\"vars\":{\"lat"
251 "itude\":{\"default\":0.0,\"uilabel\":\"Geographical "
252 "latitude in degrees as a double\",\"doc\":\"Latitude "
253 "of the agent's geographical position. The value "
254 "should be expressed in degrees as a double.\",\"type"
255 "\":\"double\",\"index\":0,\"shape\":[-"
256 "1],\"alias\":\"latitude\",\"tooltip\":\"latitude\"},\"longi"
257 "tude\":{\"default\":0.0,\"uilabel\":\"Geographical "
258 "longitude in degrees as a double\",\"doc\":\"Longitude"
259 " of the agent's geographical position. The value "
260 "should be expressed in degrees as a double.\",\"type"
261 "\":\"double\",\"index\":1,\"shape\":[-"
262 "1],\"alias\":\"longitude\",\"tooltip\":\"longitude\"},\"fue"
263 "l_incommods\":{\"uitype\":[\"oneormore\",\"incommodity\"]"
264 ",\"uilabel\":[\"Fresh Fuel Commodity "
265 "List\",\"\"],\"doc\":\"Ordered list of input commodities"
266 " on which to requesting fuel.\",\"type\":[\"std::vecto"
267 "r\",\"std::string\"],\"index\":2,\"shape\":[-1,-"
268 "1],\"alias\":[\"fuel_incommods\",\"val\"],\"tooltip\":[\"fu"
269 "el_incommods\",\"\"]},\"fuel_inrecipes\":{\"uitype\":[\"on"
270 "eormore\",\"inrecipe\"],\"uilabel\":[\"Fresh Fuel Recipe"
271 " List\",\"\"],\"doc\":\"Fresh fuel recipes to request "
272 "for each of the given fuel input commodities (same"
273 " order).\",\"type\":[\"std::vector\",\"std::string\"],\"in"
274 "dex\":3,\"shape\":[-1,-"
275 "1],\"alias\":[\"fuel_inrecipes\",\"val\"],\"tooltip\":[\"fu"
276 "el_inrecipes\",\"\"]},\"fuel_prefs\":{\"default\":[],\"uil"
277 "abel\":[\"Fresh Fuel Preference List\",\"\"],\"doc\":\"The"
278 " preference for each type of fresh fuel requested "
279 "corresponding to each input commodity (same "
280 "order). If no preferences are specified, 1.0 is "
281 "used for all fuel requests (default).\",\"type\":[\"st"
282 "d::vector\",\"double\"],\"index\":4,\"shape\":[-1,-"
283 "1],\"alias\":[\"fuel_prefs\",\"val\"],\"tooltip\":[\"fuel_p"
284 "refs\",\"\"]},\"fuel_outcommods\":{\"uitype\":[\"oneormore"
285 "\",\"outcommodity\"],\"uilabel\":[\"Spent Fuel Commodity"
286 " List\",\"\"],\"doc\":\"Output commodities on which to "
287 "offer spent fuel originally received as each "
288 "particular input commodity (same order).\",\"type\":["
289 "\"std::vector\",\"std::string\"],\"index\":5,\"shape\":[-"
290 "1,-"
291 "1],\"alias\":[\"fuel_outcommods\",\"val\"],\"tooltip\":[\"f"
292 "uel_outcommods\",\"\"]},\"fuel_outrecipes\":{\"uitype\":["
293 "\"oneormore\",\"outrecipe\"],\"uilabel\":[\"Spent Fuel "
294 "Recipe List\",\"\"],\"doc\":\"Spent fuel recipes "
295 "corresponding to the given fuel input commodities "
296 "(same order). Fuel received via a particular input"
297 " commodity is transmuted to the recipe specified "
298 "here after being burned during a cycle.\",\"type\":[\""
299 "std::vector\",\"std::string\"],\"index\":6,\"shape\":[-"
300 "1,-"
301 "1],\"alias\":[\"fuel_outrecipes\",\"val\"],\"tooltip\":[\"f"
302 "uel_outrecipes\",\"\"]},\"recipe_change_times\":{\"defau"
303 "lt\":[],\"uilabel\":[\"Time to Change Fresh/Spent Fuel"
304 " Recipe\",\"\"],\"doc\":\"A time step on which to change"
305 " the input-output recipe pair for a requested "
306 "fresh fuel.\",\"type\":[\"std::vector\",\"int\"],\"index\":"
307 "7,\"shape\":[-1,-"
308 "1],\"alias\":[\"recipe_change_times\",\"val\"],\"tooltip\""
309 ":[\"recipe_change_times\",\"\"]},\"recipe_change_commod"
310 "s\":{\"default\":[],\"uilabel\":[\"Commodity for Changed"
311 " Fresh/Spent Fuel Recipe\",\"\"],\"doc\":\"The input "
312 "commodity indicating fresh fuel for which recipes "
313 "will be changed. Same order as and direct "
314 "correspondence to the specified recipe change time"
315 "s.\",\"uitype\":[\"oneormore\",\"incommodity\"],\"type\":[\""
316 "std::vector\",\"std::string\"],\"index\":8,\"shape\":[-"
317 "1,-"
318 "1],\"alias\":[\"recipe_change_commods\",\"val\"],\"toolti"
319 "p\":[\"recipe_change_commods\",\"\"]},\"recipe_change_in"
320 "\":{\"default\":[],\"uilabel\":[\"New Recipe for Fresh "
321 "Fuel\",\"\"],\"doc\":\"The new input recipe to use for "
322 "this recipe change. Same order as and direct "
323 "correspondence to the specified recipe change time"
324 "s.\",\"uitype\":[\"oneormore\",\"inrecipe\"],\"type\":[\"std"
325 "::vector\",\"std::string\"],\"index\":9,\"shape\":[-1,-"
326 "1],\"alias\":[\"recipe_change_in\",\"val\"],\"tooltip\":[\""
327 "recipe_change_in\",\"\"]},\"recipe_change_out\":{\"defau"
328 "lt\":[],\"uilabel\":[\"New Recipe for Spent "
329 "Fuel\",\"\"],\"doc\":\"The new output recipe to use for "
330 "this recipe change. Same order as and direct "
331 "correspondence to the specified recipe change time"
332 "s.\",\"uitype\":[\"oneormore\",\"outrecipe\"],\"type\":[\"st"
333 "d::vector\",\"std::string\"],\"index\":10,\"shape\":[-1,-"
334 "1],\"alias\":[\"recipe_change_out\",\"val\"],\"tooltip\":["
335 "\"recipe_change_out\",\"\"]},\"assem_size\":{\"doc\":\"Mass"
336 " (kg) of a single assembly.\",\"uilabel\":\"Assembly M"
337 "ass\",\"uitype\":\"range\",\"range\":[1.0,100000.0],\"unit"
338 "s\":\"kg\",\"type\":\"double\",\"index\":11,\"shape\":[-"
339 "1],\"alias\":\"assem_size\",\"tooltip\":\"assem_size\"},\"n"
340 "_assem_batch\":{\"uilabel\":\"Number of Assemblies per"
341 " Batch\",\"doc\":\"Number of assemblies that "
342 "constitute a single batch. This is the number of "
343 "assemblies discharged from the core fully burned "
344 "each cycle.Batch size is equivalent to "
345 "``n_assem_batch / n_assem_core``.\",\"type\":\"int\",\"i"
346 "ndex\":12,\"shape\":[-"
347 "1],\"alias\":\"n_assem_batch\",\"tooltip\":\"n_assem_batc"
348 "h\"},\"n_assem_core\":{\"default\":3,\"uilabel\":\"Number "
349 "of Assemblies in "
350 "Core\",\"uitype\":\"range\",\"range\":[1,3],\"doc\":\"Number"
351 " of assemblies that constitute a full core.\",\"type"
352 "\":\"int\",\"index\":13,\"shape\":[-"
353 "1],\"alias\":\"n_assem_core\",\"tooltip\":\"n_assem_core\""
354 "},\"n_assem_fresh\":{\"default\":0,\"uilabel\":\"Minimum "
355 "Fresh Fuel Inventory\",\"uitype\":\"range\",\"range\":[0,"
356 "3],\"units\":\"assemblies\",\"doc\":\"Number of fresh "
357 "fuel assemblies to keep on-hand if possible.\",\"typ"
358 "e\":\"int\",\"index\":14,\"shape\":[-"
359 "1],\"alias\":\"n_assem_fresh\",\"tooltip\":\"n_assem_fres"
360 "h\"},\"n_assem_spent\":{\"default\":1000000000,\"uilabel"
361 "\":\"Maximum Spent Fuel Inventory\",\"uitype\":\"range\","
362 "\"range\":[0,1000000000],\"units\":\"assemblies\",\"doc\":"
363 "\"Number of spent fuel assemblies that can be "
364 "stored on-site before reactor operation stalls.\",\""
365 "type\":\"int\",\"index\":15,\"shape\":[-"
366 "1],\"alias\":\"n_assem_spent\",\"tooltip\":\"n_assem_spen"
367 "t\"},\"cycle_time\":{\"default\":18,\"doc\":\"The duration"
368 " of a full operational cycle (excluding refueling "
369 "time) in time steps.\",\"uilabel\":\"Cycle "
370 "Length\",\"units\":\"time steps\",\"type\":\"int\",\"index\":"
371 "16,\"shape\":[-"
372 "1],\"alias\":\"cycle_time\",\"tooltip\":\"cycle_time\"},\"r"
373 "efuel_time\":{\"default\":1,\"doc\":\"The duration of a "
374 "full refueling period - the minimum time between "
375 "the end of a cycle and the start of the next "
376 "cycle.\",\"uilabel\":\"Refueling Outage "
377 "Duration\",\"units\":\"time steps\",\"type\":\"int\",\"index"
378 "\":17,\"shape\":[-"
379 "1],\"alias\":\"refuel_time\",\"tooltip\":\"refuel_time\"},"
380 "\"cycle_step\":{\"default\":0,\"doc\":\"Number of time "
381 "steps since the start of the last cycle. Only set "
382 "this if you know what you are "
383 "doing\",\"uilabel\":\"Time Since Start of Last "
384 "Cycle\",\"units\":\"time steps\",\"type\":\"int\",\"index\":1"
385 "8,\"shape\":[-"
386 "1],\"alias\":\"cycle_step\",\"tooltip\":\"cycle_step\"},\"p"
387 "ower_cap\":{\"default\":0,\"doc\":\"Amount of electrical"
388 " power the facility produces when operating "
389 "normally.\",\"uilabel\":\"Nominal Reactor Power\",\"uity"
390 "pe\":\"range\",\"range\":[0.0,2000.0],\"units\":\"MWe\",\"ty"
391 "pe\":\"double\",\"index\":19,\"shape\":[-"
392 "1],\"alias\":\"power_cap\",\"tooltip\":\"power_cap\"},\"pow"
393 "er_name\":{\"default\":\"power\",\"uilabel\":\"Power "
394 "Commodity Name\",\"doc\":\"The name of the 'power' "
395 "commodity used in conjunction with a deployment cu"
396 "rve.\",\"type\":\"std::string\",\"index\":20,\"shape\":[-"
397 "1],\"alias\":\"power_name\",\"tooltip\":\"power_name\"},\"s"
398 "ide_products\":{\"uilabel\":[\"Side Product from "
399 "Reactor Plant\",\"\"],\"default\":[],\"doc\":\"Ordered "
400 "vector of side product the reactor produces with p"
401 "ower\",\"type\":[\"std::vector\",\"std::string\"],\"index\""
402 ":21,\"shape\":[-1,-"
403 "1],\"alias\":[\"side_products\",\"val\"],\"tooltip\":[\"sid"
404 "e_products\",\"\"]},\"side_product_quantity\":{\"uilabel"
405 "\":[\"Quantity of Side Product from Reactor "
406 "Plant\",\"\"],\"default\":[],\"doc\":\"Ordered vector of "
407 "the quantity of side product the reactor produces "
408 "with power\",\"type\":[\"std::vector\",\"double\"],\"index"
409 "\":22,\"shape\":[-1,-"
410 "1],\"alias\":[\"side_product_quantity\",\"val\"],\"toolti"
411 "p\":[\"side_product_quantity\",\"\"]},\"hybrid_\":{\"defau"
412 "lt\":1,\"internal\":true,\"doc\":\"True if reactor is a "
413 "hybrid system (produces side products)\",\"type\":\"bo"
414 "ol\",\"index\":23,\"shape\":[-"
415 "1],\"alias\":\"hybrid_\",\"tooltip\":\"hybrid_\",\"uilabel\""
416 ":\"hybrid_\"},\"decom_transmute_all\":{\"default\":0,\"ui"
417 "label\":\"Boolean for transmutation behavior upon "
418 "decommissioning.\",\"doc\":\"If true, the archetype "
419 "transmutes all assemblies upon decommissioning If "
420 "false, the archetype only transmutes half.\",\"type\""
421 ":\"bool\",\"index\":24,\"shape\":[-"
422 "1],\"alias\":\"decom_transmute_all\",\"tooltip\":\"decom_"
423 "transmute_all\"},\"pref_change_times\":{\"default\":[],"
424 "\"uilabel\":[\"Time to Change Fresh Fuel "
425 "Preference\",\"\"],\"doc\":\"A time step on which to "
426 "change the request preference for a particular "
427 "fresh fuel type.\",\"type\":[\"std::vector\",\"int\"],\"in"
428 "dex\":25,\"shape\":[-1,-"
429 "1],\"alias\":[\"pref_change_times\",\"val\"],\"tooltip\":["
430 "\"pref_change_times\",\"\"]},\"pref_change_commods\":{\"d"
431 "efault\":[],\"doc\":\"The input commodity for a "
432 "particular fuel preference change. Same order as "
433 "and direct correspondence to the specified "
434 "preference change times.\",\"uilabel\":[\"Commodity "
435 "for Changed Fresh Fuel Preference\",\"\"],\"uitype\":[\""
436 "oneormore\",\"incommodity\"],\"type\":[\"std::vector\",\"s"
437 "td::string\"],\"index\":26,\"shape\":[-1,-"
438 "1],\"alias\":[\"pref_change_commods\",\"val\"],\"tooltip\""
439 ":[\"pref_change_commods\",\"\"]},\"pref_change_values\":"
440 "{\"default\":[],\"uilabel\":[\"Changed Fresh Fuel "
441 "Preference\",\"\"],\"doc\":\"The new/changed request "
442 "preference for a particular fresh fuel. Same order"
443 " as and direct correspondence to the specified "
444 "preference change times.\",\"type\":[\"std::vector\",\"d"
445 "ouble\"],\"index\":27,\"shape\":[-1,-"
446 "1],\"alias\":[\"pref_change_values\",\"val\"],\"tooltip\":"
447 "[\"pref_change_values\",\"\"]},\"keep_packaging\":{\"defa"
448 "ult\":true,\"tooltip\":\"Whether to persist packaging "
449 "throughout the reactor\",\"doc\":\"Boolean value about"
450 " whether to keep packaging. If true, packaging "
451 "will not be stripped upon acceptance into the "
452 "reactor. If false, package type will be stripped "
453 "immediately upon acceptance. Has no effect if the "
454 "incoming material is not "
455 "packaged.\",\"uilabel\":\"Keep Packaging\",\"uitype\":\"bo"
456 "ol\",\"type\":\"bool\",\"index\":28,\"shape\":[-"
457 "1],\"alias\":\"keep_packaging\"},\"fresh\":{\"capacity\":\""
458 "n_assem_fresh * assem_size\",\"type\":[\"cyclus::toolk"
459 "it::ResBuf\",\"cyclus::Material\"],\"index\":29,\"shape\""
460 ":[-1,-1]},\"core\":{\"capacity\":\"n_assem_core * assem"
461 "_size\",\"type\":[\"cyclus::toolkit::ResBuf\",\"cyclus::"
462 "Material\"],\"index\":30,\"shape\":[-1,-"
463 "1]},\"spent\":{\"capacity\":\"n_assem_spent * assem_siz"
464 "e\",\"type\":[\"cyclus::toolkit::ResBuf\",\"cyclus::Mate"
465 "rial\"],\"index\":31,\"shape\":[-1,-"
466 "1]},\"discharged\":{\"default\":0,\"doc\":\"This should "
467 "NEVER be set manually\",\"internal\":true,\"type\":\"boo"
468 "l\",\"index\":32,\"shape\":[-"
469 "1],\"alias\":\"discharged\",\"tooltip\":\"discharged\",\"ui"
470 "label\":\"discharged\"},\"res_indexes\":{\"default\":{},\""
471 "doc\":\"This should NEVER be set manually\",\"internal"
472 "\":true,\"type\":[\"std::map\",\"int\",\"int\"],\"index\":33,"
473 "\"shape\":[-1,-1,-"
474 "1],\"alias\":[[\"res_indexes\",\"item\"],\"key\",\"val\"],\"t"
475 "ooltip\":[[\"res_indexes\",\"\"],\"\",\"\"],\"uilabel\":[[\"re"
476 "s_indexes\",\"\"],\"\",\"\"]}},\"niche\":\"reactor\",\"doc\":\"R"
477 "eactor is a simple, general reactor based on "
478 "static compositional transformations to model fuel"
479 " burnup. The user specifies a set of input fuels "
480 "and corresponding burnt compositions that fuel is "
481 "transformed to when it is discharged from the "
482 "core. No incremental transmutation takes place. "
483 "Rather, at the end of an operational cycle, the "
484 "batch being discharged from the core is "
485 "instantaneously transmuted from its original fresh"
486 " fuel composition into its spent fuel "
487 "form.\\n\\nEach fuel is identified by a specific "
488 "input commodity and has an associated input recipe"
489 " (nuclide composition), output recipe, output "
490 "commidity, and preference. The preference "
491 "identifies which input fuels are preferred when "
492 "requesting. Changes in these preferences can be "
493 "specified as a function of time using the "
494 "pref_change variables. Changes in the input-"
495 "output recipe compositions can also be specified "
496 "as a function of time using the recipe_change "
497 "variables.\\n\\nThe reactor treats fuel as "
498 "individual assemblies that are never split, "
499 "combined or otherwise treated in any non-discrete "
500 "way. Fuel is requested in full-or-nothing "
501 "assembly sized quanta. If real-world assembly "
502 "modeling is unnecessary, parameters can be "
503 "adjusted (e.g. n_assem_core, assem_size, "
504 "n_assem_batch). At the end of every cycle, a full"
505 " batch is discharged from the core consisting of "
506 "n_assem_batch assemblies of assem_size kg. The "
507 "reactor also has a specifiable refueling time "
508 "period following the end of each cycle at the end "
509 "of which it will resume operation on the next "
510 "cycle *if* it has enough fuel for a full core; "
511 "otherwise it waits until it has enough fresh fuel "
512 "assemblies.\\n\\nIn addition to its core, the "
513 "reactor has an on-hand fresh fuel inventory and a "
514 "spent fuel inventory whose capacities are "
515 "specified by n_assem_fresh and n_assem_spent "
516 "respectively. Each time step the reactor will "
517 "attempt to acquire enough fresh fuel to fill its "
518 "fresh fuel inventory (and its core if the core "
519 "isn't currently full). If the fresh fuel "
520 "inventory has zero capacity, fuel will be ordered "
521 "just-in-time after the end of each operational "
522 "cycle before the next begins. If the spent fuel "
523 "inventory becomes full, the reactor will halt "
524 "operation at the end of the next cycle until there"
525 " is more room. Each time step, the reactor will "
526 "try to trade away as much of its spent fuel "
527 "inventory as possible.\\n\\nWhen the reactor reaches"
528 " the end of its lifetime, it will discharge all "
529 "material from its core and trade away all its "
530 "spent fuel as quickly as possible. Full "
531 "decommissioning will be delayed until all spent "
532 "fuel is gone. If the reactor has a full core when"
533 " it is decommissioned (i.e. is mid-cycle) when the"
534 " reactor is decommissioned, half (rounded up to "
535 "nearest int) of its assemblies are transmuted to "
536 "their respective burnt compositions.\"}", root);
537 if (!parsed_ok) {
538 throw cyclus::ValueError("failed to parse annotations for cycamore::Reactor.");
539 }
540 return root;
541};
542#line 28 "/cycamore/src/reactor.cc"
543
544void Reactor::InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di) {
545 cyclus::Facility::InfileToDb(tree, di);
546 int rawcycpp_shape_latitude[1] = {-1};
547 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
548 int rawcycpp_shape_longitude[1] = {-1};
549 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
550 int rawcycpp_shape_fuel_incommods[2] = {-1, -1};
551 cycpp_shape_fuel_incommods = std::vector<int>(rawcycpp_shape_fuel_incommods, rawcycpp_shape_fuel_incommods + 2);
552 int rawcycpp_shape_fuel_inrecipes[2] = {-1, -1};
553 cycpp_shape_fuel_inrecipes = std::vector<int>(rawcycpp_shape_fuel_inrecipes, rawcycpp_shape_fuel_inrecipes + 2);
554 int rawcycpp_shape_fuel_prefs[2] = {-1, -1};
555 cycpp_shape_fuel_prefs = std::vector<int>(rawcycpp_shape_fuel_prefs, rawcycpp_shape_fuel_prefs + 2);
556 int rawcycpp_shape_fuel_outcommods[2] = {-1, -1};
557 cycpp_shape_fuel_outcommods = std::vector<int>(rawcycpp_shape_fuel_outcommods, rawcycpp_shape_fuel_outcommods + 2);
558 int rawcycpp_shape_fuel_outrecipes[2] = {-1, -1};
559 cycpp_shape_fuel_outrecipes = std::vector<int>(rawcycpp_shape_fuel_outrecipes, rawcycpp_shape_fuel_outrecipes + 2);
560 int rawcycpp_shape_recipe_change_times[2] = {-1, -1};
561 cycpp_shape_recipe_change_times = std::vector<int>(rawcycpp_shape_recipe_change_times, rawcycpp_shape_recipe_change_times + 2);
562 int rawcycpp_shape_recipe_change_commods[2] = {-1, -1};
563 cycpp_shape_recipe_change_commods = std::vector<int>(rawcycpp_shape_recipe_change_commods, rawcycpp_shape_recipe_change_commods + 2);
564 int rawcycpp_shape_recipe_change_in[2] = {-1, -1};
565 cycpp_shape_recipe_change_in = std::vector<int>(rawcycpp_shape_recipe_change_in, rawcycpp_shape_recipe_change_in + 2);
566 int rawcycpp_shape_recipe_change_out[2] = {-1, -1};
567 cycpp_shape_recipe_change_out = std::vector<int>(rawcycpp_shape_recipe_change_out, rawcycpp_shape_recipe_change_out + 2);
568 int rawcycpp_shape_assem_size[1] = {-1};
569 cycpp_shape_assem_size = std::vector<int>(rawcycpp_shape_assem_size, rawcycpp_shape_assem_size + 1);
570 int rawcycpp_shape_n_assem_batch[1] = {-1};
571 cycpp_shape_n_assem_batch = std::vector<int>(rawcycpp_shape_n_assem_batch, rawcycpp_shape_n_assem_batch + 1);
572 int rawcycpp_shape_n_assem_core[1] = {-1};
573 cycpp_shape_n_assem_core = std::vector<int>(rawcycpp_shape_n_assem_core, rawcycpp_shape_n_assem_core + 1);
574 int rawcycpp_shape_n_assem_fresh[1] = {-1};
575 cycpp_shape_n_assem_fresh = std::vector<int>(rawcycpp_shape_n_assem_fresh, rawcycpp_shape_n_assem_fresh + 1);
576 int rawcycpp_shape_n_assem_spent[1] = {-1};
577 cycpp_shape_n_assem_spent = std::vector<int>(rawcycpp_shape_n_assem_spent, rawcycpp_shape_n_assem_spent + 1);
578 int rawcycpp_shape_cycle_time[1] = {-1};
579 cycpp_shape_cycle_time = std::vector<int>(rawcycpp_shape_cycle_time, rawcycpp_shape_cycle_time + 1);
580 int rawcycpp_shape_refuel_time[1] = {-1};
581 cycpp_shape_refuel_time = std::vector<int>(rawcycpp_shape_refuel_time, rawcycpp_shape_refuel_time + 1);
582 int rawcycpp_shape_cycle_step[1] = {-1};
583 cycpp_shape_cycle_step = std::vector<int>(rawcycpp_shape_cycle_step, rawcycpp_shape_cycle_step + 1);
584 int rawcycpp_shape_power_cap[1] = {-1};
585 cycpp_shape_power_cap = std::vector<int>(rawcycpp_shape_power_cap, rawcycpp_shape_power_cap + 1);
586 int rawcycpp_shape_power_name[1] = {-1};
587 cycpp_shape_power_name = std::vector<int>(rawcycpp_shape_power_name, rawcycpp_shape_power_name + 1);
588 int rawcycpp_shape_side_products[2] = {-1, -1};
589 cycpp_shape_side_products = std::vector<int>(rawcycpp_shape_side_products, rawcycpp_shape_side_products + 2);
590 int rawcycpp_shape_side_product_quantity[2] = {-1, -1};
591 cycpp_shape_side_product_quantity = std::vector<int>(rawcycpp_shape_side_product_quantity, rawcycpp_shape_side_product_quantity + 2);
592 int rawcycpp_shape_hybrid_[1] = {-1};
593 cycpp_shape_hybrid_ = std::vector<int>(rawcycpp_shape_hybrid_, rawcycpp_shape_hybrid_ + 1);
594 int rawcycpp_shape_decom_transmute_all[1] = {-1};
595 cycpp_shape_decom_transmute_all = std::vector<int>(rawcycpp_shape_decom_transmute_all, rawcycpp_shape_decom_transmute_all + 1);
596 int rawcycpp_shape_pref_change_times[2] = {-1, -1};
597 cycpp_shape_pref_change_times = std::vector<int>(rawcycpp_shape_pref_change_times, rawcycpp_shape_pref_change_times + 2);
598 int rawcycpp_shape_pref_change_commods[2] = {-1, -1};
599 cycpp_shape_pref_change_commods = std::vector<int>(rawcycpp_shape_pref_change_commods, rawcycpp_shape_pref_change_commods + 2);
600 int rawcycpp_shape_pref_change_values[2] = {-1, -1};
601 cycpp_shape_pref_change_values = std::vector<int>(rawcycpp_shape_pref_change_values, rawcycpp_shape_pref_change_values + 2);
602 int rawcycpp_shape_keep_packaging[1] = {-1};
603 cycpp_shape_keep_packaging = std::vector<int>(rawcycpp_shape_keep_packaging, rawcycpp_shape_keep_packaging + 1);
604 int rawcycpp_shape_fresh[2] = {-1, -1};
605 cycpp_shape_fresh = std::vector<int>(rawcycpp_shape_fresh, rawcycpp_shape_fresh + 2);
606 int rawcycpp_shape_core[2] = {-1, -1};
607 cycpp_shape_core = std::vector<int>(rawcycpp_shape_core, rawcycpp_shape_core + 2);
608 int rawcycpp_shape_spent[2] = {-1, -1};
609 cycpp_shape_spent = std::vector<int>(rawcycpp_shape_spent, rawcycpp_shape_spent + 2);
610 int rawcycpp_shape_discharged[1] = {-1};
611 cycpp_shape_discharged = std::vector<int>(rawcycpp_shape_discharged, rawcycpp_shape_discharged + 1);
612 int rawcycpp_shape_res_indexes[3] = {-1, -1, -1};
613 cycpp_shape_res_indexes = std::vector<int>(rawcycpp_shape_res_indexes, rawcycpp_shape_res_indexes + 3);
614 cyclus::InfileTree* sub = tree->SubTree("config/*");
615 int i;
616 int n;
617 if (sub->NMatches("latitude") > 0) {
618 {
619 double latitude_val = cyclus::Query<double>(sub, "latitude");
620 latitude = latitude_val;
621 }
622 } else {
623 double latitude_tmp = 0.0;
624 latitude = latitude_tmp;
625 }
626 if (sub->NMatches("longitude") > 0) {
627 {
628 double longitude_val = cyclus::Query<double>(sub, "longitude");
629 longitude = longitude_val;
630 }
631 } else {
632 double longitude_tmp = 0.0;
633 longitude = longitude_tmp;
634 }
635 {
636 cyclus::InfileTree* bub = sub->SubTree("fuel_incommods", 0);
637 cyclus::InfileTree* sub = bub;
638 int n1 = sub->NMatches("val");
639 std::vector< std::string > fuel_incommods_val;
640 fuel_incommods_val.resize(n1);
641 for (int i1 = 0; i1 < n1; ++i1) {
642 std::string elem;
643 {
644 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
645 elem = elem_in;
646 }
647 fuel_incommods_val[i1] = elem;
648 }
649 fuel_incommods = fuel_incommods_val;
650 }
651 {
652 cyclus::InfileTree* bub = sub->SubTree("fuel_inrecipes", 0);
653 cyclus::InfileTree* sub = bub;
654 int n1 = sub->NMatches("val");
655 std::vector< std::string > fuel_inrecipes_val;
656 fuel_inrecipes_val.resize(n1);
657 for (int i1 = 0; i1 < n1; ++i1) {
658 std::string elem;
659 {
660 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
661 elem = elem_in;
662 }
663 fuel_inrecipes_val[i1] = elem;
664 }
665 fuel_inrecipes = fuel_inrecipes_val;
666 }
667 if (sub->NMatches("fuel_prefs") > 0) {
668 {
669 cyclus::InfileTree* bub = sub->SubTree("fuel_prefs", 0);
670 cyclus::InfileTree* sub = bub;
671 int n1 = sub->NMatches("val");
672 std::vector< double > fuel_prefs_val;
673 fuel_prefs_val.resize(n1);
674 for (int i1 = 0; i1 < n1; ++i1) {
675 double elem;
676 {
677 double elem_in = cyclus::Query<double>(sub, "val", i1);
678 elem = elem_in;
679 }
680 fuel_prefs_val[i1] = elem;
681 }
682 fuel_prefs = fuel_prefs_val;
683 }
684 } else {
685 std::vector< double > fuel_prefs_tmp;
686 fuel_prefs_tmp.resize(0);
687 {
688 }
689 fuel_prefs = fuel_prefs_tmp;
690 }
691 {
692 cyclus::InfileTree* bub = sub->SubTree("fuel_outcommods", 0);
693 cyclus::InfileTree* sub = bub;
694 int n1 = sub->NMatches("val");
695 std::vector< std::string > fuel_outcommods_val;
696 fuel_outcommods_val.resize(n1);
697 for (int i1 = 0; i1 < n1; ++i1) {
698 std::string elem;
699 {
700 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
701 elem = elem_in;
702 }
703 fuel_outcommods_val[i1] = elem;
704 }
705 fuel_outcommods = fuel_outcommods_val;
706 }
707 {
708 cyclus::InfileTree* bub = sub->SubTree("fuel_outrecipes", 0);
709 cyclus::InfileTree* sub = bub;
710 int n1 = sub->NMatches("val");
711 std::vector< std::string > fuel_outrecipes_val;
712 fuel_outrecipes_val.resize(n1);
713 for (int i1 = 0; i1 < n1; ++i1) {
714 std::string elem;
715 {
716 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
717 elem = elem_in;
718 }
719 fuel_outrecipes_val[i1] = elem;
720 }
721 fuel_outrecipes = fuel_outrecipes_val;
722 }
723 if (sub->NMatches("recipe_change_times") > 0) {
724 {
725 cyclus::InfileTree* bub = sub->SubTree("recipe_change_times", 0);
726 cyclus::InfileTree* sub = bub;
727 int n1 = sub->NMatches("val");
728 std::vector< int > recipe_change_times_val;
729 recipe_change_times_val.resize(n1);
730 for (int i1 = 0; i1 < n1; ++i1) {
731 int elem;
732 {
733 int elem_in = cyclus::Query<int>(sub, "val", i1);
734 elem = elem_in;
735 }
736 recipe_change_times_val[i1] = elem;
737 }
738 recipe_change_times = recipe_change_times_val;
739 }
740 } else {
741 std::vector< int > recipe_change_times_tmp;
742 recipe_change_times_tmp.resize(0);
743 {
744 }
745 recipe_change_times = recipe_change_times_tmp;
746 }
747 if (sub->NMatches("recipe_change_commods") > 0) {
748 {
749 cyclus::InfileTree* bub = sub->SubTree("recipe_change_commods", 0);
750 cyclus::InfileTree* sub = bub;
751 int n1 = sub->NMatches("val");
752 std::vector< std::string > recipe_change_commods_val;
753 recipe_change_commods_val.resize(n1);
754 for (int i1 = 0; i1 < n1; ++i1) {
755 std::string elem;
756 {
757 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
758 elem = elem_in;
759 }
760 recipe_change_commods_val[i1] = elem;
761 }
762 recipe_change_commods = recipe_change_commods_val;
763 }
764 } else {
765 std::vector< std::string > recipe_change_commods_tmp;
766 recipe_change_commods_tmp.resize(0);
767 {
768 }
769 recipe_change_commods = recipe_change_commods_tmp;
770 }
771 if (sub->NMatches("recipe_change_in") > 0) {
772 {
773 cyclus::InfileTree* bub = sub->SubTree("recipe_change_in", 0);
774 cyclus::InfileTree* sub = bub;
775 int n1 = sub->NMatches("val");
776 std::vector< std::string > recipe_change_in_val;
777 recipe_change_in_val.resize(n1);
778 for (int i1 = 0; i1 < n1; ++i1) {
779 std::string elem;
780 {
781 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
782 elem = elem_in;
783 }
784 recipe_change_in_val[i1] = elem;
785 }
786 recipe_change_in = recipe_change_in_val;
787 }
788 } else {
789 std::vector< std::string > recipe_change_in_tmp;
790 recipe_change_in_tmp.resize(0);
791 {
792 }
793 recipe_change_in = recipe_change_in_tmp;
794 }
795 if (sub->NMatches("recipe_change_out") > 0) {
796 {
797 cyclus::InfileTree* bub = sub->SubTree("recipe_change_out", 0);
798 cyclus::InfileTree* sub = bub;
799 int n1 = sub->NMatches("val");
800 std::vector< std::string > recipe_change_out_val;
801 recipe_change_out_val.resize(n1);
802 for (int i1 = 0; i1 < n1; ++i1) {
803 std::string elem;
804 {
805 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
806 elem = elem_in;
807 }
808 recipe_change_out_val[i1] = elem;
809 }
810 recipe_change_out = recipe_change_out_val;
811 }
812 } else {
813 std::vector< std::string > recipe_change_out_tmp;
814 recipe_change_out_tmp.resize(0);
815 {
816 }
817 recipe_change_out = recipe_change_out_tmp;
818 }
819 {
820 double assem_size_val = cyclus::Query<double>(sub, "assem_size");
821 assem_size = assem_size_val;
822 }
823 {
824 int n_assem_batch_val = cyclus::Query<int>(sub, "n_assem_batch");
825 n_assem_batch = n_assem_batch_val;
826 }
827 if (sub->NMatches("n_assem_core") > 0) {
828 {
829 int n_assem_core_val = cyclus::Query<int>(sub, "n_assem_core");
830 n_assem_core = n_assem_core_val;
831 }
832 } else {
833 int n_assem_core_tmp = 3;
834 n_assem_core = n_assem_core_tmp;
835 }
836 if (sub->NMatches("n_assem_fresh") > 0) {
837 {
838 int n_assem_fresh_val = cyclus::Query<int>(sub, "n_assem_fresh");
839 n_assem_fresh = n_assem_fresh_val;
840 }
841 } else {
842 int n_assem_fresh_tmp = 0;
843 n_assem_fresh = n_assem_fresh_tmp;
844 }
845 if (sub->NMatches("n_assem_spent") > 0) {
846 {
847 int n_assem_spent_val = cyclus::Query<int>(sub, "n_assem_spent");
848 n_assem_spent = n_assem_spent_val;
849 }
850 } else {
851 int n_assem_spent_tmp = 1000000000;
852 n_assem_spent = n_assem_spent_tmp;
853 }
854 if (sub->NMatches("cycle_time") > 0) {
855 {
856 int cycle_time_val = cyclus::Query<int>(sub, "cycle_time");
857 cycle_time = cycle_time_val;
858 }
859 } else {
860 int cycle_time_tmp = 18;
861 cycle_time = cycle_time_tmp;
862 }
863 if (sub->NMatches("refuel_time") > 0) {
864 {
865 int refuel_time_val = cyclus::Query<int>(sub, "refuel_time");
866 refuel_time = refuel_time_val;
867 }
868 } else {
869 int refuel_time_tmp = 1;
870 refuel_time = refuel_time_tmp;
871 }
872 if (sub->NMatches("cycle_step") > 0) {
873 {
874 int cycle_step_val = cyclus::Query<int>(sub, "cycle_step");
875 cycle_step = cycle_step_val;
876 }
877 } else {
878 int cycle_step_tmp = 0;
879 cycle_step = cycle_step_tmp;
880 }
881 if (sub->NMatches("power_cap") > 0) {
882 {
883 double power_cap_val = cyclus::Query<double>(sub, "power_cap");
884 power_cap = power_cap_val;
885 }
886 } else {
887 double power_cap_tmp = 0;
888 power_cap = power_cap_tmp;
889 }
890 if (sub->NMatches("power_name") > 0) {
891 {
892 std::string power_name_val = cyclus::Query<std::string>(sub, "power_name");
893 power_name = power_name_val;
894 }
895 } else {
896 std::string power_name_tmp("power");
897 power_name = power_name_tmp;
898 }
899 if (sub->NMatches("side_products") > 0) {
900 {
901 cyclus::InfileTree* bub = sub->SubTree("side_products", 0);
902 cyclus::InfileTree* sub = bub;
903 int n1 = sub->NMatches("val");
904 std::vector< std::string > side_products_val;
905 side_products_val.resize(n1);
906 for (int i1 = 0; i1 < n1; ++i1) {
907 std::string elem;
908 {
909 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
910 elem = elem_in;
911 }
912 side_products_val[i1] = elem;
913 }
914 side_products = side_products_val;
915 }
916 } else {
917 std::vector< std::string > side_products_tmp;
918 side_products_tmp.resize(0);
919 {
920 }
921 side_products = side_products_tmp;
922 }
923 if (sub->NMatches("side_product_quantity") > 0) {
924 {
925 cyclus::InfileTree* bub = sub->SubTree("side_product_quantity", 0);
926 cyclus::InfileTree* sub = bub;
927 int n1 = sub->NMatches("val");
928 std::vector< double > side_product_quantity_val;
929 side_product_quantity_val.resize(n1);
930 for (int i1 = 0; i1 < n1; ++i1) {
931 double elem;
932 {
933 double elem_in = cyclus::Query<double>(sub, "val", i1);
934 elem = elem_in;
935 }
936 side_product_quantity_val[i1] = elem;
937 }
938 side_product_quantity = side_product_quantity_val;
939 }
940 } else {
941 std::vector< double > side_product_quantity_tmp;
942 side_product_quantity_tmp.resize(0);
943 {
944 }
945 side_product_quantity = side_product_quantity_tmp;
946 }
947 bool hybrid__tmp = true;
948 hybrid_ = hybrid__tmp;
949 if (sub->NMatches("decom_transmute_all") > 0) {
950 {
951 bool decom_transmute_all_val = cyclus::Query<bool>(sub, "decom_transmute_all");
952 decom_transmute_all = decom_transmute_all_val;
953 }
954 } else {
955 bool decom_transmute_all_tmp = false;
956 decom_transmute_all = decom_transmute_all_tmp;
957 }
958 if (sub->NMatches("pref_change_times") > 0) {
959 {
960 cyclus::InfileTree* bub = sub->SubTree("pref_change_times", 0);
961 cyclus::InfileTree* sub = bub;
962 int n1 = sub->NMatches("val");
963 std::vector< int > pref_change_times_val;
964 pref_change_times_val.resize(n1);
965 for (int i1 = 0; i1 < n1; ++i1) {
966 int elem;
967 {
968 int elem_in = cyclus::Query<int>(sub, "val", i1);
969 elem = elem_in;
970 }
971 pref_change_times_val[i1] = elem;
972 }
973 pref_change_times = pref_change_times_val;
974 }
975 } else {
976 std::vector< int > pref_change_times_tmp;
977 pref_change_times_tmp.resize(0);
978 {
979 }
980 pref_change_times = pref_change_times_tmp;
981 }
982 if (sub->NMatches("pref_change_commods") > 0) {
983 {
984 cyclus::InfileTree* bub = sub->SubTree("pref_change_commods", 0);
985 cyclus::InfileTree* sub = bub;
986 int n1 = sub->NMatches("val");
987 std::vector< std::string > pref_change_commods_val;
988 pref_change_commods_val.resize(n1);
989 for (int i1 = 0; i1 < n1; ++i1) {
990 std::string elem;
991 {
992 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
993 elem = elem_in;
994 }
995 pref_change_commods_val[i1] = elem;
996 }
997 pref_change_commods = pref_change_commods_val;
998 }
999 } else {
1000 std::vector< std::string > pref_change_commods_tmp;
1001 pref_change_commods_tmp.resize(0);
1002 {
1003 }
1004 pref_change_commods = pref_change_commods_tmp;
1005 }
1006 if (sub->NMatches("pref_change_values") > 0) {
1007 {
1008 cyclus::InfileTree* bub = sub->SubTree("pref_change_values", 0);
1009 cyclus::InfileTree* sub = bub;
1010 int n1 = sub->NMatches("val");
1011 std::vector< double > pref_change_values_val;
1012 pref_change_values_val.resize(n1);
1013 for (int i1 = 0; i1 < n1; ++i1) {
1014 double elem;
1015 {
1016 double elem_in = cyclus::Query<double>(sub, "val", i1);
1017 elem = elem_in;
1018 }
1019 pref_change_values_val[i1] = elem;
1020 }
1021 pref_change_values = pref_change_values_val;
1022 }
1023 } else {
1024 std::vector< double > pref_change_values_tmp;
1025 pref_change_values_tmp.resize(0);
1026 {
1027 }
1028 pref_change_values = pref_change_values_tmp;
1029 }
1030 if (sub->NMatches("keep_packaging") > 0) {
1031 {
1032 bool keep_packaging_val = cyclus::Query<bool>(sub, "keep_packaging");
1033 keep_packaging = keep_packaging_val;
1034 }
1035 } else {
1036 bool keep_packaging_tmp = true;
1037 keep_packaging = keep_packaging_tmp;
1038 }
1039 bool discharged_tmp = false;
1040 discharged = discharged_tmp;
1041 std::map< int, int > res_indexes_tmp;
1042 {
1043 }
1044 res_indexes = res_indexes_tmp;
1045 di.NewDatum("Info")
1046 ->AddVal("latitude", latitude, &cycpp_shape_latitude)
1047 ->AddVal("longitude", longitude, &cycpp_shape_longitude)
1048 ->AddVal("fuel_incommods", fuel_incommods, &cycpp_shape_fuel_incommods)
1049 ->AddVal("fuel_inrecipes", fuel_inrecipes, &cycpp_shape_fuel_inrecipes)
1050 ->AddVal("fuel_prefs", fuel_prefs, &cycpp_shape_fuel_prefs)
1051 ->AddVal("fuel_outcommods", fuel_outcommods, &cycpp_shape_fuel_outcommods)
1052 ->AddVal("fuel_outrecipes", fuel_outrecipes, &cycpp_shape_fuel_outrecipes)
1053 ->AddVal("recipe_change_times", recipe_change_times, &cycpp_shape_recipe_change_times)
1054 ->AddVal("recipe_change_commods", recipe_change_commods, &cycpp_shape_recipe_change_commods)
1055 ->AddVal("recipe_change_in", recipe_change_in, &cycpp_shape_recipe_change_in)
1056 ->AddVal("recipe_change_out", recipe_change_out, &cycpp_shape_recipe_change_out)
1057 ->AddVal("assem_size", assem_size, &cycpp_shape_assem_size)
1058 ->AddVal("n_assem_batch", n_assem_batch, &cycpp_shape_n_assem_batch)
1059 ->AddVal("n_assem_core", n_assem_core, &cycpp_shape_n_assem_core)
1060 ->AddVal("n_assem_fresh", n_assem_fresh, &cycpp_shape_n_assem_fresh)
1061 ->AddVal("n_assem_spent", n_assem_spent, &cycpp_shape_n_assem_spent)
1062 ->AddVal("cycle_time", cycle_time, &cycpp_shape_cycle_time)
1063 ->AddVal("refuel_time", refuel_time, &cycpp_shape_refuel_time)
1064 ->AddVal("cycle_step", cycle_step, &cycpp_shape_cycle_step)
1065 ->AddVal("power_cap", power_cap, &cycpp_shape_power_cap)
1066 ->AddVal("power_name", power_name, &cycpp_shape_power_name)
1067 ->AddVal("side_products", side_products, &cycpp_shape_side_products)
1068 ->AddVal("side_product_quantity", side_product_quantity, &cycpp_shape_side_product_quantity)
1069 ->AddVal("hybrid_", hybrid_, &cycpp_shape_hybrid_)
1070 ->AddVal("decom_transmute_all", decom_transmute_all, &cycpp_shape_decom_transmute_all)
1071 ->AddVal("pref_change_times", pref_change_times, &cycpp_shape_pref_change_times)
1072 ->AddVal("pref_change_commods", pref_change_commods, &cycpp_shape_pref_change_commods)
1073 ->AddVal("pref_change_values", pref_change_values, &cycpp_shape_pref_change_values)
1074 ->AddVal("keep_packaging", keep_packaging, &cycpp_shape_keep_packaging)
1075 ->AddVal("discharged", discharged, &cycpp_shape_discharged)
1076 ->AddVal("res_indexes", res_indexes, &cycpp_shape_res_indexes)
1077 ->Record();
1078};
1079#line 30 "/cycamore/src/reactor.cc"
1080
1081void Reactor::Snapshot(cyclus::DbInit di) {
1082 di.NewDatum("Info")
1083 ->AddVal("latitude", latitude, &cycpp_shape_latitude)
1084 ->AddVal("longitude", longitude, &cycpp_shape_longitude)
1085 ->AddVal("fuel_incommods", fuel_incommods, &cycpp_shape_fuel_incommods)
1086 ->AddVal("fuel_inrecipes", fuel_inrecipes, &cycpp_shape_fuel_inrecipes)
1087 ->AddVal("fuel_prefs", fuel_prefs, &cycpp_shape_fuel_prefs)
1088 ->AddVal("fuel_outcommods", fuel_outcommods, &cycpp_shape_fuel_outcommods)
1089 ->AddVal("fuel_outrecipes", fuel_outrecipes, &cycpp_shape_fuel_outrecipes)
1090 ->AddVal("recipe_change_times", recipe_change_times, &cycpp_shape_recipe_change_times)
1091 ->AddVal("recipe_change_commods", recipe_change_commods, &cycpp_shape_recipe_change_commods)
1092 ->AddVal("recipe_change_in", recipe_change_in, &cycpp_shape_recipe_change_in)
1093 ->AddVal("recipe_change_out", recipe_change_out, &cycpp_shape_recipe_change_out)
1094 ->AddVal("assem_size", assem_size, &cycpp_shape_assem_size)
1095 ->AddVal("n_assem_batch", n_assem_batch, &cycpp_shape_n_assem_batch)
1096 ->AddVal("n_assem_core", n_assem_core, &cycpp_shape_n_assem_core)
1097 ->AddVal("n_assem_fresh", n_assem_fresh, &cycpp_shape_n_assem_fresh)
1098 ->AddVal("n_assem_spent", n_assem_spent, &cycpp_shape_n_assem_spent)
1099 ->AddVal("cycle_time", cycle_time, &cycpp_shape_cycle_time)
1100 ->AddVal("refuel_time", refuel_time, &cycpp_shape_refuel_time)
1101 ->AddVal("cycle_step", cycle_step, &cycpp_shape_cycle_step)
1102 ->AddVal("power_cap", power_cap, &cycpp_shape_power_cap)
1103 ->AddVal("power_name", power_name, &cycpp_shape_power_name)
1104 ->AddVal("side_products", side_products, &cycpp_shape_side_products)
1105 ->AddVal("side_product_quantity", side_product_quantity, &cycpp_shape_side_product_quantity)
1106 ->AddVal("hybrid_", hybrid_, &cycpp_shape_hybrid_)
1107 ->AddVal("decom_transmute_all", decom_transmute_all, &cycpp_shape_decom_transmute_all)
1108 ->AddVal("pref_change_times", pref_change_times, &cycpp_shape_pref_change_times)
1109 ->AddVal("pref_change_commods", pref_change_commods, &cycpp_shape_pref_change_commods)
1110 ->AddVal("pref_change_values", pref_change_values, &cycpp_shape_pref_change_values)
1111 ->AddVal("keep_packaging", keep_packaging, &cycpp_shape_keep_packaging)
1112 ->AddVal("discharged", discharged, &cycpp_shape_discharged)
1113 ->AddVal("res_indexes", res_indexes, &cycpp_shape_res_indexes)
1114 ->Record();
1115};
1116#line 32 "/cycamore/src/reactor.cc"
1117
1118cyclus::Inventories Reactor::SnapshotInv() {
1119 cyclus::Inventories invs;
1120 invs["fresh"] = fresh.PopNRes(fresh.count());
1121 fresh.Push(invs["fresh"]);
1122 invs["core"] = core.PopNRes(core.count());
1123 core.Push(invs["core"]);
1124 invs["spent"] = spent.PopNRes(spent.count());
1125 spent.Push(invs["spent"]);
1126 return invs;
1127};
1128#line 34 "/cycamore/src/reactor.cc"
1129
1130void Reactor::InitInv(cyclus::Inventories& inv) {
1131 fresh.Push(inv["fresh"]);
1132 core.Push(inv["core"]);
1133 spent.Push(inv["spent"]);
1134
1135};
1136#line 36 "/cycamore/src/reactor.cc"
1137
1138void Reactor::InitFrom(Reactor* m) { cyclus::Facility::InitFrom(m);
1139 int rawcycpp_shape_latitude[1] = {-1};
1140 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
1141 int rawcycpp_shape_longitude[1] = {-1};
1142 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
1143 int rawcycpp_shape_fuel_incommods[2] = {-1, -1};
1144 cycpp_shape_fuel_incommods = std::vector<int>(rawcycpp_shape_fuel_incommods, rawcycpp_shape_fuel_incommods + 2);
1145 int rawcycpp_shape_fuel_inrecipes[2] = {-1, -1};
1146 cycpp_shape_fuel_inrecipes = std::vector<int>(rawcycpp_shape_fuel_inrecipes, rawcycpp_shape_fuel_inrecipes + 2);
1147 int rawcycpp_shape_fuel_prefs[2] = {-1, -1};
1148 cycpp_shape_fuel_prefs = std::vector<int>(rawcycpp_shape_fuel_prefs, rawcycpp_shape_fuel_prefs + 2);
1149 int rawcycpp_shape_fuel_outcommods[2] = {-1, -1};
1150 cycpp_shape_fuel_outcommods = std::vector<int>(rawcycpp_shape_fuel_outcommods, rawcycpp_shape_fuel_outcommods + 2);
1151 int rawcycpp_shape_fuel_outrecipes[2] = {-1, -1};
1152 cycpp_shape_fuel_outrecipes = std::vector<int>(rawcycpp_shape_fuel_outrecipes, rawcycpp_shape_fuel_outrecipes + 2);
1153 int rawcycpp_shape_recipe_change_times[2] = {-1, -1};
1154 cycpp_shape_recipe_change_times = std::vector<int>(rawcycpp_shape_recipe_change_times, rawcycpp_shape_recipe_change_times + 2);
1155 int rawcycpp_shape_recipe_change_commods[2] = {-1, -1};
1156 cycpp_shape_recipe_change_commods = std::vector<int>(rawcycpp_shape_recipe_change_commods, rawcycpp_shape_recipe_change_commods + 2);
1157 int rawcycpp_shape_recipe_change_in[2] = {-1, -1};
1158 cycpp_shape_recipe_change_in = std::vector<int>(rawcycpp_shape_recipe_change_in, rawcycpp_shape_recipe_change_in + 2);
1159 int rawcycpp_shape_recipe_change_out[2] = {-1, -1};
1160 cycpp_shape_recipe_change_out = std::vector<int>(rawcycpp_shape_recipe_change_out, rawcycpp_shape_recipe_change_out + 2);
1161 int rawcycpp_shape_assem_size[1] = {-1};
1162 cycpp_shape_assem_size = std::vector<int>(rawcycpp_shape_assem_size, rawcycpp_shape_assem_size + 1);
1163 int rawcycpp_shape_n_assem_batch[1] = {-1};
1164 cycpp_shape_n_assem_batch = std::vector<int>(rawcycpp_shape_n_assem_batch, rawcycpp_shape_n_assem_batch + 1);
1165 int rawcycpp_shape_n_assem_core[1] = {-1};
1166 cycpp_shape_n_assem_core = std::vector<int>(rawcycpp_shape_n_assem_core, rawcycpp_shape_n_assem_core + 1);
1167 int rawcycpp_shape_n_assem_fresh[1] = {-1};
1168 cycpp_shape_n_assem_fresh = std::vector<int>(rawcycpp_shape_n_assem_fresh, rawcycpp_shape_n_assem_fresh + 1);
1169 int rawcycpp_shape_n_assem_spent[1] = {-1};
1170 cycpp_shape_n_assem_spent = std::vector<int>(rawcycpp_shape_n_assem_spent, rawcycpp_shape_n_assem_spent + 1);
1171 int rawcycpp_shape_cycle_time[1] = {-1};
1172 cycpp_shape_cycle_time = std::vector<int>(rawcycpp_shape_cycle_time, rawcycpp_shape_cycle_time + 1);
1173 int rawcycpp_shape_refuel_time[1] = {-1};
1174 cycpp_shape_refuel_time = std::vector<int>(rawcycpp_shape_refuel_time, rawcycpp_shape_refuel_time + 1);
1175 int rawcycpp_shape_cycle_step[1] = {-1};
1176 cycpp_shape_cycle_step = std::vector<int>(rawcycpp_shape_cycle_step, rawcycpp_shape_cycle_step + 1);
1177 int rawcycpp_shape_power_cap[1] = {-1};
1178 cycpp_shape_power_cap = std::vector<int>(rawcycpp_shape_power_cap, rawcycpp_shape_power_cap + 1);
1179 int rawcycpp_shape_power_name[1] = {-1};
1180 cycpp_shape_power_name = std::vector<int>(rawcycpp_shape_power_name, rawcycpp_shape_power_name + 1);
1181 int rawcycpp_shape_side_products[2] = {-1, -1};
1182 cycpp_shape_side_products = std::vector<int>(rawcycpp_shape_side_products, rawcycpp_shape_side_products + 2);
1183 int rawcycpp_shape_side_product_quantity[2] = {-1, -1};
1184 cycpp_shape_side_product_quantity = std::vector<int>(rawcycpp_shape_side_product_quantity, rawcycpp_shape_side_product_quantity + 2);
1185 int rawcycpp_shape_hybrid_[1] = {-1};
1186 cycpp_shape_hybrid_ = std::vector<int>(rawcycpp_shape_hybrid_, rawcycpp_shape_hybrid_ + 1);
1187 int rawcycpp_shape_decom_transmute_all[1] = {-1};
1188 cycpp_shape_decom_transmute_all = std::vector<int>(rawcycpp_shape_decom_transmute_all, rawcycpp_shape_decom_transmute_all + 1);
1189 int rawcycpp_shape_pref_change_times[2] = {-1, -1};
1190 cycpp_shape_pref_change_times = std::vector<int>(rawcycpp_shape_pref_change_times, rawcycpp_shape_pref_change_times + 2);
1191 int rawcycpp_shape_pref_change_commods[2] = {-1, -1};
1192 cycpp_shape_pref_change_commods = std::vector<int>(rawcycpp_shape_pref_change_commods, rawcycpp_shape_pref_change_commods + 2);
1193 int rawcycpp_shape_pref_change_values[2] = {-1, -1};
1194 cycpp_shape_pref_change_values = std::vector<int>(rawcycpp_shape_pref_change_values, rawcycpp_shape_pref_change_values + 2);
1195 int rawcycpp_shape_keep_packaging[1] = {-1};
1196 cycpp_shape_keep_packaging = std::vector<int>(rawcycpp_shape_keep_packaging, rawcycpp_shape_keep_packaging + 1);
1197 int rawcycpp_shape_fresh[2] = {-1, -1};
1198 cycpp_shape_fresh = std::vector<int>(rawcycpp_shape_fresh, rawcycpp_shape_fresh + 2);
1199 int rawcycpp_shape_core[2] = {-1, -1};
1200 cycpp_shape_core = std::vector<int>(rawcycpp_shape_core, rawcycpp_shape_core + 2);
1201 int rawcycpp_shape_spent[2] = {-1, -1};
1202 cycpp_shape_spent = std::vector<int>(rawcycpp_shape_spent, rawcycpp_shape_spent + 2);
1203 int rawcycpp_shape_discharged[1] = {-1};
1204 cycpp_shape_discharged = std::vector<int>(rawcycpp_shape_discharged, rawcycpp_shape_discharged + 1);
1205 int rawcycpp_shape_res_indexes[3] = {-1, -1, -1};
1206 cycpp_shape_res_indexes = std::vector<int>(rawcycpp_shape_res_indexes, rawcycpp_shape_res_indexes + 3);
1207 latitude = m->latitude;
1208 longitude = m->longitude;
1226 power_cap = m->power_cap;
1230 hybrid_ = m->hybrid_;
1238 fresh.capacity(m->fresh.capacity());
1239 core.capacity(m->core.capacity());
1240 spent.capacity(m->spent.capacity());
1241#line 43 "/cycamore/src/reactor.cc"
1242 cyclus::toolkit::CommodityProducer::Copy(m);
1243}
1244
1245void Reactor::InitFrom(cyclus::QueryableBackend* b) { cyclus::Facility::InitFrom(b);
1246 int rawcycpp_shape_latitude[1] = {-1};
1247 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
1248 int rawcycpp_shape_longitude[1] = {-1};
1249 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
1250 int rawcycpp_shape_fuel_incommods[2] = {-1, -1};
1251 cycpp_shape_fuel_incommods = std::vector<int>(rawcycpp_shape_fuel_incommods, rawcycpp_shape_fuel_incommods + 2);
1252 int rawcycpp_shape_fuel_inrecipes[2] = {-1, -1};
1253 cycpp_shape_fuel_inrecipes = std::vector<int>(rawcycpp_shape_fuel_inrecipes, rawcycpp_shape_fuel_inrecipes + 2);
1254 int rawcycpp_shape_fuel_prefs[2] = {-1, -1};
1255 cycpp_shape_fuel_prefs = std::vector<int>(rawcycpp_shape_fuel_prefs, rawcycpp_shape_fuel_prefs + 2);
1256 int rawcycpp_shape_fuel_outcommods[2] = {-1, -1};
1257 cycpp_shape_fuel_outcommods = std::vector<int>(rawcycpp_shape_fuel_outcommods, rawcycpp_shape_fuel_outcommods + 2);
1258 int rawcycpp_shape_fuel_outrecipes[2] = {-1, -1};
1259 cycpp_shape_fuel_outrecipes = std::vector<int>(rawcycpp_shape_fuel_outrecipes, rawcycpp_shape_fuel_outrecipes + 2);
1260 int rawcycpp_shape_recipe_change_times[2] = {-1, -1};
1261 cycpp_shape_recipe_change_times = std::vector<int>(rawcycpp_shape_recipe_change_times, rawcycpp_shape_recipe_change_times + 2);
1262 int rawcycpp_shape_recipe_change_commods[2] = {-1, -1};
1263 cycpp_shape_recipe_change_commods = std::vector<int>(rawcycpp_shape_recipe_change_commods, rawcycpp_shape_recipe_change_commods + 2);
1264 int rawcycpp_shape_recipe_change_in[2] = {-1, -1};
1265 cycpp_shape_recipe_change_in = std::vector<int>(rawcycpp_shape_recipe_change_in, rawcycpp_shape_recipe_change_in + 2);
1266 int rawcycpp_shape_recipe_change_out[2] = {-1, -1};
1267 cycpp_shape_recipe_change_out = std::vector<int>(rawcycpp_shape_recipe_change_out, rawcycpp_shape_recipe_change_out + 2);
1268 int rawcycpp_shape_assem_size[1] = {-1};
1269 cycpp_shape_assem_size = std::vector<int>(rawcycpp_shape_assem_size, rawcycpp_shape_assem_size + 1);
1270 int rawcycpp_shape_n_assem_batch[1] = {-1};
1271 cycpp_shape_n_assem_batch = std::vector<int>(rawcycpp_shape_n_assem_batch, rawcycpp_shape_n_assem_batch + 1);
1272 int rawcycpp_shape_n_assem_core[1] = {-1};
1273 cycpp_shape_n_assem_core = std::vector<int>(rawcycpp_shape_n_assem_core, rawcycpp_shape_n_assem_core + 1);
1274 int rawcycpp_shape_n_assem_fresh[1] = {-1};
1275 cycpp_shape_n_assem_fresh = std::vector<int>(rawcycpp_shape_n_assem_fresh, rawcycpp_shape_n_assem_fresh + 1);
1276 int rawcycpp_shape_n_assem_spent[1] = {-1};
1277 cycpp_shape_n_assem_spent = std::vector<int>(rawcycpp_shape_n_assem_spent, rawcycpp_shape_n_assem_spent + 1);
1278 int rawcycpp_shape_cycle_time[1] = {-1};
1279 cycpp_shape_cycle_time = std::vector<int>(rawcycpp_shape_cycle_time, rawcycpp_shape_cycle_time + 1);
1280 int rawcycpp_shape_refuel_time[1] = {-1};
1281 cycpp_shape_refuel_time = std::vector<int>(rawcycpp_shape_refuel_time, rawcycpp_shape_refuel_time + 1);
1282 int rawcycpp_shape_cycle_step[1] = {-1};
1283 cycpp_shape_cycle_step = std::vector<int>(rawcycpp_shape_cycle_step, rawcycpp_shape_cycle_step + 1);
1284 int rawcycpp_shape_power_cap[1] = {-1};
1285 cycpp_shape_power_cap = std::vector<int>(rawcycpp_shape_power_cap, rawcycpp_shape_power_cap + 1);
1286 int rawcycpp_shape_power_name[1] = {-1};
1287 cycpp_shape_power_name = std::vector<int>(rawcycpp_shape_power_name, rawcycpp_shape_power_name + 1);
1288 int rawcycpp_shape_side_products[2] = {-1, -1};
1289 cycpp_shape_side_products = std::vector<int>(rawcycpp_shape_side_products, rawcycpp_shape_side_products + 2);
1290 int rawcycpp_shape_side_product_quantity[2] = {-1, -1};
1291 cycpp_shape_side_product_quantity = std::vector<int>(rawcycpp_shape_side_product_quantity, rawcycpp_shape_side_product_quantity + 2);
1292 int rawcycpp_shape_hybrid_[1] = {-1};
1293 cycpp_shape_hybrid_ = std::vector<int>(rawcycpp_shape_hybrid_, rawcycpp_shape_hybrid_ + 1);
1294 int rawcycpp_shape_decom_transmute_all[1] = {-1};
1295 cycpp_shape_decom_transmute_all = std::vector<int>(rawcycpp_shape_decom_transmute_all, rawcycpp_shape_decom_transmute_all + 1);
1296 int rawcycpp_shape_pref_change_times[2] = {-1, -1};
1297 cycpp_shape_pref_change_times = std::vector<int>(rawcycpp_shape_pref_change_times, rawcycpp_shape_pref_change_times + 2);
1298 int rawcycpp_shape_pref_change_commods[2] = {-1, -1};
1299 cycpp_shape_pref_change_commods = std::vector<int>(rawcycpp_shape_pref_change_commods, rawcycpp_shape_pref_change_commods + 2);
1300 int rawcycpp_shape_pref_change_values[2] = {-1, -1};
1301 cycpp_shape_pref_change_values = std::vector<int>(rawcycpp_shape_pref_change_values, rawcycpp_shape_pref_change_values + 2);
1302 int rawcycpp_shape_keep_packaging[1] = {-1};
1303 cycpp_shape_keep_packaging = std::vector<int>(rawcycpp_shape_keep_packaging, rawcycpp_shape_keep_packaging + 1);
1304 int rawcycpp_shape_fresh[2] = {-1, -1};
1305 cycpp_shape_fresh = std::vector<int>(rawcycpp_shape_fresh, rawcycpp_shape_fresh + 2);
1306 int rawcycpp_shape_core[2] = {-1, -1};
1307 cycpp_shape_core = std::vector<int>(rawcycpp_shape_core, rawcycpp_shape_core + 2);
1308 int rawcycpp_shape_spent[2] = {-1, -1};
1309 cycpp_shape_spent = std::vector<int>(rawcycpp_shape_spent, rawcycpp_shape_spent + 2);
1310 int rawcycpp_shape_discharged[1] = {-1};
1311 cycpp_shape_discharged = std::vector<int>(rawcycpp_shape_discharged, rawcycpp_shape_discharged + 1);
1312 int rawcycpp_shape_res_indexes[3] = {-1, -1, -1};
1313 cycpp_shape_res_indexes = std::vector<int>(rawcycpp_shape_res_indexes, rawcycpp_shape_res_indexes + 3);
1314 cyclus::QueryResult qr = b->Query("Info", NULL);
1315 latitude = qr.GetVal<double>("latitude");
1316 longitude = qr.GetVal<double>("longitude");
1317 fuel_incommods = qr.GetVal<std::vector< std::string > >("fuel_incommods");
1318 fuel_inrecipes = qr.GetVal<std::vector< std::string > >("fuel_inrecipes");
1319 fuel_prefs = qr.GetVal<std::vector< double > >("fuel_prefs");
1320 fuel_outcommods = qr.GetVal<std::vector< std::string > >("fuel_outcommods");
1321 fuel_outrecipes = qr.GetVal<std::vector< std::string > >("fuel_outrecipes");
1322 recipe_change_times = qr.GetVal<std::vector< int > >("recipe_change_times");
1323 recipe_change_commods = qr.GetVal<std::vector< std::string > >("recipe_change_commods");
1324 recipe_change_in = qr.GetVal<std::vector< std::string > >("recipe_change_in");
1325 recipe_change_out = qr.GetVal<std::vector< std::string > >("recipe_change_out");
1326 assem_size = qr.GetVal<double>("assem_size");
1327 n_assem_batch = qr.GetVal<int>("n_assem_batch");
1328 n_assem_core = qr.GetVal<int>("n_assem_core");
1329 n_assem_fresh = qr.GetVal<int>("n_assem_fresh");
1330 n_assem_spent = qr.GetVal<int>("n_assem_spent");
1331 cycle_time = qr.GetVal<int>("cycle_time");
1332 refuel_time = qr.GetVal<int>("refuel_time");
1333 cycle_step = qr.GetVal<int>("cycle_step");
1334 power_cap = qr.GetVal<double>("power_cap");
1335 power_name = qr.GetVal<std::string>("power_name");
1336 side_products = qr.GetVal<std::vector< std::string > >("side_products");
1337 side_product_quantity = qr.GetVal<std::vector< double > >("side_product_quantity");
1338 hybrid_ = qr.GetVal<bool>("hybrid_");
1339 decom_transmute_all = qr.GetVal<bool>("decom_transmute_all");
1340 pref_change_times = qr.GetVal<std::vector< int > >("pref_change_times");
1341 pref_change_commods = qr.GetVal<std::vector< std::string > >("pref_change_commods");
1342 pref_change_values = qr.GetVal<std::vector< double > >("pref_change_values");
1343 keep_packaging = qr.GetVal<bool>("keep_packaging");
1344 discharged = qr.GetVal<bool>("discharged");
1345 res_indexes = qr.GetVal<std::map< int, int > >("res_indexes");
1346 fresh.capacity(n_assem_fresh * assem_size);
1347 core.capacity(n_assem_core * assem_size);
1348 spent.capacity(n_assem_spent * assem_size);
1349#line 48 "/cycamore/src/reactor.cc"
1350
1351 namespace tk = cyclus::toolkit;
1352 tk::CommodityProducer::Add(tk::Commodity(power_name),
1353 tk::CommodInfo(power_cap, power_cap));
1354
1355 for (int i = 0; i < side_products.size(); i++) {
1356 tk::CommodityProducer::Add(tk::Commodity(side_products[i]),
1357 tk::CommodInfo(side_product_quantity[i],
1359 }
1360}
1361
1363 cyclus::Facility::EnterNotify();
1364
1365 // Set keep packaging parameter in all ResBufs
1366 fresh.keep_packaging(keep_packaging);
1367 core.keep_packaging(keep_packaging);
1368 spent.keep_packaging(keep_packaging);
1369
1370 // If the user ommitted fuel_prefs, we set it to zeros for each fuel
1371 // type. Without this segfaults could occur - yuck.
1372 if (fuel_prefs.size() == 0) {
1373 for (int i = 0; i < fuel_outcommods.size(); i++) {
1374 fuel_prefs.push_back(cyclus::kDefaultPref);
1375 }
1376 }
1377
1378 // Test if any side products have been defined.
1379 if (side_products.size() == 0){
1380 hybrid_ = false;
1381 }
1382
1383 // input consistency checking:
1384 int n = recipe_change_times.size();
1385 std::stringstream ss;
1386 if (recipe_change_commods.size() != n) {
1387 ss << "prototype '" << prototype() << "' has "
1388 << recipe_change_commods.size()
1389 << " recipe_change_commods vals, expected " << n << "\n";
1390 }
1391 if (recipe_change_in.size() != n) {
1392 ss << "prototype '" << prototype() << "' has " << recipe_change_in.size()
1393 << " recipe_change_in vals, expected " << n << "\n";
1394 }
1395 if (recipe_change_out.size() != n) {
1396 ss << "prototype '" << prototype() << "' has " << recipe_change_out.size()
1397 << " recipe_change_out vals, expected " << n << "\n";
1398 }
1399
1400 n = pref_change_times.size();
1401 if (pref_change_commods.size() != n) {
1402 ss << "prototype '" << prototype() << "' has " << pref_change_commods.size()
1403 << " pref_change_commods vals, expected " << n << "\n";
1404 }
1405 if (pref_change_values.size() != n) {
1406 ss << "prototype '" << prototype() << "' has " << pref_change_values.size()
1407 << " pref_change_values vals, expected " << n << "\n";
1408 }
1409
1410 if (ss.str().size() > 0) {
1411 throw ValueError(ss.str());
1412 }
1413
1414 InitializePosition();
1415}
1416
1418 return core.count() == 0 && spent.count() == 0;
1419}
1420
1422 // The following code must go in the Tick so they fire on the time step
1423 // following the cycle_step update - allowing for the all reactor events to
1424 // occur and be recorded on the "beginning" of a time step. Another reason
1425 // they
1426 // can't go at the beginnin of the Tock is so that resource exchange has a
1427 // chance to occur after the discharge on this same time step.
1428
1429 if (retired()) {
1430 Record("RETIRED", "");
1431
1432 if (context()->time() == exit_time() + 1) { // only need to transmute once
1433 if (decom_transmute_all == true) {
1434 Transmute(ceil(static_cast<double>(n_assem_core)));
1435 }
1436 else {
1437 Transmute(ceil(static_cast<double>(n_assem_core) / 2.0));
1438 }
1439 }
1440 while (core.count() > 0) {
1441 if (!Discharge()) {
1442 break;
1443 }
1444 }
1445 // in case a cycle lands exactly on our last time step, we will need to
1446 // burn a batch from fresh inventory on this time step. When retired,
1447 // this batch also needs to be discharged to spent fuel inventory.
1448 while (fresh.count() > 0 && spent.space() >= assem_size) {
1449 spent.Push(fresh.Pop());
1450 }
1452 context()->SchedDecom(this);
1453 }
1454 return;
1455 }
1456
1457 if (cycle_step == cycle_time) {
1458 Transmute();
1459 Record("CYCLE_END", "");
1460 }
1461
1462 if (cycle_step >= cycle_time && !discharged) {
1464 }
1465 if (cycle_step >= cycle_time) {
1466 Load();
1467 }
1468
1469 int t = context()->time();
1470
1471 // update preferences
1472 for (int i = 0; i < pref_change_times.size(); i++) {
1473 int change_t = pref_change_times[i];
1474 if (t != change_t) {
1475 continue;
1476 }
1477
1478 std::string incommod = pref_change_commods[i];
1479 for (int j = 0; j < fuel_incommods.size(); j++) {
1480 if (fuel_incommods[j] == incommod) {
1482 break;
1483 }
1484 }
1485 }
1486
1487 // update recipes
1488 for (int i = 0; i < recipe_change_times.size(); i++) {
1489 int change_t = recipe_change_times[i];
1490 if (t != change_t) {
1491 continue;
1492 }
1493
1494 std::string incommod = recipe_change_commods[i];
1495 for (int j = 0; j < fuel_incommods.size(); j++) {
1496 if (fuel_incommods[j] == incommod) {
1499 break;
1500 }
1501 }
1502 }
1503}
1504
1505std::set<cyclus::RequestPortfolio<Material>::Ptr> Reactor::GetMatlRequests() {
1506 using cyclus::RequestPortfolio;
1507
1508 std::set<RequestPortfolio<Material>::Ptr> ports;
1509 Material::Ptr m;
1510
1511 // second min expression reduces assembles to amount needed until
1512 // retirement if it is near.
1513 int n_assem_order = n_assem_core - core.count() + n_assem_fresh - fresh.count();
1514
1515 if (exit_time() != -1) {
1516 // the +1 accounts for the fact that the reactor is alive and gets to
1517 // operate during its exit_time time step.
1518 int t_left = exit_time() - context()->time() + 1;
1519 int t_left_cycle = cycle_time + refuel_time - cycle_step;
1520 double n_cycles_left = static_cast<double>(t_left - t_left_cycle) /
1521 static_cast<double>(cycle_time + refuel_time);
1522 n_cycles_left = ceil(n_cycles_left);
1523 int n_need = std::max(0.0, n_cycles_left * n_assem_batch - n_assem_fresh + n_assem_core - core.count());
1524 n_assem_order = std::min(n_assem_order, n_need);
1525 }
1526
1527 if (n_assem_order == 0) {
1528 return ports;
1529 } else if (retired()) {
1530 return ports;
1531 }
1532
1533 for (int i = 0; i < n_assem_order; i++) {
1534 RequestPortfolio<Material>::Ptr port(new RequestPortfolio<Material>());
1535 std::vector<Request<Material>*> mreqs;
1536 for (int j = 0; j < fuel_incommods.size(); j++) {
1537 std::string commod = fuel_incommods[j];
1538 double pref = fuel_prefs[j];
1539 cyclus::Composition::Ptr recipe = context()->GetRecipe(fuel_inrecipes[j]);
1540 m = Material::CreateUntracked(assem_size, recipe);
1541
1542 Request<Material>* r = port->AddRequest(m, this, commod, pref, true);
1543 mreqs.push_back(r);
1544 }
1545
1546 std::vector<double>::iterator result;
1547 result = std::max_element(fuel_prefs.begin(), fuel_prefs.end());
1548 int max_index = std::distance(fuel_prefs.begin(), result);
1549
1550 cyclus::toolkit::RecordTimeSeries<double>("demand"+fuel_incommods[max_index], this,
1551 assem_size) ;
1552
1553 port->AddMutualReqs(mreqs);
1554 ports.insert(port);
1555 }
1556
1557 return ports;
1558}
1559
1561 const std::vector<cyclus::Trade<Material> >& trades,
1562 std::vector<std::pair<cyclus::Trade<Material>, Material::Ptr> >&
1563 responses) {
1564 using cyclus::Trade;
1565
1566 std::map<std::string, MatVec> mats = PopSpent();
1567 for (int i = 0; i < trades.size(); i++) {
1568 std::string commod = trades[i].request->commodity();
1569 Material::Ptr m = mats[commod].back();
1570 mats[commod].pop_back();
1571 responses.push_back(std::make_pair(trades[i], m));
1572 res_indexes.erase(m->obj_id());
1573 }
1574 PushSpent(mats); // return leftovers back to spent buffer
1575}
1576
1577void Reactor::AcceptMatlTrades(const std::vector<
1578 std::pair<cyclus::Trade<Material>, Material::Ptr> >& responses) {
1579 std::vector<std::pair<cyclus::Trade<Material>,
1580 Material::Ptr> >::const_iterator trade;
1581
1582 std::stringstream ss;
1583 int nload = std::min((int)responses.size(), n_assem_core - core.count());
1584 if (nload > 0) {
1585 ss << nload << " assemblies";
1586 Record("LOAD", ss.str());
1587 }
1588
1589 for (trade = responses.begin(); trade != responses.end(); ++trade) {
1590 std::string commod = trade->first.request->commodity();
1591 Material::Ptr m = trade->second;
1592 index_res(m, commod);
1593
1594 if (core.count() < n_assem_core) {
1595 core.Push(m);
1596 } else {
1597 fresh.Push(m);
1598 }
1599 }
1600}
1601
1602std::set<cyclus::BidPortfolio<Material>::Ptr> Reactor::GetMatlBids(
1603 cyclus::CommodMap<Material>::type& commod_requests) {
1604 using cyclus::BidPortfolio;
1605 std::set<BidPortfolio<Material>::Ptr> ports;
1606
1607 bool gotmats = false;
1608 std::map<std::string, MatVec> all_mats;
1609
1610 if (uniq_outcommods_.empty()) {
1611 for (int i = 0; i < fuel_outcommods.size(); i++) {
1613 }
1614 }
1615
1616 std::set<std::string>::iterator it;
1617 for (it = uniq_outcommods_.begin(); it != uniq_outcommods_.end(); ++it) {
1618 std::string commod = *it;
1619 std::vector<Request<Material>*>& reqs = commod_requests[commod];
1620 if (reqs.size() == 0) {
1621 continue;
1622 } else if (!gotmats) {
1623 all_mats = PeekSpent();
1624 }
1625
1626 MatVec mats = all_mats[commod];
1627 if (mats.size() == 0) {
1628 continue;
1629 }
1630
1631 BidPortfolio<Material>::Ptr port(new BidPortfolio<Material>());
1632
1633 for (int j = 0; j < reqs.size(); j++) {
1634 Request<Material>* req = reqs[j];
1635 double tot_bid = 0;
1636 for (int k = 0; k < mats.size(); k++) {
1637 Material::Ptr m = mats[k];
1638 tot_bid += m->quantity();
1639 port->AddBid(req, m, this, true);
1640 if (tot_bid >= req->target()->quantity()) {
1641 break;
1642 }
1643 }
1644 }
1645
1646 double tot_qty = 0;
1647 for (int j = 0; j < mats.size(); j++) {
1648 tot_qty += mats[j]->quantity();
1649 }
1650
1651 cyclus::CapacityConstraint<Material> cc(tot_qty);
1652 port->AddConstraint(cc);
1653 ports.insert(port);
1654 }
1655
1656 return ports;
1657}
1658
1660 if (retired()) {
1661 return;
1662 }
1663
1664 // Check that irradiation and refueling periods are over, that
1665 // the core is full and that fuel was successfully discharged in this refueling time.
1666 // If this is the case, then a new cycle will be initiated.
1667 if (cycle_step >= cycle_time + refuel_time && core.count() == n_assem_core && discharged == true) {
1668 discharged = false;
1669 cycle_step = 0;
1670 }
1671
1672 if (cycle_step == 0 && core.count() == n_assem_core) {
1673 Record("CYCLE_START", "");
1674 }
1675
1676 if (cycle_step >= 0 && cycle_step < cycle_time &&
1677 core.count() == n_assem_core) {
1678 cyclus::toolkit::RecordTimeSeries<cyclus::toolkit::POWER>(this, power_cap);
1679 cyclus::toolkit::RecordTimeSeries<double>("supplyPOWER", this, power_cap);
1680 RecordSideProduct(true);
1681 } else {
1682 cyclus::toolkit::RecordTimeSeries<cyclus::toolkit::POWER>(this, 0);
1683 cyclus::toolkit::RecordTimeSeries<double>("supplyPOWER", this, 0);
1684 RecordSideProduct(false);
1685 }
1686
1687 // "if" prevents starting cycle after initial deployment until core is full
1688 // even though cycle_step is its initial zero.
1689 if (cycle_step > 0 || core.count() == n_assem_core) {
1690 cycle_step++;
1691 }
1692}
1693
1695
1696void Reactor::Transmute(int n_assem) {
1697 MatVec old = core.PopN(std::min(n_assem, core.count()));
1698 core.Push(old);
1699 if (core.count() > old.size()) {
1700 // rotate untransmuted mats back to back of buffer
1701 core.Push(core.PopN(core.count() - old.size()));
1702 }
1703
1704 std::stringstream ss;
1705 ss << old.size() << " assemblies";
1706 Record("TRANSMUTE", ss.str());
1707
1708 for (int i = 0; i < old.size(); i++) {
1709 old[i]->Transmute(context()->GetRecipe(fuel_outrecipe(old[i])));
1710 }
1711}
1712
1713std::map<std::string, MatVec> Reactor::PeekSpent() {
1714 std::map<std::string, MatVec> mapped;
1715 MatVec mats = spent.PopN(spent.count());
1716 spent.Push(mats);
1717 for (int i = 0; i < mats.size(); i++) {
1718 std::string commod = fuel_outcommod(mats[i]);
1719 mapped[commod].push_back(mats[i]);
1720 }
1721 return mapped;
1722}
1723
1725 int npop = std::min(n_assem_batch, core.count());
1726 if (n_assem_spent - spent.count() < npop) {
1727 Record("DISCHARGE", "failed");
1728 return false; // not enough room in spent buffer
1729 }
1730
1731 std::stringstream ss;
1732 ss << npop << " assemblies";
1733 Record("DISCHARGE", ss.str());
1734 spent.Push(core.PopN(npop));
1735
1736 std::map<std::string, MatVec> spent_mats;
1737 for (int i = 0; i < fuel_outcommods.size(); i++) {
1738 spent_mats = PeekSpent();
1739 MatVec mats = spent_mats[fuel_outcommods[i]];
1740 double tot_spent = 0;
1741 for (int j = 0; j<mats.size(); j++){
1742 Material::Ptr m = mats[j];
1743 tot_spent += m->quantity();
1744 }
1745 cyclus::toolkit::RecordTimeSeries<double>("supply"+fuel_outcommods[i], this, tot_spent);
1746 }
1747
1748 return true;
1749}
1750
1752 int n = std::min(n_assem_core - core.count(), fresh.count());
1753 if (n == 0) {
1754 return;
1755 }
1756
1757 std::stringstream ss;
1758 ss << n << " assemblies";
1759 Record("LOAD", ss.str());
1760 core.Push(fresh.PopN(n));
1761}
1762
1763std::string Reactor::fuel_incommod(Material::Ptr m) {
1764 int i = res_indexes[m->obj_id()];
1765 if (i >= fuel_incommods.size()) {
1766 throw KeyError("cycamore::Reactor - no incommod for material object");
1767 }
1768 return fuel_incommods[i];
1769}
1770
1771std::string Reactor::fuel_outcommod(Material::Ptr m) {
1772 int i = res_indexes[m->obj_id()];
1773 if (i >= fuel_outcommods.size()) {
1774 throw KeyError("cycamore::Reactor - no outcommod for material object");
1775 }
1776 return fuel_outcommods[i];
1777}
1778
1779std::string Reactor::fuel_inrecipe(Material::Ptr m) {
1780 int i = res_indexes[m->obj_id()];
1781 if (i >= fuel_inrecipes.size()) {
1782 throw KeyError("cycamore::Reactor - no inrecipe for material object");
1783 }
1784 return fuel_inrecipes[i];
1785}
1786
1787std::string Reactor::fuel_outrecipe(Material::Ptr m) {
1788 int i = res_indexes[m->obj_id()];
1789 if (i >= fuel_outrecipes.size()) {
1790 throw KeyError("cycamore::Reactor - no outrecipe for material object");
1791 }
1792 return fuel_outrecipes[i];
1793}
1794
1795double Reactor::fuel_pref(Material::Ptr m) {
1796 int i = res_indexes[m->obj_id()];
1797 if (i >= fuel_prefs.size()) {
1798 return 0;
1799 }
1800 return fuel_prefs[i];
1801}
1802
1803void Reactor::index_res(cyclus::Resource::Ptr m, std::string incommod) {
1804 for (int i = 0; i < fuel_incommods.size(); i++) {
1805 if (fuel_incommods[i] == incommod) {
1806 res_indexes[m->obj_id()] = i;
1807 return;
1808 }
1809 }
1810 throw ValueError(
1811 "cycamore::Reactor - received unsupported incommod material");
1812}
1813
1814std::map<std::string, MatVec> Reactor::PopSpent() {
1815 MatVec mats = spent.PopN(spent.count());
1816 std::map<std::string, MatVec> mapped;
1817 for (int i = 0; i < mats.size(); i++) {
1818 std::string commod = fuel_outcommod(mats[i]);
1819 mapped[commod].push_back(mats[i]);
1820 }
1821
1822 // needed so we trade away oldest assemblies first
1823 std::map<std::string, MatVec>::iterator it;
1824 for (it = mapped.begin(); it != mapped.end(); ++it) {
1825 std::reverse(it->second.begin(), it->second.end());
1826 }
1827
1828 return mapped;
1829}
1830
1831void Reactor::PushSpent(std::map<std::string, MatVec> leftover) {
1832 std::map<std::string, MatVec>::iterator it;
1833 for (it = leftover.begin(); it != leftover.end(); ++it) {
1834 // undo reverse in PopSpent to make sure oldest assemblies come out first
1835 std::reverse(it->second.begin(), it->second.end());
1836 spent.Push(it->second);
1837 }
1838}
1839
1841 if (hybrid_){
1842 double value;
1843 for (int i = 0; i < side_products.size(); i++) {
1844 if (produce){
1845 value = side_product_quantity[i];
1846 }
1847 else {
1848 value = 0;
1849 }
1850
1851 context()
1852 ->NewDatum("ReactorSideProducts")
1853 ->AddVal("AgentId", id())
1854 ->AddVal("Time", context()->time())
1855 ->AddVal("Product", side_products[i])
1856 ->AddVal("Value", value)
1857 ->Record();
1858 }
1859 }
1860}
1861
1862void Reactor::Record(std::string name, std::string val) {
1863 context()
1864 ->NewDatum("ReactorEvents")
1865 ->AddVal("AgentId", id())
1866 ->AddVal("Time", context()->time())
1867 ->AddVal("Event", name)
1868 ->AddVal("Value", val)
1869 ->Record();
1870}
1871
1872extern "C" cyclus::Agent* ConstructReactor(cyclus::Context* ctx) {
1873 return new Reactor(ctx);
1874}
1875
1876} // namespace cycamore
Reactor is a simple, general reactor based on static compositional transformations to model fuel burn...
std::string fuel_incommod(cyclus::Material::Ptr m)
std::vector< int > cycpp_shape_discharged
std::vector< int > cycpp_shape_pref_change_times
std::vector< int > cycpp_shape_refuel_time
std::vector< double > side_product_quantity
std::vector< std::string > recipe_change_in
virtual void Snapshot(cyclus::DbInit di)
std::vector< int > recipe_change_times
std::vector< int > cycpp_shape_fuel_prefs
std::vector< int > cycpp_shape_res_indexes
std::vector< int > cycpp_shape_recipe_change_out
void index_res(cyclus::Resource::Ptr m, std::string incommod)
Store fuel info index for the given resource received on incommod.
virtual void InitInv(cyclus::Inventories &inv)
std::vector< std::string > side_products
std::map< std::string, cyclus::toolkit::MatVec > PopSpent()
Returns all spent assemblies indexed by outcommod - removing them from the spent fuel buffer.
virtual void InfileToDb(cyclus::InfileTree *tree, cyclus::DbInit di)
virtual Json::Value annotations()
void RecordSideProduct(bool produce)
Records production of side products from the reactor.
std::vector< int > cycpp_shape_fuel_outrecipes
std::vector< std::string > fuel_outrecipes
std::vector< std::string > pref_change_commods
virtual void GetMatlTrades(const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
std::vector< int > cycpp_shape_decom_transmute_all
std::vector< int > cycpp_shape_pref_change_commods
bool Discharge()
Discharge a batch from the core if there is room in the spent fuel inventory.
void Transmute()
Transmute the batch that is about to be discharged from the core to its fully burnt state as defined ...
virtual cyclus::Agent * Clone()
cyclus::toolkit::ResBuf< cyclus::Material > spent
std::vector< std::string > recipe_change_out
std::map< int, int > res_indexes
std::vector< int > cycpp_shape_fresh
std::vector< int > cycpp_shape_cycle_step
std::vector< int > cycpp_shape_hybrid_
std::vector< int > cycpp_shape_keep_packaging
std::vector< double > pref_change_values
void Record(std::string name, std::string val)
Records a reactor event to the output db with the given name and note val.
std::vector< int > cycpp_shape_spent
cyclus::toolkit::ResBuf< cyclus::Material > core
double fuel_pref(cyclus::Material::Ptr m)
virtual cyclus::Inventories SnapshotInv()
std::map< std::string, cyclus::toolkit::MatVec > PeekSpent()
Returns all spent assemblies indexed by outcommod without removing them from the spent fuel buffer.
std::string fuel_inrecipe(cyclus::Material::Ptr m)
std::vector< std::string > fuel_outcommods
std::vector< int > cycpp_shape_recipe_change_commods
std::vector< int > cycpp_shape_cycle_time
std::vector< int > cycpp_shape_recipe_change_times
virtual void InitFrom(cycamore::Reactor *m)
std::vector< int > cycpp_shape_recipe_change_in
std::vector< int > cycpp_shape_side_products
virtual void AcceptMatlTrades(const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
std::vector< int > pref_change_times
std::string fuel_outcommod(cyclus::Material::Ptr m)
std::vector< int > cycpp_shape_n_assem_core
virtual std::set< cyclus::BidPortfolio< cyclus::Material >::Ptr > GetMatlBids(cyclus::CommodMap< cyclus::Material >::type &commod_requests)
std::vector< int > cycpp_shape_power_cap
virtual bool CheckDecommissionCondition()
std::vector< int > cycpp_shape_n_assem_fresh
std::vector< int > cycpp_shape_pref_change_values
std::vector< int > cycpp_shape_core
std::vector< int > cycpp_shape_n_assem_spent
std::vector< int > cycpp_shape_n_assem_batch
std::vector< int > cycpp_shape_fuel_outcommods
void Load()
Top up core inventory as much as possible.
std::string fuel_outrecipe(cyclus::Material::Ptr m)
std::vector< int > cycpp_shape_power_name
void PushSpent(std::map< std::string, cyclus::toolkit::MatVec > leftover)
Complement of PopSpent - must be called with all materials passed that were not traded away to other ...
std::vector< double > fuel_prefs
cyclus::toolkit::ResBuf< cyclus::Material > fresh
virtual std::string schema()
std::vector< int > cycpp_shape_fuel_inrecipes
std::set< std::string > uniq_outcommods_
std::vector< std::string > fuel_incommods
std::vector< int > cycpp_shape_assem_size
std::vector< std::string > fuel_inrecipes
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > GetMatlRequests()
Reactor(cyclus::Context *ctx)
std::vector< int > cycpp_shape_fuel_incommods
std::vector< int > cycpp_shape_side_product_quantity
std::vector< std::string > recipe_change_commods
cyclus::Agent * ConstructReactor(cyclus::Context *ctx)