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 " <a:documentation>Latitude of the agent's geographical position. The value should be expressed in degrees as a double.</a:documentation>\n"
128 " <data type=\"double\"/>\n"
132 " <element name=\"longitude\">\n"
133 " <a:documentation>Longitude of the agent's geographical position. The value should be expressed in degrees as a double.</a:documentation>\n"
134 " <data type=\"double\"/>\n"
143 bool parsed_ok = reader.parse(
144 "{\"name\":\"cycamore::ManagerInst\",\"entity\":\"institut"
145 "ion\",\"parents\":[\"cyclus::Institution\",\"cyclus::too"
146 "lkit::Builder\",\"cyclus::toolkit::CommodityProducer"
147 "Manager\",\"cyclus::toolkit::Position\"],\"all_parents"
148 "\":[\"EconomicEntity\",\"cyclus::Agent\",\"cyclus::Ider\""
149 ",\"cyclus::Institution\",\"cyclus::StateWrangler\",\"cy"
150 "clus::TimeListener\",\"cyclus::toolkit::AgentManaged"
151 "\",\"cyclus::toolkit::Builder\",\"cyclus::toolkit::Com"
152 "modityProducerManager\",\"cyclus::toolkit::Position\""
153 "],\"vars\":{\"prototypes\":{\"tooltip\":[\"producer "
154 "facility prototypes\",\"\"],\"uilabel\":[\"Producer "
155 "Prototype List\",\"\"],\"uitype\":[\"oneormore\",\"prototy"
156 "pe\"],\"doc\":\"A set of facility prototypes that this"
157 " institution can build. All prototypes in this "
158 "list must be based on an archetype that implements"
159 " the cyclus::toolkit::CommodityProducer interface\""
160 ",\"type\":[\"std::vector\",\"std::string\"],\"index\":0,\"s"
162 "1],\"alias\":[\"prototypes\",\"val\"]},\"latitude\":{\"defa"
163 "ult\":0.0,\"uilabel\":\"Geographical latitude in "
164 "degrees as a double\",\"doc\":\"Latitude of the "
165 "agent's geographical position. The value should be"
166 " expressed in degrees as a double.\",\"type\":\"double"
167 "\",\"index\":1,\"shape\":[-"
168 "1],\"alias\":\"latitude\",\"tooltip\":\"latitude\"},\"longi"
169 "tude\":{\"default\":0.0,\"uilabel\":\"Geographical "
170 "longitude in degrees as a double\",\"doc\":\"Longitude"
171 " of the agent's geographical position. The value "
172 "should be expressed in degrees as a double.\",\"type"
173 "\":\"double\",\"index\":2,\"shape\":[-"
174 "1],\"alias\":\"longitude\",\"tooltip\":\"longitude\"}},\"do"
175 "c\":\"An institution that owns and operates a "
176 "manually entered list of facilities in the input "
179 throw cyclus::ValueError(
"failed to parse annotations for cycamore::ManagerInst.");
184 virtual void InitInv(cyclus::Inventories& inv) {
188 cyclus::Inventories invs;
200 #pragma cyclus note {"doc": "An institution that owns and operates a " "manually entered list of facilities in " "the input file"}
201#line 32 "/cycamore/src/manager_inst.h"
224 #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", }
225#line 62 "/cycamore/src/manager_inst.h"
228#line 63 "/cycamore/src/manager_inst.h"
231 #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." }
232#line 70 "/cycamore/src/manager_inst.h"
235#line 71 "/cycamore/src/manager_inst.h"
238 #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." }
239#line 78 "/cycamore/src/manager_inst.h"
243#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.