79 cyclus::Facility::InitFrom(m);
80 int rawcycpp_shape_latitude[1] = {-1};
81 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
82 int rawcycpp_shape_longitude[1] = {-1};
83 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
84 int rawcycpp_shape_feed_commods[2] = {-1, -1};
86 int rawcycpp_shape_feed_commod_prefs[2] = {-1, -1};
88 int rawcycpp_shape_feed_recipe[1] = {-1};
90 int rawcycpp_shape_feedbuf_size[1] = {-1};
92 int rawcycpp_shape_feed[2] = {-1, -1};
93 cycpp_shape_feed = std::vector<int>(rawcycpp_shape_feed, rawcycpp_shape_feed + 2);
94 int rawcycpp_shape_throughput[1] = {-1};
96 int rawcycpp_shape_leftover_commod[1] = {-1};
98 int rawcycpp_shape_leftoverbuf_size[1] = {-1};
100 int rawcycpp_shape_leftover[2] = {-1, -1};
102 int rawcycpp_shape_streams_[7] = {-1, -1, -1, -1, -1, -1, -1};
104 latitude = m->latitude;
105 longitude = m->longitude;
118 virtual void InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di) {
119 cyclus::Facility::InfileToDb(tree, di);
120 int rawcycpp_shape_latitude[1] = {-1};
121 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
122 int rawcycpp_shape_longitude[1] = {-1};
123 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
124 int rawcycpp_shape_feed_commods[2] = {-1, -1};
126 int rawcycpp_shape_feed_commod_prefs[2] = {-1, -1};
128 int rawcycpp_shape_feed_recipe[1] = {-1};
130 int rawcycpp_shape_feedbuf_size[1] = {-1};
132 int rawcycpp_shape_feed[2] = {-1, -1};
133 cycpp_shape_feed = std::vector<int>(rawcycpp_shape_feed, rawcycpp_shape_feed + 2);
134 int rawcycpp_shape_throughput[1] = {-1};
136 int rawcycpp_shape_leftover_commod[1] = {-1};
138 int rawcycpp_shape_leftoverbuf_size[1] = {-1};
140 int rawcycpp_shape_leftover[2] = {-1, -1};
142 int rawcycpp_shape_streams_[7] = {-1, -1, -1, -1, -1, -1, -1};
144 cyclus::InfileTree* sub = tree->SubTree(
"config/*");
147 if (sub->NMatches(
"latitude") > 0) {
149 double latitude_val = cyclus::Query<double>(sub,
"latitude");
150 latitude = latitude_val;
153 double latitude_tmp = 0.0;
154 latitude = latitude_tmp;
156 if (sub->NMatches(
"longitude") > 0) {
158 double longitude_val = cyclus::Query<double>(sub,
"longitude");
159 longitude = longitude_val;
162 double longitude_tmp = 0.0;
163 longitude = longitude_tmp;
166 cyclus::InfileTree* bub = sub->SubTree(
"feed_commods", 0);
167 cyclus::InfileTree* sub = bub;
168 int n1 = sub->NMatches(
"val");
169 std::vector< std::string > feed_commods_val;
170 feed_commods_val.resize(n1);
171 for (
int i1 = 0; i1 < n1; ++i1) {
174 std::string elem_in = cyclus::Query<std::string>(sub,
"val", i1);
177 feed_commods_val[i1] = elem;
181 if (sub->NMatches(
"feed_commod_prefs") > 0) {
183 cyclus::InfileTree* bub = sub->SubTree(
"feed_commod_prefs", 0);
184 cyclus::InfileTree* sub = bub;
185 int n1 = sub->NMatches(
"val");
186 std::vector< double > feed_commod_prefs_val;
187 feed_commod_prefs_val.resize(n1);
188 for (
int i1 = 0; i1 < n1; ++i1) {
191 double elem_in = cyclus::Query<double>(sub,
"val", i1);
194 feed_commod_prefs_val[i1] = elem;
199 std::vector< double > feed_commod_prefs_tmp;
200 feed_commod_prefs_tmp.resize(0);
205 if (sub->NMatches(
"feed_recipe") > 0) {
207 std::string feed_recipe_val = cyclus::Query<std::string>(sub,
"feed_recipe");
211 std::string feed_recipe_tmp(
"");
215 double feedbuf_size_val = cyclus::Query<double>(sub,
"feedbuf_size");
218 if (sub->NMatches(
"throughput") > 0) {
220 double throughput_val = cyclus::Query<double>(sub,
"throughput");
224 double throughput_tmp = 1e+299;
227 if (sub->NMatches(
"leftover_commod") > 0) {
229 std::string leftover_commod_val = cyclus::Query<std::string>(sub,
"leftover_commod");
233 std::string leftover_commod_tmp(
"default-waste-stream");
236 if (sub->NMatches(
"leftoverbuf_size") > 0) {
238 double leftoverbuf_size_val = cyclus::Query<double>(sub,
"leftoverbuf_size");
242 double leftoverbuf_size_tmp = 1e+299;
246 cyclus::InfileTree* bub = sub->SubTree(
"streams", 0);
247 cyclus::InfileTree* sub = bub;
248 int n1 = sub->NMatches(
"item");
249 std::map< std::string, std::pair< double, std::map< int, double > > > streams__val;
250 for (
int i1 = 0; i1 < n1; ++i1) {
253 std::string key_in = cyclus::Query<std::string>(sub,
"item/commod", i1);
256 std::pair< double, std::map< int, double > > val;
258 cyclus::InfileTree* bub = sub->SubTree(
"item/info", i1);
259 cyclus::InfileTree* sub = bub;
262 double firsti1_in = cyclus::Query<double>(sub,
"buf_size", 0);
263 firsti1 = firsti1_in;
265 std::map< int, double > secondi1;
267 cyclus::InfileTree* bub = sub->SubTree(
"efficiencies", 0);
268 cyclus::InfileTree* sub = bub;
269 int n2 = sub->NMatches(
"item");
270 std::map< int, double > secondi1_in;
271 for (
int i2 = 0; i2 < n2; ++i2) {
274 int key_in = pyne::nucname::id(cyclus::Query<std::string>(sub,
"item/comp", i2));
279 double val_in = cyclus::Query<double>(sub,
"item/eff", i2);
282 secondi1_in[key] = val;
284 secondi1 = secondi1_in;
286 std::pair< double, std::map< int, double > > val_in(firsti1, secondi1);
289 streams__val[key] = val;
294 ->AddVal(
"latitude", latitude, &cycpp_shape_latitude)
295 ->AddVal(
"longitude", longitude, &cycpp_shape_longitude)
307 virtual void InitFrom(cyclus::QueryableBackend* b) {
308 cyclus::Facility::InitFrom(b);
309 int rawcycpp_shape_latitude[1] = {-1};
310 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
311 int rawcycpp_shape_longitude[1] = {-1};
312 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
313 int rawcycpp_shape_feed_commods[2] = {-1, -1};
315 int rawcycpp_shape_feed_commod_prefs[2] = {-1, -1};
317 int rawcycpp_shape_feed_recipe[1] = {-1};
319 int rawcycpp_shape_feedbuf_size[1] = {-1};
321 int rawcycpp_shape_feed[2] = {-1, -1};
322 cycpp_shape_feed = std::vector<int>(rawcycpp_shape_feed, rawcycpp_shape_feed + 2);
323 int rawcycpp_shape_throughput[1] = {-1};
325 int rawcycpp_shape_leftover_commod[1] = {-1};
327 int rawcycpp_shape_leftoverbuf_size[1] = {-1};
329 int rawcycpp_shape_leftover[2] = {-1, -1};
331 int rawcycpp_shape_streams_[7] = {-1, -1, -1, -1, -1, -1, -1};
333 cyclus::QueryResult qr = b->Query(
"Info", NULL);
334 latitude = qr.GetVal<
double>(
"latitude");
335 longitude = qr.GetVal<
double>(
"longitude");
336 feed_commods = qr.GetVal<std::vector< std::string > >(
"feed_commods");
338 feed_recipe = qr.GetVal<std::string>(
"feed_recipe");
343 streams_ = qr.GetVal<std::map< std::string, std::pair< double, std::map< int, double > > > >(
"streams_");