CYCLUS
Loading...
Searching...
No Matches
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
12namespace cyclus {
13
14class InfileTree;
15
16// Usefull Typedefs
17typedef std::set<std::string> PrototypeSet;
18typedef 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.
29class 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_
The abstract base class used by all types of agents that live and interact in a simulation.
Definition agent.h:49
Agent * parent() const
Returns parent of this agent. Returns NULL if the agent has no parent.
Definition agent.h:373
A simulation context provides access to necessary simulation-global functions and state.
Definition context.h:145
DbInit provides an interface for agents to record data to the output db that automatically injects th...
Definition db_init.h:14
A class for extracting information from a given XML parser.
Definition infile_tree.h:22
The Institution class is the abstract class/interface used by all institution agents.
Definition institution.h:29
virtual ~Institution()
every agent should be destructable
virtual void Decommission()
Decommissions the agent, removing it from the simulation.
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
virtual std::string str()
every agent should be able to print a verbose description
virtual Inventories SnapshotInv()
Snapshots an agent's resource inventories to the database.
Definition institution.h:51
virtual void EnterNotify()
Called to give the agent an opportunity to register for services (e.g.
virtual void Snapshot(DbInit di)
Snapshots agent-internal state to the database via the DbInit var di.
Definition institution.h:47
virtual void Build(Agent *parent)
perform all tasks required when an inst enters the simulation
virtual void InitFrom(QueryableBackend *b)
Intializes an agent's internal state from the database.
Definition institution.h:44
Institution(Context *ctx)
Default constructor for Institution Class.
virtual void Tock()
Simulation agents do their end-of-timestep activities in the Tock method.
virtual void Tick()
Simulation agents do their beginning-of-timestep activities in the Tick method.
Definition institution.h:63
virtual void InitInv(Inventories &inv)
Provides an agent's initial inventory of resources before a simulation begins.
Definition institution.h:49
Interface implemented by backends that support rudimentary querying.
The TimeListener class is an inheritable class for any Agent that requires knowlege of ticks and tock...
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
std::set< std::string > PrototypeSet
Definition institution.h:17
std::set< std::string >::iterator PrototypeIterator
Definition institution.h:18
std::map< std::string, std::vector< Resource::Ptr > > Inventories
map<inventory_name, vector<resources_in_inventory> >.
Definition agent.h:38
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters