Skip to content

Commit

Permalink
Merge pull request #623 from nuclearkatie/src_pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke authored Sep 13, 2024
2 parents 58650fe + 517f7fa commit 4eb716e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Since last release

**Added:**
* Added package parameter to storage (#603, #612, #616)
* Added package parameter to source (#613, #617, #621)
* Added package parameter to source (#613, #617, #621, #623)
* Added default keep packaging to reactor (#618, #619)

**Changed:**
Expand Down
11 changes: 8 additions & 3 deletions src/source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,25 @@ std::string Source::str() {
}

void Source::EnterNotify() {
cyclus::Facility::EnterNotify();
RecordPosition();
}

void Source::Build(cyclus::Agent* parent) {
Facility::Build(parent);

using cyclus::CompMap;
using cyclus::Composition;
using cyclus::Material;
cyclus::Facility::EnterNotify();
RecordPosition();

// create all source inventory and place into buf
cyclus::Material::Ptr all_inv;
Composition::Ptr blank_comp = Composition::CreateFromMass(CompMap());

all_inv = (outrecipe.empty() || context() == NULL) ? \
Material::Create(this, inventory_size, blank_comp) : \
Material::Create(this, inventory_size, context()->GetRecipe(outrecipe));
inventory.Push(all_inv);

}

std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr> Source::GetMatlBids(
Expand Down
4 changes: 4 additions & 0 deletions src/source.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class Source : public cyclus::Facility,

virtual void EnterNotify();

/// --- Facility Members ---
/// perform module-specific tasks when entering the simulation
virtual void Build(cyclus::Agent* parent);

virtual void GetMatlTrades(
const std::vector< cyclus::Trade<cyclus::Material> >& trades,
std::vector<std::pair<cyclus::Trade<cyclus::Material>,
Expand Down
2 changes: 1 addition & 1 deletion src/source_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void SourceTest::SetUp() {
trader = tc.trader();
InitParameters();
SetUpSource();
src_facility->EnterNotify();
src_facility->Build(NULL);
}

void SourceTest::TearDown() {
Expand Down

0 comments on commit 4eb716e

Please sign in to comment.