1#ifndef CYCAMORE_SRC_SINK_H_
2#define CYCAMORE_SRC_SINK_H_
12#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO
24 :
public cyclus::Facility,
25 public cyclus::toolkit::Position {
27 Sink(cyclus::Context* ctx);
33 #pragma cyclus note { \
35 " A sink facility that accepts materials and products with a fixed\n"\
36 " throughput (per time step) capacity and a lifetime capacity defined by\n"\
37 " a total inventory size. The inventory size and throughput capacity\n"\
38 " both default to infinite. If a recipe is provided, it will request\n"\
39 " material with that recipe. Requests are made for any number of\n"\
40 " specified commodities.\n" \
45 virtual std::string
str();
55 virtual std::set<cyclus::RequestPortfolio<cyclus::Material>::Ptr>
61 virtual std::set<cyclus::RequestPortfolio<cyclus::Product>::Ptr>
66 const std::vector< std::pair<cyclus::Trade<cyclus::Material>,
67 cyclus::Material::Ptr> >& responses);
71 const std::vector< std::pair<cyclus::Trade<cyclus::Product>,
72 cyclus::Product::Ptr> >& responses);
110 inline const std::vector<std::string>&
114 inline const std::vector<double>&
121 #pragma cyclus var {"tooltip": "input commodities", \
122 "doc": "commodities that the sink facility accepts", \
123 "uilabel": "List of Input Commodities", \
124 "uitype": ["oneormore", "incommodity"]}
127 #pragma cyclus var {"default": [],\
128 "doc":"preferences for each of the given commodities, in the same order."\
129 "Defauts to 1 if unspecified",\
130 "uilabel":"In Commody Preferences", \
131 "range": [None, [CY_NEAR_ZERO, CY_LARGE_DOUBLE]], \
132 "uitype":["oneormore", "range"]}
135 #pragma cyclus var {"default": "", \
136 "tooltip": "requested composition", \
137 "doc": "name of recipe to use for material requests, " \
138 "where the default (empty string) is to accept " \
140 "uilabel": "Input Recipe", \
141 "uitype": "inrecipe"}
145 #pragma cyclus var {"default": CY_LARGE_DOUBLE, \
146 "tooltip": "sink maximum inventory size", \
147 "uilabel": "Maximum Inventory", \
149 "range": [0.0, CY_LARGE_DOUBLE], \
150 "doc": "total maximum inventory size of sink facility"}
154 #pragma cyclus var {"default": CY_LARGE_DOUBLE, \
155 "tooltip": "sink capacity", \
156 "uilabel": "Maximum Throughput", \
158 "range": [0.0, CY_LARGE_DOUBLE], \
159 "doc": "capacity the sink facility can " \
160 "accept at each time step"}
164 #pragma cyclus var {'capacity': 'max_inv_size'}
165 cyclus::toolkit::ResBuf<cyclus::Resource>
inventory;
168 #pragma cyclus var {"default": "None", \
169 "tooltip": "type of random behavior when setting the " \
170 "size of the request", \
171 "uitype": "combobox", \
172 "uilabel": "Random Size", \
173 "categorical": ["None", "UniformReal", "UniformInt", "NormalReal", "NormalInt"], \
174 "doc": "type of random behavior to use. Default None, " \
175 "other options are 'UniformReal', 'UniformInt', " \
176 "'NormalReal', and 'NormalInt'"}
180 #pragma cyclus var {"default": 1.0, \
181 "tooltip": "fraction of available space to determine the mean", \
182 "uilabel": "Random Size Mean", \
184 "range": [0.0, CY_LARGE_DOUBLE], \
185 "doc": "When a normal distribution is used to determine the " \
186 "size of the request, this is the fraction of available " \
187 "space to use as the mean. Default 1.0. Note " \
188 "that values significantly above 1 without a " \
189 "correspondingly large std dev may result in " \
190 "inefficient use of the random number generator."}
194 #pragma cyclus var {"default": 0.1, \
195 "tooltip": "fraction of available space to determine the std dev", \
196 "uilabel": "Random Size Std Dev", \
198 "range": [0.0, CY_LARGE_DOUBLE], \
199 "doc": "When a normal distribution is used to determine the " \
200 "size of the request, this is the fraction of available " \
201 "space to use as the standard deviation. Default 0.1"}
205 #pragma cyclus var {"default": "None", \
206 "tooltip": "type of random behavior when setting the " \
207 "timing of the request", \
208 "uitype": "combobox", \
209 "uilabel": "Random Timing", \
210 "categorical": ["None", "UniformInt", "NormalInt"], \
211 "doc": "type of random behavior to use. Default None, " \
212 "other options are, 'UniformInt', and 'NormalInt'. " \
213 "When using 'UniformInt', also set "\
214 "'random_frequency_min' and 'random_frequency_max'. " \
215 "For 'NormalInt', set 'random_frequency_mean' and " \
216 "'random_fequency_stddev', min and max values are " \
221 #pragma cyclus var {"default": 1, \
222 "tooltip": "mean of the random frequency", \
223 "uilabel": "Random Frequency Mean", \
225 "range": [0.0, CY_LARGE_DOUBLE], \
226 "doc": "When a normal distribution is used to determine the " \
227 "frequency of the request, this is the mean. Default 1"}
231 #pragma cyclus var {"default": 1, \
232 "tooltip": "std dev of the random frequency", \
233 "uilabel": "Random Frequency Std Dev", \
235 "range": [0.0, CY_LARGE_DOUBLE], \
236 "doc": "When a normal distribution is used to determine the " \
237 "frequency of the request, this is the standard deviation. Default 1"}
241 #pragma cyclus var {"default": 1, \
242 "tooltip": "lower bound of the random frequency", \
243 "uilabel": "Random Frequency Lower Bound", \
245 "range": [1, CY_LARGE_INT], \
246 "doc": "When a random distribution is used to determine the " \
247 "frequency of the request, this is the lower bound. Default 1"}
251 #pragma cyclus var {"default": CY_LARGE_INT, \
252 "tooltip": "upper bound of the random frequency", \
253 "uilabel": "Random Frequency Upper Bound", \
255 "range": [1, CY_LARGE_INT], \
256 "doc": "When a random distribution is used to determine the " \
257 f"frequency of the request, this is the upper bound. Default {CY_LARGE_INT} (CY_LARGE_INT)"}
260 #pragma cyclus var { \
262 "tooltip": "Whether to persist packaging in the sink.", \
263 "doc": "Boolean value about whether to keep packaging. If true, " \
264 "packaging will not be stripped upon acceptance into the " \
265 "sink. If false, package type will be stripped immediately " \
266 "upon acceptance. Has no effect if the incoming material is not " \
268 "uilabel": "Keep Packaging", \
272 #pragma cyclus var { \
274 "uilabel": "Geographical latitude in degrees as a double", \
275 "doc": "Latitude of the agent's geographical position. The value should " \
276 "be expressed in degrees as a double." \
280 #pragma cyclus var { \
282 "uilabel": "Geographical longitude in degrees as a double", \
283 "doc": "Longitude of the agent's geographical position. The value should " \
284 "be expressed in degrees as a double." \
This facility acts as a sink of materials and products with a fixed throughput (per time step) capaci...
virtual std::set< cyclus::RequestPortfolio< cyclus::Product >::Ptr > GetGenRsrcRequests()
SinkFacilities request Products of their given commodity.
cyclus::toolkit::ResBuf< cyclus::Resource > inventory
this facility holds material in storage.
Sink(cyclus::Context *ctx)
std::vector< std::string > in_commods
all facilities must have at least one input commodity
double random_size_stddev
std::vector< double > in_commod_prefs
std::string random_frequency_type
virtual void AcceptGenRsrcTrades(const std::vector< std::pair< cyclus::Trade< cyclus::Product >, cyclus::Product::Ptr > > &responses)
SinkFacilities place accepted trade Materials in their Inventory.
virtual void SetRequestAmt()
SinkFacilities update request amount using random behavior.
double random_frequency_stddev
const std::vector< double > & input_commodity_preferences() const
void SetMaxInventorySize(double size)
sets the size of the storage inventory for received material
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > GetMatlRequests()
SinkFacilities request Materials of their given commodity.
std::string random_size_type
random status (size of request)
double capacity
monthly acceptance capacity
double SpaceAvailable() const
determines the amount to request
virtual void SetNextBuyTime()
SinkFacilities update request time using random behavior.
double InventorySize() const
double max_inv_size
max inventory size
virtual void AcceptMatlTrades(const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
SinkFacilities place accepted trade Materials in their Inventory.
virtual void EnterNotify()
virtual std::string version()
virtual std::string str()
double MaxInventorySize() const
const std::vector< std::string > & input_commodities() const
void AddCommodity(std::string name)
add a commodity to the set of input commodities
void Capacity(double cap)
sets the capacity of a material generated at any given time step
double random_frequency_mean
cyclus::toolkit::Position coordinates