1#ifndef CYCLUS_STORAGES_STORAGE_H_
2#define CYCLUS_STORAGES_STORAGE_H_
11#include "boost/shared_ptr.hpp"
13#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO
67 :
public cyclus::Facility,
68 public cyclus::toolkit::CommodityProducer {
76 #pragma cyclus note {"doc": "Storage is a simple facility which accepts any number of commodities " \
77 "and holds them for a user specified amount of time. The commodities accepted "\
78 "are chosen based on the specified preferences list. Once the desired amount of material "\
79 "has entered the facility it is passed into a 'processing' buffer where it is held until "\
80 "the residence time has passed. The material is then passed into a 'ready' buffer where it is "\
81 "queued for removal. Currently, all input commodities are lumped into a single output commodity. "\
82 "Storage also has the functionality to handle materials in discrete or continuous batches. Discrete "\
83 "mode, which is the default, does not split or combine material batches. Continuous mode, however, "\
84 "divides material batches if necessary in order to push materials through the facility as quickly "\
88 virtual std::string
str();
132 #pragma cyclus var {"tooltip":"input commodity",\
133 "doc":"commodities accepted by this facility",\
134 "uilabel":"Input Commodities",\
135 "uitype":["oneormore","incommodity"]}
138 #pragma cyclus var {"default": [],\
139 "doc":"preferences for each of the given commodities, in the same order."\
140 "Defauts to 1 if unspecified",\
141 "uilabel":"In Commody Preferences", \
142 "range": [None, [CY_NEAR_ZERO, CY_LARGE_DOUBLE]], \
143 "uitype":["oneormore", "range"]}
146 #pragma cyclus var {"tooltip":"output commodity",\
147 "doc":"commodity produced by this facility. Multiple commodity tracking is"\
148 " currently not supported, one output commodity catches all input commodities.",\
149 "uilabel":"Output Commodities",\
150 "uitype":["oneormore","outcommodity"]}
153 #pragma cyclus var {"default":"",\
154 "tooltip":"input recipe",\
155 "doc":"recipe accepted by this facility, if unspecified a dummy recipe is used",\
156 "uilabel":"Input Recipe",\
160 #pragma cyclus var {"default": 0,\
161 "tooltip":"residence time (timesteps)",\
162 "doc":"the minimum holding time for a received commodity (timesteps).",\
163 "units":"time steps",\
164 "uilabel":"Residence Time", \
169 #pragma cyclus var {"default": CY_LARGE_DOUBLE,\
170 "tooltip":"throughput per timestep (kg)",\
171 "doc":"the max amount that can be moved through the facility per timestep (kg)",\
172 "uilabel":"Throughput",\
174 "range": [0.0, CY_LARGE_DOUBLE], \
178 #pragma cyclus var {"default": CY_LARGE_DOUBLE,\
179 "tooltip":"maximum inventory size (kg)",\
180 "doc":"the maximum amount of material that can be in all storage buffer stages",\
181 "uilabel":"Maximum Inventory Size",\
183 "range": [0.0, CY_LARGE_DOUBLE], \
187 #pragma cyclus var {"default": False,\
188 "tooltip":"Bool to determine how Storage handles batches",\
189 "doc":"Determines if Storage will divide resource objects. Only controls material "\
190 "handling within this facility, has no effect on DRE material handling. "\
191 "If true, batches are handled as discrete quanta, neither split nor combined. "\
192 "Otherwise, batches may be divided during processing. Default to false (continuous))",\
193 "uilabel":"Batch Handling"}
196 #pragma cyclus var {"default": "unpackaged", \
197 "tooltip": "Output package", \
198 "doc": "Outgoing material will be packaged when trading.", \
199 "uitype": "package", \
200 "uilabel": "Package"}
203 #pragma cyclus var {"default": "unrestricted", \
204 "tooltip": "Output transport unit", \
205 "doc": "Outgoing material, after packaging, will be "\
206 "further restricted by transport unit when trading.", \
207 "uitype": "transportunit", \
208 "uilabel": "Transport Unit"}
211 #pragma cyclus var {"tooltip":"Incoming material buffer"}
212 cyclus::toolkit::ResBuf<cyclus::Material>
inventory;
214 #pragma cyclus var {"tooltip":"Output material buffer"}
215 cyclus::toolkit::ResBuf<cyclus::Material>
stocks;
217 #pragma cyclus var {"tooltip":"Buffer for material held for required residence_time"}
218 cyclus::toolkit::ResBuf<cyclus::Material>
ready;
221 #pragma cyclus var{"default": [],\
225 #pragma cyclus var {"tooltip":"Buffer for material still waiting for required residence_time"}
226 cyclus::toolkit::ResBuf<cyclus::Material>
processing;
228 #pragma cyclus var {"tooltip": "Total Inventory Tracker to restrict maximum agent inventory"}
235 #include "toolkit/matl_buy_policy.cycpp.h"
236 #include "toolkit/matl_sell_policy.cycpp.h"
237 #include "toolkit/position.cycpp.h"
This Facility is intended to hold materials for a user specified amount of time in order to model a s...
Storage(cyclus::Context *ctx)
void AddMat_(cyclus::Material::Ptr mat)
adds a material into the incoming commodity inventory
std::string transport_unit
double current_capacity()
current maximum amount that can be added to processing
cyclus::toolkit::ResBuf< cyclus::Material > ready
std::vector< double > in_commod_prefs
virtual void Tick()
The handleTick function specific to the Storage.
cyclus::toolkit::ResBuf< cyclus::Material > processing
cyclus::toolkit::TotalInvTracker inventory_tracker
virtual std::string str()
A verbose printer for the Storage Facility.
std::vector< std::string > in_commods
virtual std::string version()
cyclus::toolkit::ResBuf< cyclus::Material > inventory
int ready_time()
returns the time key for ready materials
void ProcessMat_(double cap)
Move as many ready resources as allowable into stocks.
virtual void Tock()
The handleTick function specific to the Storage.
std::vector< std::string > out_commods
std::list< int > entry_times
virtual void EnterNotify()
Sets up the Storage Facility's trade requests.
void ReadyMatl_(int time)
move ready resources from processing to ready at a certain time
void BeginProcessing_()
Move all unprocessed inventory to processing.
cyclus::toolkit::ResBuf< cyclus::Material > stocks
double capacity()
returns total capacity