Skip to content

Commit

Permalink
remove unnecessary check on fill mass size
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearkatie committed Aug 29, 2024
1 parent d8e60f2 commit 4d36b5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/package.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ std::pair<double, int> Package::GetFillMass(double qty) {
}
}
fill_mass = std::min(qty, fill_mass);
if (fill_mass >= fill_min_) {
num_at_fill_mass = static_cast<int>(std::floor(qty / fill_mass));
return std::pair<double, int>(fill_mass, num_at_fill_mass);
} else {
return std::pair<double, int>(0, 0);
}
num_at_fill_mass = static_cast<int>(std::floor(qty / fill_mass));
return std::pair<double, int>(fill_mass, num_at_fill_mass);
}

Package::Package(std::string name, double fill_min, double fill_max,
Expand Down
2 changes: 0 additions & 2 deletions src/toolkit/matl_sell_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ std::set<BidPortfolio<Material>::Ptr> MatlSellPolicy::GetMatlBids(
std::pair<double, int> fill = package_->GetFillMass(qty);
bid_qty = excl ? quantize_ : fill.first;
if (bid_qty != 0) {
std::cerr << "bid_qty: " << bid_qty << std::endl;
std::cerr << "full bids: " << fill.second << std::endl;
n_full_bids = excl ? std::floor(qty / quantize_) : fill.second;

// Throw if number of bids above limit or if casting to int caused
Expand Down

0 comments on commit 4d36b5c

Please sign in to comment.