Skip to content

Commit

Permalink
prevent underflow when not enough material is available to make a pac…
Browse files Browse the repository at this point in the history
…kagable bid
  • Loading branch information
nuclearkatie committed Aug 16, 2024
1 parent dce0237 commit c5d8732
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Since last release

**Added:**
* Added package parameter to storage (#603, #612, #616)
* Added package parameter to source (#613, #617)
* Added package parameter to source (#613, #617, #621)
* Added default keep packaging to reactor (#618, #619)

**Changed:**
Expand Down
5 changes: 4 additions & 1 deletion src/source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr> Source::GetMatlBids(

// calculate packaging
double bid_qty = context()->GetPackage(package)->GetFillMass(qty);
int n_full_bids = static_cast<int>(std::floor(qty / bid_qty));
int n_full_bids = 0;
if (bid_qty >= context()->GetPackage(package)->fill_min()) {
n_full_bids = static_cast<int>(std::floor(qty / bid_qty));
}
Package::ExceedsSplitLimits(n_full_bids);

std::vector<double> bids;
Expand Down

0 comments on commit c5d8732

Please sign in to comment.