Skip to content

Commit

Permalink
storage inits sell pol with package
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearkatie committed May 13, 2024
1 parent 89d4652 commit 669574f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ void Storage::EnterNotify() {
}
buy_policy.Start();

int package_id_ = context()->GetPackageByName(package)->id();
if (out_commods.size() == 1) {
sell_policy.Init(this, &stocks, std::string("stocks"), 1e+299, false, sell_quantity)
sell_policy.Init(this, &stocks, std::string("stocks"), 1e+299, false, sell_quantity, package_id_)
.Set(out_commods.front())
.Start();

Expand Down
8 changes: 8 additions & 0 deletions src/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ namespace cycamore {
/// buying_size_max is the maximum size of the buy request if buying_size_type is Uniform (required) or Normal (optional)
/// buying_size_mean is the mean size of the buy request if buying_size_type is Normal
/// buying_size_stddev is the standard deviation of the buy request if buying_size_type is Normal
/// package is the name of the package type to ship
///
/// @section detailed Detailed Behavior
///
Expand Down Expand Up @@ -429,6 +430,13 @@ class Storage
"uilabel": "Cumulative Cap"}
double cumulative_cap;

#pragma cyclus var {"default": "unpackaged", \
"tooltip": "Output package", \
"doc": "Outgoing material will be packaged when trading.", \
"uitype": "package", \
"uilabel": "Package"}
std::string package;

#pragma cyclus var {"tooltip":"Incoming material buffer"}
cyclus::toolkit::ResBuf<cyclus::Material> inventory;

Expand Down

0 comments on commit 669574f

Please sign in to comment.