From 8db25078b3f3f869b16dee69f2e8931ed2c41bd7 Mon Sep 17 00:00:00 2001 From: Katie Mummah Date: Mon, 30 Sep 2024 10:20:08 -0500 Subject: [PATCH] need RNG in header and >= rather than > --- src/package.cc | 4 ++-- src/package.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/package.cc b/src/package.cc index 6cae23fbe0..4665d93a37 100644 --- a/src/package.cc +++ b/src/package.cc @@ -81,14 +81,14 @@ std::vector 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 > std::max(0,fill_max_) ) { + while ( qty >= std::max(eps_rsrc(), fill_max_) ) { fill_mass = dist_->sample(); packages.push_back(fill_mass); qty -= fill_mass; } } - if (qty > std::max(eps_rsrc(),fill_min_) ) { + if (qty >= std::max(eps_rsrc(),fill_min_) ) { // leftover material is enough to fill one more partial package. packages.push_back(qty); } diff --git a/src/package.h b/src/package.h index 9b75203ab7..eb90920923 100644 --- a/src/package.h +++ b/src/package.h @@ -9,8 +9,7 @@ #include "error.h" #include "logger.h" -class DoubleDistribution; -class DoubleDistribution::Ptr; +#include "random_number_generator.h" namespace cyclus {