Go to the documentation of this file.
4 #include <string>
5 #include <vector>
6 #include <set>
8 #include "agent.h"
9 #include "time_listener.h"
10 #include "trader.h"
12 namespace cyclus {
14 // forward declare Material class to avoid full inclusion and dependency
15 class Material;
16 class Institution;
18 /// @class Facility
19 /// The Facility class is the abstract class/interface used by all
20 /// facility agents
21 ///
22 /// This is all that is known externally about facilities
23 ///
24 /// @section intro Introduction
25 ///
26 /// The Facility type plays a primary role in Cyclus. A Facility
27 /// facility is where offers and requests are generated and transmitted to a
28 /// ResourceExchange and where shipments of material, issued by the exchange, are
29 /// executed. The algorithms to determine what offers and requests are issued and
30 /// how material shipments are handled are the primary differentiators between
31 /// different Facility implementations.
32 ///
33 /// Like all agent implementations, there are a number of implementations that
34 /// are distributed as part of the core Cyclus application as well as
35 /// implementations contributed by third-party developers. The links below
36 /// describe additional parameters necessary for the complete definition of a
37 /// facility of that implementation.
38 ///
39 /// @section available Available Core Implementations
40 ///
41 /// - SourceFacility: A facility that can produce a constant (or
42 /// infinite) amount of some commodity
43 /// - SinkFacility: A facility that can consume a constant (or infinite)
44 /// amount of some commodity
45 /// - NullFacility: A facility that consumes a constant amount of one
46 /// commodity and produces a constant amount of another
47 ///
48 ///
49 /// @section anticipated Anticipated Core Implementations
50 ///
51 /// Developers are encouraged to add to this list and create pages that
52 /// describe the detailed behavior of these agents.
53 ///
54 /// - RecipeReactor: A facility that consumes a fixed fresh fuel recipe
55 /// one a time scale governed by reactor cycle lengths and batch sizes,
56 /// and produced a fixed/corresponding spent fuel recipe at the same
57 /// frequency - SeparationsMatrixFacility: A facility that consumes a
58 /// fixed quantity of material of one commodity and produces many
59 /// different output streams with the input nuclides distributed across
60 /// those output streams according to a fixed matrix
61 /// - EnrichmentFacility: A facility that offers a fixed quantity of SWUs
62 /// to accomplish enrichment of material
63 ///
64 /// @section thirdparty Third-party Implementations
65 ///
66 /// Collaborators are encouraged to add to this list and link to external
67 /// pages that describe how to get the agents and the detailed behavior
68 class Facility : public TimeListener, public Agent, public Trader {
69  public:
70  Facility(Context* ctx);
72  virtual ~Facility();
74  // DO NOT call Agent class implementation of this method
75  virtual void InfileToDb(InfileTree* qe, DbInit di) {}
77  // DO NOT call Agent class implementation of this method
78  virtual void InitFrom(QueryableBackend* b) {}
80  // DO NOT call Agent class implementation of this method
81  virtual void Snapshot(DbInit di) {}
83  /// Copy module members from a source agent
84  /// Any facility subclassing facility agent should invoke their own InitFrom
85  /// method, calling Facility's first!
86  /// @param m the agent to copy from
87  void InitFrom(Facility* m);
89  /// @brief builds the facility in the simulation
90  /// @param parent the parent of this facility
91  virtual void Build(Agent* parent);
93  virtual void EnterNotify();
95  /// decommissions the facility, default behavior is for the facility
96  /// to delete itself
97  virtual void Decommission();
99  /// facilities over write this method if a condition must be met
100  /// before their destructors can be called
101  virtual bool CheckDecommissionCondition();
103  /// every agent should be able to print a verbose description
104  virtual std::string str();
105 };
107 } // namespace cyclus
109 #endif // CYCLUS_SRC_FACILITY_H_
double b(int nuc)
Computes the scattering length [cm] from the coherent and incoherent components.
virtual std::string str()
every agent should be able to print a verbose description
A class for extracting information from a given XML parser.
Definition: infile_tree.h:22
virtual void Decommission()
decommissions the facility, default behavior is for the facility to delete itself ...
virtual ~Facility()
A simple API for agents that wish to exchange resources in the simulation.
Definition: trader.h:24
virtual bool CheckDecommissionCondition()
facilities over write this method if a condition must be met before their destructors can be called ...
virtual void EnterNotify()
Called to give the agent an opportunity to register for services (e.g.
The Facility class is the abstract class/interface used by all facility agents.
Definition: facility.h:68
DbInit provides an interface for agents to record data to the output db that automatically injects th...
Definition: db_init.h: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: facility.h:75
The TimeListener class is an inheritable class for any Agent that requires knowlege of ticks and tock...
Definition: time_listener.h:23
Facility(Context *ctx)
A simulation context provides access to necessary simulation-global functions and state...
Definition: context.h:128
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
Agent * parent() const
Returns parent of this agent. Returns NULL if the agent has no parent.
Definition: agent.h:375
virtual void InitFrom(QueryableBackend *b)
Intializes an agent&#39;s internal state from the database.
Definition: facility.h:78
Interface implemented by backends that support rudimentary querying.
virtual void Build(Agent *parent)
builds the facility in the simulation
virtual void Snapshot(DbInit di)
Snapshots agent-internal state to the database via the DbInit var di.
Definition: facility.h:81