From 8f585ceea2b23f509b6ac126d7e32da865951857 Mon Sep 17 00:00:00 2001 From: Katie Mummah Date: Wed, 17 Jul 2024 16:07:56 -0500 Subject: [PATCH] transmute at end and don't transmute unless request comp is different --- src/source.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/source.cc b/src/source.cc index 9844318a7..dc20275db 100644 --- a/src/source.cc +++ b/src/source.cc @@ -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 m_pkgd = m->Package(context()->GetPackage(package)); if (m->quantity() > cyclus::eps()) { @@ -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;