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  public cyclus::toolkit::Position {
26  friend class SourceTest;
27  public:
28 
29  Source(cyclus::Context* ctx);
30 
31  virtual ~Source();
32 
33  virtual std::string version() { return CYCAMORE_VERSION; }
34 
35  #pragma cyclus note { \
36  "doc": "This facility acts as a source of material with a fixed throughput (per\n" \
37  "time step) capacity and a lifetime capacity defined by a total inventory\n" \
38  "size. It offers its material as a single commodity. If a composition\n" \
39  "recipe is specified, it provides that single material composition to\n" \
40  "requesters. If unspecified, the source provides materials with the exact\n" \
41  "requested compositions. The inventory size and throughput both default to\n" \
42  "infinite. Supplies material results in corresponding decrease in\n" \
43  "inventory, and when the inventory size reaches zero, the source can provide\n" \
44  "no more material.\n" \
45  "", \
46  }
47 
48  #pragma cyclus def clone
49  #pragma cyclus def schema
50  #pragma cyclus def annotations
51  #pragma cyclus def infiletodb
52  #pragma cyclus def snapshot
53  #pragma cyclus def snapshotinv
54  #pragma cyclus def initinv
55 
56  virtual void InitFrom(Source* m);
57 
58  virtual void InitFrom(cyclus::QueryableBackend* b);
59 
60  virtual void Tick() {};
61 
62  virtual void Tock() {};
63 
64  virtual std::string str();
65 
66  virtual std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr>
67  GetMatlBids(cyclus::CommodMap<cyclus::Material>::type&
68  commod_requests);
69 
70  virtual void GetMatlTrades(
71  const std::vector< cyclus::Trade<cyclus::Material> >& trades,
72  std::vector<std::pair<cyclus::Trade<cyclus::Material>,
73  cyclus::Material::Ptr> >& responses);
74 
75  private:
76  #pragma cyclus var { \
77  "tooltip": "source output commodity", \
78  "doc": "Output commodity on which the source offers material.", \
79  "uilabel": "Output Commodity", \
80  "uitype": "outcommodity", \
81  }
83 
84  #pragma cyclus var { \
85  "tooltip": "name of material recipe to provide", \
86  "doc": "Name of composition recipe that this source provides regardless " \
87  "of requested composition. If empty, source creates and provides " \
88  "whatever compositions are requested.", \
89  "uilabel": "Output Recipe", \
90  "default": "", \
91  "uitype": "outrecipe", \
92  }
94 
95  #pragma cyclus var { \
96  "doc": "Total amount of material this source has remaining." \
97  " Every trade decreases this value by the supplied material " \
98  "quantity. When it reaches zero, the source cannot provide any " \
99  " more material.", \
100  "default": 1e299, \
101  "uitype": "range", \
102  "range": [0.0, 1e299], \
103  "uilabel": "Initial Inventory", \
104  "units": "kg", \
105  }
106  double inventory_size;
107 
108  #pragma cyclus var { \
109  "default": 1e299, \
110  "tooltip": "per time step throughput", \
111  "units": "kg/(time step)", \
112  "uilabel": "Maximum Throughput", \
113  "uitype": "range", \
114  "range": [0.0, 1e299], \
115  "doc": "amount of commodity that can be supplied at each time step", \
116  }
117  double throughput;
118 
119  #pragma cyclus var { \
120  "default": 0.0, \
121  "uilabel": "Geographical latitude in degrees as a double", \
122  "doc": "Latitude of the agent's geographical position. The value should " \
123  "be expressed in degrees as a double." \
124  }
125  double latitude;
126 
127  #pragma cyclus var { \
128  "default": 0.0, \
129  "uilabel": "Geographical longitude in degrees as a double", \
130  "doc": "Longitude of the agent's geographical position. The value should " \
131  "be expressed in degrees as a double." \
132  }
133  double longitude;
134 
135  cyclus::toolkit::Position coordinates;
136 
137  void RecordPosition();
138 };
139 
140 } // namespace cycamore
141 
142 #endif // CYCAMORE_SRC_SOURCE_H_
This facility acts as a source of material with a fixed throughput (per time step) capacity and a lif...
cyclus::toolkit::Position coordinates
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:62
virtual std::string str()
virtual void InitFrom(Source *m)
Source(cyclus::Context *ctx)
virtual std::string version()
Definition: src/source.h:33
virtual void Tick()
Definition: src/source.h:60
virtual void GetMatlTrades(const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)