Skip to content

Commit

Permalink
transmute at end and don't transmute unless request comp is different
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearkatie committed Jul 17, 2024
1 parent ba3e22a commit 8f585ce
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,9 @@ void Source::GetMatlTrades(
for (it = trades.begin(); it != trades.end(); ++it) {
if (shippable_trades > 0) {
double qty = it->amt;

// inventory_size -= qty;

Material::Ptr m = inventory.Pop(qty);
if (outrecipe.empty()) {
m->Transmute(it->request->target()->comp());
}


std::vector<Material::Ptr> m_pkgd = m->Package<Material>(context()->GetPackage(package));

if (m->quantity() > cyclus::eps()) {
Expand All @@ -173,6 +168,10 @@ void Source::GetMatlTrades(
shippable_trades -= 1;
}

if (outrecipe.empty() && response->comp() != it->request->target()->comp()) {
response->Transmute(it->request->target()->comp());
}

responses.push_back(std::make_pair(*it, response));
LOG(cyclus::LEV_INFO5, "Source") << prototype() << " sent an order"
<< " for " << response->quantity() << " of " << outcommod;
Expand Down

0 comments on commit 8f585ce

Please sign in to comment.