CYCAMORE
Loading...
Searching...
No Matches
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#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO
11
12namespace cycamore {
13
14class Context;
15
25class Source : public cyclus::Facility,
26 public cyclus::toolkit::CommodityProducer,
27 public cyclus::toolkit::Position {
28 friend class SourceTest;
29 public:
30
31 Source(cyclus::Context* ctx);
32
33 virtual ~Source();
34
35 virtual std::string version() { return CYCAMORE_VERSION; }
36
37 #pragma cyclus note { \
38 "doc": "This facility acts as a source of material with a fixed throughput (per\n" \
39 "time step) capacity and a lifetime capacity defined by a total inventory\n" \
40 "size. It offers its material as a single commodity. If a composition\n" \
41 "recipe is specified, it provides that single material composition to\n" \
42 "requesters. If unspecified, the source provides materials with the exact\n" \
43 "requested compositions. The inventory size and throughput both default to\n" \
44 "infinite. Supplies material results in corresponding decrease in\n" \
45 "inventory, and when the inventory size reaches zero, the source can provide\n" \
46 "no more material.\n" \
47 "", \
48 }
49
50 #pragma cyclus def clone
51 #pragma cyclus def schema
52 #pragma cyclus def annotations
53 #pragma cyclus def infiletodb
54 #pragma cyclus def snapshot
55 #pragma cyclus def snapshotinv
56 #pragma cyclus def initinv
57
58 virtual void InitFrom(Source* m);
59
60 virtual void InitFrom(cyclus::QueryableBackend* b);
61
62 virtual void Tick() {};
63
64 virtual void Tock() {};
65
66 virtual std::string str();
67
68 virtual std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr>
69 GetMatlBids(cyclus::CommodMap<cyclus::Material>::type&
70 commod_requests);
71
72 virtual void EnterNotify();
73
76 virtual void Build(cyclus::Agent* parent);
77
78 virtual void GetMatlTrades(
79 const std::vector< cyclus::Trade<cyclus::Material> >& trades,
80 std::vector<std::pair<cyclus::Trade<cyclus::Material>,
81 cyclus::Material::Ptr> >& responses);
82
83 private:
84 #pragma cyclus var { \
85 "tooltip": "source output commodity", \
86 "doc": "Output commodity on which the source offers material.", \
87 "uilabel": "Output Commodity", \
88 "uitype": "outcommodity", \
89 }
90 std::string outcommod;
91
92 #pragma cyclus var { \
93 "tooltip": "name of material recipe to provide", \
94 "doc": "Name of composition recipe that this source provides regardless " \
95 "of requested composition. If empty, source creates and provides " \
96 "whatever compositions are requested.", \
97 "uilabel": "Output Recipe", \
98 "default": "", \
99 "uitype": "outrecipe", \
100 }
101 std::string outrecipe;
102
103 #pragma cyclus var { \
104 "doc": "Total amount of material this source has remaining." \
105 " Every trade decreases this value by the supplied material " \
106 "quantity. When it reaches zero, the source cannot provide any " \
107 " more material.", \
108 "default": CY_LARGE_DOUBLE, \
109 "uitype": "range", \
110 "range": [0.0, CY_LARGE_DOUBLE], \
111 "uilabel": "Initial Inventory", \
112 "units": "kg", \
113 }
114 double inventory_size;
115
116 #pragma cyclus var { \
117 "default": CY_LARGE_DOUBLE, \
118 "tooltip": "per time step throughput", \
119 "units": "kg/(time step)", \
120 "uilabel": "Maximum Throughput", \
121 "uitype": "range", \
122 "range": [0.0, CY_LARGE_DOUBLE], \
123 "doc": "amount of commodity that can be supplied at each time step", \
124 }
125 double throughput;
126
127 #pragma cyclus var { \
128 "default": "unpackaged", \
129 "tooltip": "name of package to provide material in", \
130 "doc": "Name of package that this source provides. Offers will only be" \
131 "made in packagable quantities of material.", \
132 "uilabel": "Output Package Type", \
133 "uitype": "package", \
134 }
135 std::string package;
136
137 #pragma cyclus var { \
138 "default": "unrestricted", \
139 "tooltip": "name of transport unit to ship packages in", \
140 "doc": "Name of transport unit that this source uses to ship packages of " \
141 "material. Offers will only be made in shippable quantities of " \
142 "packages. Optional if packaging is used, but use of transport " \
143 "units requires packaging type to also be set", \
144 "uilabel": "Output Transport Unit Type", \
145 "uitype": "transportunit", \
146 }
147 std::string transport_unit;
148
149 #pragma cyclus var { \
150 "default": 0.0, \
151 "uilabel": "Geographical latitude in degrees as a double", \
152 "doc": "Latitude of the agent's geographical position. The value should " \
153 "be expressed in degrees as a double." \
154 }
155 double latitude;
156
157 #pragma cyclus var { \
158 "default": 0.0, \
159 "uilabel": "Geographical longitude in degrees as a double", \
160 "doc": "Longitude of the agent's geographical position. The value should " \
161 "be expressed in degrees as a double." \
162 }
163 double longitude;
164
165 #pragma cyclus var { \
166 "tooltip":"Material buffer"}
167 cyclus::toolkit::ResBuf<cyclus::Material> inventory;
168
169 cyclus::toolkit::Position coordinates;
170
173};
174
175} // namespace cycamore
176
177#endif // CYCAMORE_SRC_SOURCE_H_
#define CYCAMORE_VERSION
This facility acts as a source of material with a fixed throughput (per time step) capacity and a lif...
virtual void InitFrom(Source *m)
virtual std::string version()
Definition src/source.h:35
virtual void Tick()
Definition src/source.h:62
virtual void EnterNotify()
virtual std::set< cyclus::BidPortfolio< cyclus::Material >::Ptr > GetMatlBids(cyclus::CommodMap< cyclus::Material >::type &commod_requests)
virtual void GetMatlTrades(const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
virtual void Build(cyclus::Agent *parent)
— Facility Members — perform module-specific tasks when entering the simulation
cyclus::toolkit::Position coordinates
Source(cyclus::Context *ctx)
cyclus::toolkit::ResBuf< cyclus::Material > inventory
virtual ~Source()
virtual void InitFrom(cyclus::QueryableBackend *b)
virtual std::string str()
virtual void Tock()
Definition src/source.h:64