diff --git a/CHANGELOG.rst b/CHANGELOG.rst index aedb0d533..4902da3e9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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:** diff --git a/src/source.cc b/src/source.cc index 751aaa763..4ffc3f560 100644 --- a/src/source.cc +++ b/src/source.cc @@ -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::Ptr> Source::GetMatlBids( diff --git a/src/source.h b/src/source.h index 0024f20f4..db179d93a 100644 --- a/src/source.h +++ b/src/source.h @@ -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 >& trades, std::vector, diff --git a/src/source_tests.cc b/src/source_tests.cc index 10208e733..d2ea3ec2b 100644 --- a/src/source_tests.cc +++ b/src/source_tests.cc @@ -15,7 +15,7 @@ void SourceTest::SetUp() { trader = tc.trader(); InitParameters(); SetUpSource(); - src_facility->EnterNotify(); + src_facility->Build(NULL); } void SourceTest::TearDown() {