CYCLUS
region.cc
Go to the documentation of this file.
1 // Implements the Region class
2 #include "region.h"
3 
4 #include <iostream>
5 #include <string>
6 
7 #include "agent.h"
8 #include "error.h"
9 #include "infile_tree.h"
10 #include "institution.h"
11 #include "logger.h"
12 #include "timer.h"
13 
14 namespace cyclus {
15 
17  Agent::InitFrom(m);
18 }
19 
21  kind_ = "Region";
22 }
23 
25  Agent::Build(parent);
26 }
27 
30 }
31 
35 }
36 
38  std::string s = Agent::str();
39 
40  s += " has insts: ";
41  for (std::set<Agent*>::const_iterator inst = children().begin();
42  inst != children().end();
43  inst++) {
44  s += (*inst)->prototype() + ", ";
45  }
46  return s;
47 }
48 
49 } // namespace cyclus
virtual std::string str()
every agent should be able to print a verbose description
Definition: region.cc:37
virtual void Decommission()
Decommissions the agent, removing it from the simulation.
Definition: agent.cc:182
virtual std::string str()
Description of this agent.
Definition: agent.cc:96
virtual void InitFrom(QueryableBackend *b)
Intializes an agent&#39;s internal state from the database.
Definition: region.h:75
The Region class is the abstract class/interface used by all region agents.
Definition: region.h:60
void UnregisterTimeListener(TimeListener *tl)
Removes an agent from receiving tick/tock notifications.
Definition: context.cc:235
virtual void Build(Agent *parent)
perform actions required when entering the simulation
Definition: region.cc:24
virtual void Build(Agent *parent)
Called when the agent enters the smiulation as an active participant and is only ever called once...
Definition: agent.cc:153
Context * context() const
Returns this agent&#39;s simulation context.
Definition: agent.h:369
std::string kind_
describes the agent subclass (e.g.
Definition: agent.h:449
Region(Context *ctx)
Default constructor for Region Class.
Definition: region.cc:20
virtual void EnterNotify()
Called to give the agent an opportunity to register for services (e.g.
Definition: region.cc:28
void RegisterTimeListener(TimeListener *tl)
Registers an agent to receive tick/tock notifications every timestep.
Definition: context.cc:231
Agent * parent() const
Returns parent of this agent. Returns NULL if the agent has no parent.
Definition: agent.h:375
Code providing rudimentary logging capability for the Cyclus core.
A simulation context provides access to necessary simulation-global functions and state...
Definition: context.h:130
The abstract base class used by all types of agents that live and interact in a simulation.
Definition: agent.h:51
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Definition: agent.cc:14
virtual void InitFrom(QueryableBackend *b)
Intializes an agent&#39;s internal state from the database.
Definition: agent.cc:45
virtual void Decommission()
Decommissions the agent, removing it from the simulation.
Definition: region.cc:32
const std::set< Agent * > & children() const
Returns a list of children this agent has.
Definition: agent.h:414
enable_if< has_const_iterator< T >::value, typename T::const_iterator >::type begin(const T &c)