1#line 1 "/cycamore/src/manager_inst.cc"
9 : cyclus::Institution(ctx),
26 cyclus::Institution::EnterNotify();
27 std::set<cyclus::Agent*>::iterator sit;
28 for (sit = cyclus::Agent::children().begin();
29 sit != cyclus::Agent::children().end();
35 using cyclus::toolkit::CommodityProducer;
36 std::vector<std::string>::iterator vit;
38 Agent* a = context()->CreateAgent<Agent>(*vit);
39 CommodityProducer* cp_cast =
dynamic_cast<CommodityProducer*
>(a);
40 if (cp_cast != NULL) {
41 LOG(cyclus::LEV_INFO3,
"mani") <<
"Registering prototype "
42 << a->prototype() << a->id()
43 <<
" with the Builder interface.";
44 Builder::Register(cp_cast);
51 using cyclus::toolkit::CommodityProducer;
52 using cyclus::toolkit::CommodityProducerManager;
54 CommodityProducer* cp_cast =
dynamic_cast<CommodityProducer*
>(a);
55 if (cp_cast != NULL) {
56 LOG(cyclus::LEV_INFO3,
"mani") <<
"Registering agent "
57 << a->prototype() << a->id()
58 <<
" as a commodity producer.";
59 CommodityProducerManager::Register(cp_cast);
64 using cyclus::toolkit::CommodityProducer;
65 using cyclus::toolkit::CommodityProducerManager;
67 CommodityProducer* cp_cast =
dynamic_cast<CommodityProducer*
>(a);
69 CommodityProducerManager::Unregister(cp_cast);
74 cyclus::toolkit::CommodityProducer* producer) {
76 set<cyclus::toolkit::Commodity,
77 cyclus::toolkit::CommodityCompare> commodities =
78 producer->ProducedCommodities();
79 set<cyclus::toolkit::Commodity, cyclus::toolkit::CommodityCompare>::
82 LOG(cyclus::LEV_DEBUG3,
"maninst") <<
" Clone produces " << commodities.size()
84 for (it = commodities.begin(); it != commodities.end(); it++) {
85 LOG(cyclus::LEV_DEBUG3,
"maninst") <<
" Commodity produced: " << it->name();
86 LOG(cyclus::LEV_DEBUG3,
"maninst") <<
" capacity: " <<
87 producer->Capacity(*it);
88 LOG(cyclus::LEV_DEBUG3,
"maninst") <<
" cost: " <<
94 std::string specification = this->spec();
96 ->NewDatum(
"AgentPosition")
97 ->AddVal(
"Spec", specification)
98 ->AddVal(
"Prototype", this->prototype())
99 ->AddVal(
"AgentId",
id())
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 void BuildNotify(Agent *m)
register a new child
void Unregister_(cyclus::Agent *agent)
unregister a child
void RecordPosition()
Records an agent's latitude and longitude to the output db.
std::vector< std::string > prototypes
ManagerInst(cyclus::Context *ctx)
Default constructor.
cyclus::Agent * ConstructManagerInst(cyclus::Context *ctx)
cyclus::toolkit::Position coordinates