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