8 : cyclus::Institution(ctx),
14ManagerInst::~ManagerInst() {}
16void ManagerInst::BuildNotify(Agent* a) {
20void ManagerInst::DecomNotify(Agent* a) {
24void ManagerInst::EnterNotify() {
25 cyclus::Institution::EnterNotify();
26 std::set<cyclus::Agent*>::iterator sit;
27 for (sit = cyclus::Agent::children().begin();
28 sit != cyclus::Agent::children().end();
34 using cyclus::toolkit::CommodityProducer;
35 std::vector<std::string>::iterator vit;
36 for (vit = prototypes.begin(); vit != prototypes.end(); ++vit) {
37 Agent* a = context()->CreateAgent<Agent>(*vit);
38 CommodityProducer* cp_cast =
dynamic_cast<CommodityProducer*
>(a);
39 if (cp_cast != NULL) {
40 LOG(cyclus::LEV_INFO3,
"mani") <<
"Registering prototype "
41 << a->prototype() << a->id()
42 <<
" with the Builder interface.";
43 Builder::Register(cp_cast);
49void ManagerInst::Register_(Agent* a) {
50 using cyclus::toolkit::CommodityProducer;
51 using cyclus::toolkit::CommodityProducerManager;
53 CommodityProducer* cp_cast =
dynamic_cast<CommodityProducer*
>(a);
54 if (cp_cast != NULL) {
55 LOG(cyclus::LEV_INFO3,
"mani") <<
"Registering agent "
56 << a->prototype() << a->id()
57 <<
" as a commodity producer.";
58 CommodityProducerManager::Register(cp_cast);
62void ManagerInst::Unregister_(Agent* a) {
63 using cyclus::toolkit::CommodityProducer;
64 using cyclus::toolkit::CommodityProducerManager;
66 CommodityProducer* cp_cast =
dynamic_cast<CommodityProducer*
>(a);
68 CommodityProducerManager::Unregister(cp_cast);
72void ManagerInst::WriteProducerInformation(
73 cyclus::toolkit::CommodityProducer* producer) {
75 set<cyclus::toolkit::Commodity,
76 cyclus::toolkit::CommodityCompare> commodities =
77 producer->ProducedCommodities();
78 set<cyclus::toolkit::Commodity, cyclus::toolkit::CommodityCompare>::
81 LOG(cyclus::LEV_DEBUG3,
"maninst") <<
" Clone produces " << commodities.size()
83 for (it = commodities.begin(); it != commodities.end(); it++) {
84 LOG(cyclus::LEV_DEBUG3,
"maninst") <<
" Commodity produced: " << it->name();
85 LOG(cyclus::LEV_DEBUG3,
"maninst") <<
" capacity: " <<
86 producer->Capacity(*it);
87 LOG(cyclus::LEV_DEBUG3,
"maninst") <<
" cost: " <<
92void ManagerInst::RecordPosition() {
93 std::string specification = this->spec();
95 ->NewDatum(
"AgentPosition")
96 ->AddVal(
"Spec", specification)
97 ->AddVal(
"Prototype", this->prototype())
98 ->AddVal(
"AgentId",
id())
99 ->AddVal(
"Latitude", latitude)
100 ->AddVal(
"Longitude", longitude)
106 return new ManagerInst(ctx);
ManagerInst(cyclus::Context *ctx)
Default constructor.
void RecordPosition()
Records an agent's latitude and longitude to the output db.
cyclus::Agent * ConstructManagerInst(cyclus::Context *ctx)
void Unregister_(cyclus::Agent *agent)
unregister a child
void Register_(cyclus::Agent *agent)
register a child
cyclus::toolkit::Position coordinates