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
24/// the region-institution-facility hierarchy in Cyclus. A Institution
25/// institution is an actor associated with a set of facilities for which it is
26/// responsible. An Institution may be used to adjust preferences in the
27/// ResourceExchange to make material routing decisions based on interfacility
28/// relationships. Deployment is a primary differentiator between different
29/// Institution implementations.
30class Institution : public Agent, public TimeListener {
31 // --------------------
32 // all MODEL classes have these members
33 // --------------------
34 public:
35 /// Default constructor for Institution Class
36 Institution(Context* ctx);
37
38 /// every agent should be destructable
39 virtual ~Institution();
40
41 // DO NOT call Agent class implementation of this method
42 virtual void InfileToDb(InfileTree* qe, DbInit di) {}
43
44 // DO NOT call Agent class implementation of this method
45 virtual void InitFrom(QueryableBackend* b) {}
46
47 // DO NOT call Agent class implementation of this method
48 virtual void Snapshot(DbInit di) {}
49
50 virtual void InitInv(Inventories& inv) {}
51
52 virtual Inventories SnapshotInv() { return Inventories(); }
53
54 /// every agent should be able to print a verbose description
55 virtual std::string str();
56
57 /// perform all tasks required when an inst enters the simulation
58 virtual void Build(Agent* parent);
59
60 virtual void EnterNotify();
61
62 virtual void Decommission();
63
64 virtual void Tick() {}
65
66 virtual void Tock();
67
68 protected:
69 void InitFrom(Institution* m);
70};
71
72} // namespace cyclus
73
74#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:50
Agent(Context *ctx)
Creates a new agent that is managed by the given context.
Definition agent.cc:58
Agent * parent() const
Returns parent of this agent. Returns NULL if the agent has no parent.
Definition agent.h:370
A simulation context provides access to necessary simulation-global functions and state.
Definition context.h:146
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:30
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:42
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:52
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:48
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:45
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:64
virtual void InitInv(Inventories &inv)
Provides an agent's initial inventory of resources before a simulation begins.
Definition institution.h:50
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:39