CYCAMORE
src/source.h
Go to the documentation of this file.
1 #ifndef CYCAMORE_SRC_SOURCE_H_
2 #define CYCAMORE_SRC_SOURCE_H_
3 
4 #include <set>
5 #include <vector>
6 
7 #include "cyclus.h"
8 #include "cycamore_version.h"
9 
10 namespace cycamore {
11 
12 class Context;
13 
23 class Source : public cyclus::Facility,
24  public cyclus::toolkit::CommodityProducer {
25  friend class SourceTest;
26  public:
27 
28  Source(cyclus::Context* ctx);
29 
30  virtual ~Source();
31 
32  virtual std::string version() { return CYCAMORE_VERSION; }
33 
34  #pragma cyclus note { \
35  "doc": "This facility acts as a source of material with a fixed throughput (per\n" \
36  "time step) capacity and a lifetime capacity defined by a total inventory\n" \
37  "size. It offers its material as a single commodity. If a composition\n" \
38  "recipe is specified, it provides that single material composition to\n" \
39  "requesters. If unspecified, the source provides materials with the exact\n" \
40  "requested compositions. The inventory size and throughput both default to\n" \
41  "infinite. Supplies material results in corresponding decrease in\n" \
42  "inventory, and when the inventory size reaches zero, the source can provide\n" \
43  "no more material.\n" \
44  "", \
45  }
46 
47  #pragma cyclus def clone
48  #pragma cyclus def schema
49  #pragma cyclus def annotations
50  #pragma cyclus def infiletodb
51  #pragma cyclus def snapshot
52  #pragma cyclus def snapshotinv
53  #pragma cyclus def initinv
54 
55  virtual void InitFrom(Source* m);
56 
57  virtual void InitFrom(cyclus::QueryableBackend* b);
58 
59  virtual void Tick() {};
60 
61  virtual void Tock() {};
62 
63  virtual std::string str();
64 
65  virtual std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr>
66  GetMatlBids(cyclus::CommodMap<cyclus::Material>::type&
67  commod_requests);
68 
69  virtual void GetMatlTrades(
70  const std::vector< cyclus::Trade<cyclus::Material> >& trades,
71  std::vector<std::pair<cyclus::Trade<cyclus::Material>,
72  cyclus::Material::Ptr> >& responses);
73 
74  private:
75  #pragma cyclus var { \
76  "tooltip": "source output commodity", \
77  "doc": "Output commodity on which the source offers material.", \
78  "uilabel": "Output Commodity", \
79  "uitype": "outcommodity", \
80  }
82 
83  #pragma cyclus var { \
84  "tooltip": "name of material recipe to provide", \
85  "doc": "Name of composition recipe that this source provides regardless " \
86  "of requested composition. If empty, source creates and provides " \
87  "whatever compositions are requested.", \
88  "uilabel": "Output Recipe", \
89  "default": "", \
90  "uitype": "recipe", \
91  }
93 
94  #pragma cyclus var { \
95  "doc": "Total amount of material this source has remaining." \
96  " Every trade decreases this value by the supplied material " \
97  "quantity. When it reaches zero, the source cannot provide any " \
98  " more material.", \
99  "default": 1e299, \
100  "uitype": "range", \
101  "range": [0.0, 1e299], \
102  "uilabel": "Initial Inventory", \
103  "units": "kg", \
104  }
105  double inventory_size;
106 
107  #pragma cyclus var { \
108  "default": 1e299, \
109  "tooltip": "per time step throughput", \
110  "units": "kg/(time step)", \
111  "uilabel": "Maximum Throughput", \
112  "uitype": "range", \
113  "range": [0.0, 1e299], \
114  "doc": "amount of commodity that can be supplied at each time step", \
115  }
116  double throughput;
117 
118 };
119 
120 } // namespace cycamore
121 
122 #endif // CYCAMORE_SRC_SOURCE_H_
This facility acts as a source of material with a fixed throughput (per time step) capacity and a lif...
virtual std::set< cyclus::BidPortfolio< cyclus::Material >::Ptr > GetMatlBids(cyclus::CommodMap< cyclus::Material >::type &commod_requests)
cycamore::GrowthRegion string
virtual void Tock()
Definition: src/source.h:61
virtual std::string str()
virtual void InitFrom(Source *m)
Source(cyclus::Context *ctx)
virtual std::string version()
Definition: src/source.h:32
virtual void Tick()
Definition: src/source.h:59
virtual void GetMatlTrades(const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)