52 cyclus::Region::InitFrom(m);
53 int rawcycpp_shape_commodity_demand[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
55 int rawcycpp_shape_latitude[1] = {-1};
57 int rawcycpp_shape_longitude[1] = {-1};
65 virtual void InitFrom(cyclus::QueryableBackend* b) {
66 cyclus::Region::InitFrom(b);
67 int rawcycpp_shape_commodity_demand[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
69 int rawcycpp_shape_latitude[1] = {-1};
71 int rawcycpp_shape_longitude[1] = {-1};
73 cyclus::QueryResult qr = b->Query(
"Info", NULL);
74 commodity_demand = qr.GetVal<std::map< std::string, std::vector< std::pair< int, std::pair< std::string, std::string > > > > >(
"commodity_demand");
75 latitude = qr.GetVal<
double>(
"latitude");
76 longitude = qr.GetVal<
double>(
"longitude");
80 virtual void InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di) {
81 cyclus::Region::InfileToDb(tree, di);
82 int rawcycpp_shape_commodity_demand[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
84 int rawcycpp_shape_latitude[1] = {-1};
86 int rawcycpp_shape_longitude[1] = {-1};
88 cyclus::InfileTree* sub = tree->SubTree(
"config/*");
92 cyclus::InfileTree* bub = sub->SubTree(
"growth", 0);
93 cyclus::InfileTree* sub = bub;
94 int n1 = sub->NMatches(
"item");
95 std::map< std::string, std::vector< std::pair< int, std::pair< std::string, std::string > > > > commodity_demand_val;
96 for (
int i1 = 0; i1 < n1; ++i1) {
99 std::string key_in = cyclus::Query<std::string>(sub,
"item/commod", i1);
102 std::vector< std::pair< int, std::pair< std::string, std::string > > > val;
104 cyclus::InfileTree* bub = sub->SubTree(
"item/piecewise_function", i1);
105 cyclus::InfileTree* sub = bub;
106 int n2 = sub->NMatches(
"piece");
107 std::vector< std::pair< int, std::pair< std::string, std::string > > > val_in;
109 for (
int i2 = 0; i2 < n2; ++i2) {
110 std::pair< int, std::pair< std::string, std::string > > elem;
112 cyclus::InfileTree* bub = sub->SubTree(
"piece", i2);
113 cyclus::InfileTree* sub = bub;
116 int firsti2_in = cyclus::Query<int>(sub,
"start", 0);
117 firsti2 = firsti2_in;
119 std::pair< std::string, std::string > secondi2;
121 cyclus::InfileTree* bub = sub->SubTree(
"function", 0);
122 cyclus::InfileTree* sub = bub;
125 std::string first0_in = cyclus::Query<std::string>(sub,
"type", 0);
130 std::string second0_in = cyclus::Query<std::string>(sub,
"params", 0);
131 second0 = second0_in;
133 std::pair< std::string, std::string > secondi2_in(first0, second0);
134 secondi2 = secondi2_in;
136 std::pair< int, std::pair< std::string, std::string > > elem_in(firsti2, secondi2);
143 commodity_demand_val[key] = val;
147 if (sub->NMatches(
"latitude") > 0) {
149 double latitude_val = cyclus::Query<double>(sub,
"latitude");
153 double latitude_tmp = 0.0;
156 if (sub->NMatches(
"longitude") > 0) {
158 double longitude_val = cyclus::Query<double>(sub,
"longitude");
162 double longitude_tmp = 0.0;