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