Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Wilson <[email protected]>
Signed-off-by: Katie Mummah <[email protected]>
  • Loading branch information
nuclearkatie and gonuke authored Sep 30, 2024
1 parent ec5e8af commit adbb059
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/package.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ std::vector<double> Package::GetFillMass(double qty) {
if (strategy_ == "uniform" || strategy_ == "normal") {
// only use random if a full package amount is available. if less than one
// full amount is available, below will fill a partial package (no random).
while ((qty > 0) && (qty >= fill_max_)) {
while ( qty > std::max(0,fill_max_) ) {
fill_mass = dist_->sample();
packages.push_back(fill_mass);
qty -= fill_mass;
}
}

if (qty > eps_rsrc() && qty >= fill_min_) {
if (qty > std::max(eps_rsrc(),fill_min_) ) {
// leftover material is enough to fill one more partial package.
packages.push_back(qty);
}
Expand Down
3 changes: 2 additions & 1 deletion src/package.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

#include "error.h"
#include "logger.h"
#include "random_number_generator.h"
class DoubleDistribution;
class DoubleDistribution::Ptr;

namespace cyclus {

Expand Down

0 comments on commit adbb059

Please sign in to comment.