CYCLUS
Loading...
Searching...
No Matches
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
14namespace cyclus {
15
19
21 kind_ = "Region";
22}
23
24void Region::Build(Agent* parent) {
26}
27
31
36
37std::string Region::str() {
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
The abstract base class used by all types of agents that live and interact in a simulation.
Definition agent.h:49
virtual void InitFrom(QueryableBackend *b)
Intializes an agent's internal state from the database.
Definition agent.cc:45
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's simulation context.
Definition agent.h:367
const std::set< Agent * > & children() const
Returns a list of children this agent has.
Definition agent.h:412
virtual void Decommission()
Decommissions the agent, removing it from the simulation.
Definition agent.cc:182
std::string kind_
describes the agent subclass (e.g.
Definition agent.h:447
Agent * parent() const
Returns parent of this agent. Returns NULL if the agent has no parent.
Definition agent.h:373
virtual std::string str()
Description of this agent.
Definition agent.cc:96
A simulation context provides access to necessary simulation-global functions and state.
Definition context.h:145
void RegisterTimeListener(TimeListener *tl)
Registers an agent to receive tick/tock notifications every timestep.
Definition context.cc:343
void UnregisterTimeListener(TimeListener *tl)
Removes an agent from receiving tick/tock notifications.
Definition context.cc:347
The Region class is the abstract class/interface used by all region agents.
Definition region.h:60
virtual void InitFrom(QueryableBackend *b)
Intializes an agent's internal state from the database.
Definition region.h:75
virtual void EnterNotify()
Called to give the agent an opportunity to register for services (e.g.
Definition region.cc:28
virtual std::string str()
every agent should be able to print a verbose description
Definition region.cc:37
Region(Context *ctx)
Default constructor for Region Class.
Definition region.cc:20
virtual void Build(Agent *parent)
perform actions required when entering the simulation
Definition region.cc:24
virtual void Decommission()
Decommissions the agent, removing it from the simulation.
Definition region.cc:32
Code providing rudimentary logging capability for the Cyclus core.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters