diff --git a/src/storage.cc b/src/storage.cc index 418fdf171..1c92e2096 100644 --- a/src/storage.cc +++ b/src/storage.cc @@ -75,9 +75,10 @@ void Storage::EnterNotify() { buy_policy.Start(); if (out_commods.size() == 1) { - sell_policy.Init(this, &stocks, std::string("stocks")) - .Set(out_commods.front()) - .Start(); + sell_policy.Init(this, &stocks, std::string("stocks"), 1e+299, false, sell_quantity) + .Set(out_commods.front()) + .Start(); + } else { std::stringstream ss; ss << "out_commods has " << out_commods.size() << " values, expected 1."; diff --git a/src/storage.h b/src/storage.h index 7282acce2..e360193b3 100644 --- a/src/storage.h +++ b/src/storage.h @@ -32,6 +32,7 @@ namespace cycamore { /// in_recipe (optional) describes the incoming resource by recipe /// /// @section optionalparams Optional Parameters +/// sell_quantity restricts selling to only integer multiples of this value /// max_inv_size is the maximum capacity of the inventory storage /// throughput is the maximum processing capacity per timestep /// @@ -162,6 +163,17 @@ class Storage "range": [0, 12000]} int residence_time; + #pragma cyclus var {"default": 0,\ + "tooltip":"sell quantity (kg)",\ + "doc":"material will be sold in integer multiples of this quantity. If"\ + " the buffer contains less than the sell quantity, no material will be"\ + " offered", \ + "uilabel":"Sell Quantity",\ + "uitype": "range", \ + "range": [0.0, 1e299], \ + "units": "kg"} + double sell_quantity; + #pragma cyclus var {"default": 1e299,\ "tooltip":"throughput per timestep (kg)",\ "doc":"the max amount that can be moved through the facility per timestep (kg)",\