2#line 1 "/cycamore/src/manager_inst.h"
3#ifndef CYCAMORE_SRC_MANAGER_INST_H_
4#define CYCAMORE_SRC_MANAGER_INST_H_
16 :
public cyclus::Institution,
17 public cyclus::toolkit::CommodityProducerManager,
18 public cyclus::toolkit::Builder,
19 public cyclus::toolkit::Position {
29 cyclus::Institution::InitFrom(m);
30 int rawcycpp_shape_prototypes[2] = {-1, -1};
32 int rawcycpp_shape_latitude[1] = {-1};
34 int rawcycpp_shape_longitude[1] = {-1};
40#line 26 "/cycamore/src/manager_inst.h"
42 virtual void InitFrom(cyclus::QueryableBackend* b) {
43 cyclus::Institution::InitFrom(b);
44 int rawcycpp_shape_prototypes[2] = {-1, -1};
46 int rawcycpp_shape_latitude[1] = {-1};
48 int rawcycpp_shape_longitude[1] = {-1};
50 cyclus::QueryResult qr = b->Query(
"Info", NULL);
51 prototypes = qr.GetVal<std::vector< std::string > >(
"prototypes");
52 latitude = qr.GetVal<
double>(
"latitude");
53 longitude = qr.GetVal<
double>(
"longitude");
55#line 28 "/cycamore/src/manager_inst.h"
57 virtual void InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di) {
58 cyclus::Institution::InfileToDb(tree, di);
59 int rawcycpp_shape_prototypes[2] = {-1, -1};
61 int rawcycpp_shape_latitude[1] = {-1};
63 int rawcycpp_shape_longitude[1] = {-1};
65 cyclus::InfileTree* sub = tree->SubTree(
"config/*");
69 cyclus::InfileTree* bub = sub->SubTree(
"prototypes", 0);
70 cyclus::InfileTree* sub = bub;
71 int n1 = sub->NMatches(
"val");
72 std::vector< std::string > prototypes_val;
73 prototypes_val.resize(n1);
74 for (
int i1 = 0; i1 < n1; ++i1) {
77 std::string elem_in = cyclus::Query<std::string>(sub,
"val", i1);
80 prototypes_val[i1] = elem;
84 if (sub->NMatches(
"latitude") > 0) {
86 double latitude_val = cyclus::Query<double>(sub,
"latitude");
90 double latitude_tmp = 0.0;
93 if (sub->NMatches(
"longitude") > 0) {
95 double longitude_val = cyclus::Query<double>(sub,
"longitude");
99 double longitude_tmp = 0.0;
118 " <element name=\"prototypes\">\n"
120 " <element name=\"val\">\n"
121 " <data type=\"string\"/>\n"
126 " <element name=\"latitude\">\n"
127 " <data type=\"double\"/>\n"
131 " <element name=\"longitude\">\n"
132 " <data type=\"double\"/>\n"
141 bool parsed_ok = reader.parse(
142 "{\"name\":\"cycamore::ManagerInst\",\"entity\":\"institut"
143 "ion\",\"parents\":[\"cyclus::Institution\",\"cyclus::too"
144 "lkit::Builder\",\"cyclus::toolkit::CommodityProducer"
145 "Manager\",\"cyclus::toolkit::Position\"],\"all_parents"
146 "\":[\"cyclus::Agent\",\"cyclus::Ider\",\"cyclus::Institu"
147 "tion\",\"cyclus::StateWrangler\",\"cyclus::TimeListene"
148 "r\",\"cyclus::toolkit::AgentManaged\",\"cyclus::toolki"
149 "t::Builder\",\"cyclus::toolkit::CommodityProducerMan"
150 "ager\",\"cyclus::toolkit::Position\"],\"vars\":{\"protot"
151 "ypes\":{\"tooltip\":[\"producer facility "
152 "prototypes\",\"\"],\"uilabel\":[\"Producer Prototype Lis"
153 "t\",\"\"],\"uitype\":[\"oneormore\",\"prototype\"],\"doc\":\"A"
154 " set of facility prototypes that this institution "
155 "can build. All prototypes in this list must be "
156 "based on an archetype that implements the "
157 "cyclus::toolkit::CommodityProducer interface\",\"typ"
158 "e\":[\"std::vector\",\"std::string\"],\"index\":0,\"shape\""
160 "1],\"alias\":[\"prototypes\",\"val\"]},\"latitude\":{\"defa"
161 "ult\":0.0,\"uilabel\":\"Geographical latitude in "
162 "degrees as a double\",\"doc\":\"Latitude of the "
163 "agent's geographical position. The value should be"
164 " expressed in degrees as a double.\",\"type\":\"double"
165 "\",\"index\":1,\"shape\":[-"
166 "1],\"alias\":\"latitude\",\"tooltip\":\"latitude\"},\"longi"
167 "tude\":{\"default\":0.0,\"uilabel\":\"Geographical "
168 "longitude in degrees as a double\",\"doc\":\"Longitude"
169 " of the agent's geographical position. The value "
170 "should be expressed in degrees as a double.\",\"type"
171 "\":\"double\",\"index\":2,\"shape\":[-"
172 "1],\"alias\":\"longitude\",\"tooltip\":\"longitude\"}},\"do"
173 "c\":\"An institution that owns and operates a "
174 "manually entered list of facilities in the input "
177 throw cyclus::ValueError(
"failed to parse annotations for cycamore::ManagerInst.");
182 virtual void InitInv(cyclus::Inventories& inv) {
186 cyclus::Inventories invs;
198 #pragma cyclus note {"doc": "An institution that owns and operates a " "manually entered list of facilities in " "the input file"}
199#line 32 "/cycamore/src/manager_inst.h"
222 #pragma cyclus var { "tooltip": "producer facility prototypes", "uilabel": "Producer Prototype List", "uitype": ["oneormore", "prototype"], "doc": "A set of facility prototypes that this institution can build. " "All prototypes in this list must be based on an archetype that " "implements the cyclus::toolkit::CommodityProducer interface", }
223#line 62 "/cycamore/src/manager_inst.h"
226#line 63 "/cycamore/src/manager_inst.h"
229 #pragma cyclus var { "default": 0.0, "uilabel": "Geographical latitude in degrees as a double", "doc": "Latitude of the agent's geographical position. The value should " "be expressed in degrees as a double." }
230#line 70 "/cycamore/src/manager_inst.h"
233#line 71 "/cycamore/src/manager_inst.h"
236 #pragma cyclus var { "default": 0.0, "uilabel": "Geographical longitude in degrees as a double", "doc": "Longitude of the agent's geographical position. The value should " "be expressed in degrees as a double." }
237#line 78 "/cycamore/src/manager_inst.h"
241#line 79 "/cycamore/src/manager_inst.h"
void Register_(cyclus::Agent *agent)
register a child
virtual void EnterNotify()
enter the simulation and register any children present
virtual ~ManagerInst()
Default destructor.
virtual void DecomNotify(Agent *m)
unregister a child
void WriteProducerInformation(cyclus::toolkit::CommodityProducer *producer)
write information about a commodity producer to a stream
virtual std::string schema()
virtual void Snapshot(cyclus::DbInit di)
virtual void InfileToDb(cyclus::InfileTree *tree, cyclus::DbInit di)
std::vector< int > cycpp_shape_prototypes
virtual void BuildNotify(Agent *m)
register a new child
virtual cyclus::Agent * Clone()
cyclus::toolkit::Position coordinates
void Unregister_(cyclus::Agent *agent)
unregister a child
virtual void InitInv(cyclus::Inventories &inv)
std::vector< int > cycpp_shape_longitude
virtual Json::Value annotations()
void RecordPosition()
Records an agent's latitude and longitude to the output db.
std::vector< std::string > prototypes
virtual cyclus::Inventories SnapshotInv()
virtual std::string version()
std::vector< int > cycpp_shape_latitude
virtual void InitFrom(cyclus::QueryableBackend *b)
virtual void InitFrom(cycamore::ManagerInst *m)
ManagerInst(cyclus::Context *ctx)
Default constructor.