CYCLUS
institution.h
Go to the documentation of this file.
1 #ifndef CYCLUS_SRC_INSTITUTION_H_
2 #define CYCLUS_SRC_INSTITUTION_H_
3 
4 #include <list>
5 #include <map>
6 #include <set>
7 
8 #include "agent.h"
9 #include "region.h"
10 #include "time_listener.h"
11 
12 namespace cyclus {
13 
14 class InfileTree;
15 
16 // Usefull Typedefs
17 typedef std::set<std::string> PrototypeSet;
18 typedef std::set<std::string>::iterator PrototypeIterator;
19 
20 /// The Institution class is the abstract class/interface
21 /// used by all institution agents
22 ///
23 /// @section introduction Introduction The Institution type assists in defining the
24 /// region-institution-facility hierarchy in Cyclus. A Institution institution is
25 /// an actor associated with a set of facilities for which it is responsible. An
26 /// Institution may be used to adjust preferences in the ResourceExchange to make
27 /// material routing decisions based on interfacility relationships. Deployment
28 /// is a primary differentiator between different Institution implementations.
29 class Institution : public Agent, public TimeListener {
30  // --------------------
31  // all MODEL classes have these members
32  // --------------------
33  public:
34  /// Default constructor for Institution Class
35  Institution(Context* ctx);
36 
37  /// every agent should be destructable
38  virtual ~Institution();
39 
40  // DO NOT call Agent class implementation of this method
41  virtual void InfileToDb(InfileTree* qe, DbInit di) {}
42 
43  // DO NOT call Agent class implementation of this method
44  virtual void InitFrom(QueryableBackend* b) {}
45 
46  // DO NOT call Agent class implementation of this method
47  virtual void Snapshot(DbInit di) {}
48 
49  virtual void InitInv(Inventories& inv) {}
50 
51  virtual Inventories SnapshotInv() { return Inventories(); }
52 
53  /// every agent should be able to print a verbose description
54  virtual std::string str();
55 
56  /// perform all tasks required when an inst enters the simulation
57  virtual void Build(Agent* parent);
58 
59  virtual void EnterNotify();
60 
61  virtual void Decommission();
62 
63  virtual void Tick() {}
64 
65  virtual void Tock();
66 
67  protected:
68  void InitFrom(Institution* m);
69 };
70 
71 } // namespace cyclus
72 
73 #endif // CYCLUS_SRC_INSTITUTION_H_
virtual void InitFrom(QueryableBackend *b)
Intializes an agent&#39;s internal state from the database.
Definition: institution.h:44
double b(int nuc)
Computes the scattering length [cm] from the coherent and incoherent components.
Definition: pyne.cc:11180
virtual void Snapshot(DbInit di)
Snapshots agent-internal state to the database via the DbInit var di.
Definition: institution.h:47
Institution(Context *ctx)
Default constructor for Institution Class.
Definition: institution.cc:16
virtual void EnterNotify()
Called to give the agent an opportunity to register for services (e.g.
Definition: institution.cc:39
virtual Inventories SnapshotInv()
Snapshots an agent&#39;s resource inventories to the database.
Definition: institution.h:51
A class for extracting information from a given XML parser.
Definition: infile_tree.h:22
virtual void Decommission()
Decommissions the agent, removing it from the simulation.
Definition: institution.cc:43
virtual void InitInv(Inventories &inv)
Provides an agent&#39;s initial inventory of resources before a simulation begins.
Definition: institution.h:49
virtual ~Institution()
every agent should be destructable
Definition: institution.cc:20
std::map< std::string, std::vector< Resource::Ptr > > Inventories
map<inventory_name, vector<resources_in_inventory> >.
Definition: agent.h:35
virtual void Build(Agent *parent)
perform all tasks required when an inst enters the simulation
Definition: institution.cc:35
virtual std::string str()
every agent should be able to print a verbose description
Definition: institution.cc:27
DbInit provides an interface for agents to record data to the output db that automatically injects th...
Definition: db_init.h:14
virtual void Tock()
Simulation agents do their end-of-timestep activities in the Tock method.
Definition: institution.cc:48
Agent * parent() const
Returns parent of this agent. Returns NULL if the agent has no parent.
Definition: agent.h:375
The TimeListener class is an inheritable class for any Agent that requires knowlege of ticks and tock...
Definition: time_listener.h:23
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 InfileToDb(InfileTree *qe, DbInit di)
Translates info for the agent from an input file to the database by reading parameters from the passe...
Definition: institution.h:41
Interface implemented by backends that support rudimentary querying.
The Institution class is the abstract class/interface used by all institution agents.
Definition: institution.h:29
virtual void Tick()
Simulation agents do their beginning-of-timestep activities in the Tick method.
Definition: institution.h:63
std::set< std::string >::iterator PrototypeIterator
Definition: institution.h:18
std::set< std::string > PrototypeSet
Definition: institution.h:14