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