diff --git a/src/deploy_inst.cc b/src/deploy_inst.cc index 1b12dcb978..29f02c1869 100644 --- a/src/deploy_inst.cc +++ b/src/deploy_inst.cc @@ -7,7 +7,7 @@ DeployInst::DeployInst(cyclus::Context* ctx) : cyclus::Institution(ctx), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) {} + coordinates(0,0) {} DeployInst::~DeployInst() {} @@ -48,6 +48,10 @@ void DeployInst::Build(cyclus::Agent* parent) { void DeployInst::EnterNotify() { cyclus::Institution::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); + int n = prototypes.size(); if (build_times.size() != n) { std::stringstream ss; @@ -65,19 +69,6 @@ void DeployInst::EnterNotify() { << " lifetimes vals, expected " << n; throw cyclus::ValueError(ss.str()); } - RecordPosition(); -} - -void DeployInst::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); } extern "C" cyclus::Agent* ConstructDeployInst(cyclus::Context* ctx) { diff --git a/src/deploy_inst.h b/src/deploy_inst.h index cc6dc3ea15..13bf02dd19 100644 --- a/src/deploy_inst.h +++ b/src/deploy_inst.h @@ -19,8 +19,7 @@ typedef std::map > BuildSched; // lifetimes. The same prototype can be specified multiple times with any // combination of the same or different build times, build number, and // lifetimes. -class DeployInst : public cyclus::Institution, - public cyclus::toolkit::Position { +class DeployInst : public cyclus::Institution { #pragma cyclus note { \ "doc": \ "Builds and manages agents (facilities) according to a manually" \ @@ -84,26 +83,10 @@ class DeployInst : public cyclus::Institution, std::vector lifetimes; private: - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - /// Records an agent's latitude and longitude to the output db - void RecordPosition(); }; } // namespace cycamore diff --git a/src/deploy_inst_tests.cc b/src/deploy_inst_tests.cc index 2c177aa318..9c984e7c38 100644 --- a/src/deploy_inst_tests.cc +++ b/src/deploy_inst_tests.cc @@ -141,7 +141,7 @@ TEST(DeployInstTests, NoDupProtos) { EXPECT_EQ(1, stmt->GetInt(0)); } -TEST(DeployInstTests, PositionInitialize) { +TEST(DeployInstTests, PositionDefault) { std::string config = " foobar " " 1 " @@ -158,7 +158,7 @@ TEST(DeployInstTests, PositionInitialize) { EXPECT_EQ(qr.GetVal("Longitude"), 0.0); } -TEST(DeployInstTests, PositionInitialize2) { +TEST(DeployInstTests, PositionInitialize) { std::string config = " foobar " " -20.0 " diff --git a/src/enrichment.cc b/src/enrichment.cc index b5fea0e405..c9074536e2 100644 --- a/src/enrichment.cc +++ b/src/enrichment.cc @@ -25,7 +25,7 @@ Enrichment::Enrichment(cyclus::Context* ctx) order_prefs(true), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) {} + coordinates(0,0) {} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Enrichment::~Enrichment() {} @@ -55,11 +55,18 @@ void Enrichment::Build(cyclus::Agent* parent) { LOG(cyclus::LEV_DEBUG2, "EnrFac") << "Enrichment " << " entering the simuluation: "; LOG(cyclus::LEV_DEBUG2, "EnrFac") << str(); - RecordPosition(); +} + +void Enrichment::EnterNotify() { + cyclus::Facility::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); + } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Enrichment::Tick() { +void Enrichment::Tick() { current_swu_capacity = SwuCapacity(); } @@ -468,19 +475,6 @@ double Enrichment::FeedAssay() { return cyclus::toolkit::UraniumAssayMass(fission_matl); } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Enrichment::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - extern "C" cyclus::Agent* ConstructEnrichment(cyclus::Context* ctx) { return new Enrichment(ctx); diff --git a/src/enrichment.h b/src/enrichment.h index f0bb9210ad..e824c2c708 100644 --- a/src/enrichment.h +++ b/src/enrichment.h @@ -115,9 +115,7 @@ class NatUConverter : public cyclus::Converter { /// no associated recipe. Bids for tails are constrained only by total /// tails inventory. -class Enrichment - : public cyclus::Facility, - public cyclus::toolkit::Position { +class Enrichment : public cyclus::Facility { #pragma cyclus note { \ "niche": "enrichment facility", \ "doc": \ @@ -172,6 +170,7 @@ class Enrichment /// perform module-specific tasks when entering the simulation virtual void Build(cyclus::Agent* parent); // --- + virtual void EnterNotify(); // --- Agent Members --- /// Each facility is prompted to do its beginning-of-time-step @@ -380,26 +379,11 @@ class Enrichment double intra_timestep_swu_; double intra_timestep_feed_; - friend class EnrichmentTest; - // --- - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; + friend class EnrichmentTest; - cyclus::toolkit::Position coordinates; }; } // namespace cycamore diff --git a/src/enrichment_tests.cc b/src/enrichment_tests.cc index 1522b8c862..95eb0df37f 100644 --- a/src/enrichment_tests.cc +++ b/src/enrichment_tests.cc @@ -725,7 +725,7 @@ TEST_F(EnrichmentTest, Response) { } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -TEST_F(EnrichmentTest, PositionInitialize) { +TEST_F(EnrichmentTest, PositionDefault) { // this tests verifies the initialization of the latitude variable std::string config = @@ -752,7 +752,7 @@ TEST_F(EnrichmentTest, PositionInitialize) { EXPECT_EQ(qr.GetVal("Longitude"), 0.0); } -TEST_F(EnrichmentTest, PositionInitialize2) { +TEST_F(EnrichmentTest, PositionInitialize) { // this tests verifies the initialization of the longitude // variable diff --git a/src/fuel_fab.cc b/src/fuel_fab.cc index f64d928d1e..e226811f5c 100644 --- a/src/fuel_fab.cc +++ b/src/fuel_fab.cc @@ -131,16 +131,19 @@ class TopupConverter : public cyclus::Converter { }; FuelFab::FuelFab(cyclus::Context* ctx) - : cyclus::Facility(ctx), - fill_size(0), - fiss_size(0), + : cyclus::Facility(ctx), + fill_size(0), + fiss_size(0), throughput(0), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) {} + coordinates(0,0) {} void FuelFab::EnterNotify() { cyclus::Facility::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); if (fiss_commod_prefs.empty()) { for (int i = 0; i < fiss_commods.size(); i++) { @@ -163,7 +166,6 @@ void FuelFab::EnterNotify() { << " fill_commod_prefs vals, expected " << fill_commods.size(); throw cyclus::ValidationError(ss.str()); } - RecordPosition(); } std::set::Ptr> FuelFab::GetMatlRequests() { @@ -397,7 +399,7 @@ void FuelFab::GetMatlTrades( responses) { using cyclus::Trade; - // guard against cases where a buffer is empty - this is okay because some + // guard against cases where a buffer is empty - this is okay because some // trades may not need that particular buffer. double w_fill = 0; if (fill.count() > 0) { @@ -495,18 +497,6 @@ void FuelFab::GetMatlTrades( } } -void FuelFab::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} - extern "C" cyclus::Agent* ConstructFuelFab(cyclus::Context* ctx) { return new FuelFab(ctx); } diff --git a/src/fuel_fab.h b/src/fuel_fab.h index 40607d8705..244b1e87a5 100644 --- a/src/fuel_fab.h +++ b/src/fuel_fab.h @@ -53,9 +53,7 @@ namespace cycamore { /// uranium isotopes in fast reactors." Proceedings of the Conference on /// Breeding. Economics, and Safety in Large Fast Power Reactors. 1963. /// @endcode -class FuelFab - : public cyclus::Facility, - public cyclus::toolkit::Position { +class FuelFab : public cyclus::Facility { #pragma cyclus note { \ "niche": "fabrication", \ "doc": \ @@ -253,26 +251,9 @@ class FuelFab // map std::map*, std::string> req_inventories_; - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - /// Records an agent's latitude and longitude to the output db - void RecordPosition(); }; double CosiWeight(cyclus::Composition::Ptr c, const std::string& spectrum); diff --git a/src/fuel_fab_tests.cc b/src/fuel_fab_tests.cc index 68a029643d..6315e1019e 100644 --- a/src/fuel_fab_tests.cc +++ b/src/fuel_fab_tests.cc @@ -891,7 +891,7 @@ TEST(FuelFabTests, HomogenousBuffers) { } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -TEST(FuelFabTests, PositionInitialize) { +TEST(FuelFabTests, PositionDefault) { cyclus::Env::SetNucDataPath(); std::string config = " natu " @@ -937,7 +937,7 @@ TEST(FuelFabTests, PositionInitialize) { EXPECT_EQ(qr.GetVal("Longitude"), 0.0); } -TEST(FuelFabTests, PositionInitialize2) { +TEST(FuelFabTests, PositionInitialize) { cyclus::Env::SetNucDataPath(); std::string config = " natu " diff --git a/src/growth_region.cc b/src/growth_region.cc index 6175f047ef..3d37a5fcda 100644 --- a/src/growth_region.cc +++ b/src/growth_region.cc @@ -7,11 +7,11 @@ GrowthRegion::GrowthRegion(cyclus::Context* ctx) : cyclus::Region(ctx), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) { - #if !CYCLUS_HAS_COIN + coordinates(0,0) { + #if !CYCLUS_HAS_COIN throw cyclus::Error("Growth Region requires that Cyclus & Cycamore be compiled " "with COIN support."); - #endif + #endif } GrowthRegion::~GrowthRegion() {} @@ -41,6 +41,10 @@ void GrowthRegion::AddCommodityDemand_(std::string commod, void GrowthRegion::EnterNotify() { cyclus::Region::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); + std::set::iterator ait; for (ait = cyclus::Agent::children().begin(); ait != cyclus::Agent::children().end(); @@ -55,7 +59,6 @@ void GrowthRegion::EnterNotify() { << it->first; AddCommodityDemand_(it->first, it->second); } - RecordPosition(); } void GrowthRegion::DecomNotify(Agent* a) { @@ -174,17 +177,6 @@ void GrowthRegion::OrderBuilds(cyclus::toolkit::Commodity& commodity, #endif } -void GrowthRegion::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} extern "C" cyclus::Agent* ConstructGrowthRegion(cyclus::Context* ctx) { return new GrowthRegion(ctx); diff --git a/src/growth_region.h b/src/growth_region.h index 0fe40bb855..6d4522145f 100644 --- a/src/growth_region.h +++ b/src/growth_region.h @@ -35,9 +35,9 @@ typedef std::vector< /// multiple commodities being demanded. /// /// @warning The growth region is experimental -class GrowthRegion : public cyclus::Region, - public cyclus::toolkit::Position { +class GrowthRegion : public cyclus::Region { friend class GrowthRegionTests; + public: /// The default constructor for the GrowthRegion GrowthRegion(cyclus::Context* ctx); @@ -129,26 +129,10 @@ class GrowthRegion : public cyclus::Region, void OrderBuilds(cyclus::toolkit::Commodity& commodity, double unmetdemand); private: - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - /// Records an agent's latitude and longitude to the output db - void RecordPosition(); }; } // namespace cycamore diff --git a/src/growth_region_tests.cc b/src/growth_region_tests.cc index 9226585d69..1b7f9d2f1c 100644 --- a/src/growth_region_tests.cc +++ b/src/growth_region_tests.cc @@ -34,6 +34,60 @@ TEST_F(GrowthRegionTests, init) { EXPECT_TRUE(ManagesCommodity(commodity)); } +TEST_F(GrowthRegionTests, PositionDefault) { + std::string config = + " foobar " + "" + "test_commod" + "" + "" + "0" + "" + "linear" + "1 2" + "" + "" + "" + ""; + + int simdur = 5; + cyclus::MockSim sim(cyclus::AgentSpec(":cycamore:GrowthRegion"), config, simdur); + sim.DummyProto("foobar"); + int id = sim.Run(); + + cyclus::QueryResult qr = sim.db().Query("AgentPosition", NULL); + EXPECT_EQ(qr.GetVal("Latitude"), 0.0); + EXPECT_EQ(qr.GetVal("Longitude"), 0.0); +} + +TEST_F(GrowthRegionTests, PositionInitialize) { + std::string config = + " foobar " + " -20.0 " + " 2.0 " + "" + "test_commod" + "" + "" + "0" + "" + "linear" + "1 2" + "" + "" + "" + ""; + + int simdur = 5; + cyclus::MockSim sim(cyclus::AgentSpec(":cycamore:GrowthRegion"), config, simdur); + sim.DummyProto("foobar"); + int id = sim.Run(); + + cyclus::QueryResult qr = sim.db().Query("AgentPosition", NULL); + EXPECT_EQ(qr.GetVal("Latitude"), 2.0); + EXPECT_EQ(qr.GetVal("Longitude"), -20.0); +} + } // namespace cycamore // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/manager_inst.cc b/src/manager_inst.cc index 8cccfc7363..c34017e741 100644 --- a/src/manager_inst.cc +++ b/src/manager_inst.cc @@ -5,10 +5,10 @@ namespace cycamore { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ManagerInst::ManagerInst(cyclus::Context* ctx) - : cyclus::Institution(ctx), - latitude(0.0), - longitude(0.0), - coordinates(latitude, longitude) {} + : cyclus::Institution(ctx), + latitude(0.0), + longitude(0.0), + coordinates(0,0) {} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ManagerInst::~ManagerInst() {} @@ -23,6 +23,10 @@ void ManagerInst::DecomNotify(Agent* a) { void ManagerInst::EnterNotify() { cyclus::Institution::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); + std::set::iterator sit; for (sit = cyclus::Agent::children().begin(); sit != cyclus::Agent::children().end(); @@ -43,7 +47,6 @@ void ManagerInst::EnterNotify() { Builder::Register(cp_cast); } } - RecordPosition(); } void ManagerInst::Register_(Agent* a) { @@ -89,18 +92,6 @@ void ManagerInst::WriteProducerInformation( } } -void ManagerInst::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - extern "C" cyclus::Agent* ConstructManagerInst(cyclus::Context* ctx) { return new ManagerInst(ctx); diff --git a/src/manager_inst.h b/src/manager_inst.h index ac86d81f1a..632c747dd4 100644 --- a/src/manager_inst.h +++ b/src/manager_inst.h @@ -13,8 +13,7 @@ namespace cycamore { class ManagerInst : public cyclus::Institution, public cyclus::toolkit::CommodityProducerManager, - public cyclus::toolkit::Builder, - public cyclus::toolkit::Position { + public cyclus::toolkit::Builder { public: /// Default constructor ManagerInst(cyclus::Context* ctx); @@ -61,26 +60,9 @@ class ManagerInst } std::vector prototypes; - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - /// Records an agent's latitude and longitude to the output db - void RecordPosition(); }; } // namespace cycamore diff --git a/src/manager_inst_tests.cc b/src/manager_inst_tests.cc index e9f931095d..c7e8746d5c 100644 --- a/src/manager_inst_tests.cc +++ b/src/manager_inst_tests.cc @@ -53,6 +53,36 @@ TEST_F(ManagerInstTests, productioncapacity) { EXPECT_EQ(src_inst->TotalCapacity(commodity), 0); } +TEST_F(ManagerInstTests, PositionDefault) { + std::string config = + " foobar "; + + int simdur = 5; + cyclus::MockSim sim(cyclus::AgentSpec(":cycamore:ManagerInst"), config, simdur); + sim.DummyProto("foobar"); + int id = sim.Run(); + + cyclus::QueryResult qr = sim.db().Query("AgentPosition", NULL); + EXPECT_EQ(qr.GetVal("Latitude"), 0.0); + EXPECT_EQ(qr.GetVal("Longitude"), 0.0); +} + +TEST_F(ManagerInstTests, PositionInitialize) { + std::string config = + " foobar " + " -20.0 " + " 2.0 "; + + int simdur = 5; + cyclus::MockSim sim(cyclus::AgentSpec(":cycamore:ManagerInst"), config, simdur); + sim.DummyProto("foobar"); + int id = sim.Run(); + + cyclus::QueryResult qr = sim.db().Query("AgentPosition", NULL); + EXPECT_EQ(qr.GetVal("Latitude"), 2.0); + EXPECT_EQ(qr.GetVal("Longitude"), -20.0); +} + // required to get functionality in cyclus agent unit tests library #ifndef CYCLUS_AGENT_TESTS_CONNECTED int ConnectAgentTests(); diff --git a/src/mixer.cc b/src/mixer.cc index fdbcb4db19..8e42ee65be 100644 --- a/src/mixer.cc +++ b/src/mixer.cc @@ -4,15 +4,14 @@ namespace cycamore { -Mixer::Mixer(cyclus::Context* ctx) - : cyclus::Facility(ctx), +Mixer::Mixer(cyclus::Context* ctx) + : cyclus::Facility(ctx), throughput(0), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) { + coordinates(0,0) { cyclus::Warn( "the Mixer archetype is experimental"); - RecordPosition(); } cyclus::Inventories Mixer::SnapshotInv() { @@ -45,6 +44,9 @@ void Mixer::InitInv(cyclus::Inventories& inv) { void Mixer::EnterNotify() { cyclus::Facility::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); mixing_ratios.clear(); in_buf_sizes.clear(); @@ -152,10 +154,10 @@ Mixer::GetMatlRequests() { } std::set::Ptr> ports; - + for (int i = 0; i < in_commods.size(); i++) { std::string name = "in_stream_" + std::to_string(i); - + if (streambufs[name].space() > cyclus::eps_rsrc()) { RequestPortfolio::Ptr port( new RequestPortfolio()); @@ -164,7 +166,7 @@ Mixer::GetMatlRequests() { m = cyclus::NewBlankMaterial(streambufs[name].space()); std::vector*> reqs; - + std::map::iterator it; for (it = in_commods[i].begin() ; it != in_commods[i].end(); it++) { std::string commod = it->first; @@ -172,7 +174,7 @@ Mixer::GetMatlRequests() { reqs.push_back(port->AddRequest(m, this, commod , pref, false)); req_inventories_[reqs.back()] = name; } - port->AddMutualReqs(reqs); + port->AddMutualReqs(reqs); ports.insert(port); } } @@ -209,18 +211,6 @@ void Mixer::AcceptMatlTrades( req_inventories_.clear(); } -void Mixer::RecordPosition() { - std::string specification = spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} - extern "C" cyclus::Agent* ConstructMixer(cyclus::Context* ctx) { return new Mixer(ctx); } diff --git a/src/mixer.h b/src/mixer.h index 2e4863e320..7b949edf53 100644 --- a/src/mixer.h +++ b/src/mixer.h @@ -12,9 +12,7 @@ namespace cycamore { /// one for each streams to be mixed, and one output stream. The supplying of /// mixed material is constrained by available inventory of mixed material /// quantities. -class Mixer - : public cyclus::Facility, - public cyclus::toolkit::Position { +class Mixer : public cyclus::Facility { #pragma cyclus note { \ "niche": "mixing facility", \ "doc": "Mixer mixes N streams with fixed, static, user-specified" \ @@ -58,6 +56,7 @@ class Mixer virtual void InitInv(cyclus::Inventories& inv); protected: + #pragma cyclus var { \ "alias": ["in_streams", [ "stream", [ "info", "mixing_ratio", "buf_size"], [ "commodities", "commodity", "pref"]]], \ "uitype": ["oneormore", [ "pair", ["pair", "double", "double"], ["oneormore", "incommodity", "double"]]], \ @@ -113,26 +112,10 @@ class Mixer cyclus::toolkit::MatlSellPolicy sell_policy; private: - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - /// Records an agent's latitude and longitude to the output db - void RecordPosition(); }; } // namespace cycamore diff --git a/src/mixer_tests.cc b/src/mixer_tests.cc index 5dc58f37a2..f6a62dc99d 100644 --- a/src/mixer_tests.cc +++ b/src/mixer_tests.cc @@ -461,7 +461,7 @@ TEST(MixerTests, CompleteMixingProcess) { EXPECT_DOUBLE_EQ(1., m->quantity()); } -TEST(MixerTests, PositionInitialize) { +TEST(MixerTests, PositionDefault) { std::string config = "" "" @@ -519,4 +519,64 @@ TEST(MixerTests, PositionInitialize) { EXPECT_EQ(qr.GetVal("Longitude"), 0.0); } +TEST(MixerTests, PositionInitialize) { + std::string config = + "" + "" + "" + "0.8" + "2.5" + "" + "" + "" + "stream1" + "1" + "" + "" + "" + "" + "" + "0.15" + "3" + "" + "" + "" + "stream2" + "1" + "" + "" + "" + "" + "" + "0.05" + "5" + "" + "" + "" + "stream3" + "1" + "" + "" + "" + "" + "mixedstream" + "0" + " -20.0 " + " 2.0 " + "0"; + int simdur = 1; + cyclus::MockSim sim(cyclus::AgentSpec(":cycamore:Mixer"), config, simdur); + sim.AddSource("stream1").recipe("unatstream").capacity(1).Finalize(); + sim.AddSource("stream2").recipe("uoxstream").capacity(1).Finalize(); + sim.AddSource("stream3").recipe("pustream").capacity(1).Finalize(); + sim.AddRecipe("unatstream", c_natu()); + sim.AddRecipe("uoxstream", c_pustream()); + sim.AddRecipe("pustream", c_uox()); + int id = sim.Run(); + + QueryResult qr = sim.db().Query("AgentPosition", NULL); + EXPECT_EQ(qr.GetVal("Latitude"), 2.0); + EXPECT_EQ(qr.GetVal("Longitude"), -20.0); +} + } // namespace cycamore diff --git a/src/reactor.cc b/src/reactor.cc index 24d2d6d85c..255fd1a93b 100644 --- a/src/reactor.cc +++ b/src/reactor.cc @@ -25,8 +25,7 @@ Reactor::Reactor(cyclus::Context* ctx) discharged(false), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) {} - + coordinates(0,0) {} #pragma cyclus def clone cycamore::Reactor @@ -63,6 +62,9 @@ void Reactor::InitFrom(cyclus::QueryableBackend* b) { void Reactor::EnterNotify() { cyclus::Facility::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); // If the user ommitted fuel_prefs, we set it to zeros for each fuel // type. Without this segfaults could occur - yuck. @@ -107,7 +109,6 @@ void Reactor::EnterNotify() { if (ss.str().size() > 0) { throw cyclus::ValueError(ss.str()); } - RecordPosition(); } bool Reactor::CheckDecommissionCondition() { @@ -231,7 +232,7 @@ std::set::Ptr> Reactor::GetMatlRequests() { double pref = fuel_prefs[j]; Composition::Ptr recipe = context()->GetRecipe(fuel_inrecipes[j]); m = Material::CreateUntracked(assem_size, recipe); - + Request* r = port->AddRequest(m, this, commod, pref, true); mreqs.push_back(r); } @@ -558,18 +559,6 @@ void Reactor::Record(std::string name, std::string val) { ->Record(); } -void Reactor::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} - extern "C" cyclus::Agent* ConstructReactor(cyclus::Context* ctx) { return new Reactor(ctx); } diff --git a/src/reactor.h b/src/reactor.h index d412f2026c..24bccb6267 100644 --- a/src/reactor.h +++ b/src/reactor.h @@ -52,9 +52,9 @@ namespace cycamore { /// int) of its assemblies are transmuted to their respective burnt /// compositions. -class Reactor : public cyclus::Facility, - public cyclus::toolkit::CommodityProducer, - public cyclus::toolkit::Position { +class Reactor + : public cyclus::Facility, + public cyclus::toolkit::CommodityProducer { #pragma cyclus note { \ "niche": "reactor", \ "doc": \ @@ -434,26 +434,9 @@ class Reactor : public cyclus::Facility, // populated lazily and no need to persist. std::set uniq_outcommods_; - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - /// Records an agent's latitude and longitude to the output db - void RecordPosition(); }; } // namespace cycamore diff --git a/src/reactor_tests.cc b/src/reactor_tests.cc index 89996cb0c7..5f0e5b52e7 100644 --- a/src/reactor_tests.cc +++ b/src/reactor_tests.cc @@ -591,7 +591,7 @@ TEST(ReactorTests, Retire) { << "failed to generate power for the correct number of time steps"; } -TEST(ReactorTests, PositionInitialize) { +TEST(ReactorTests, PositionDefault) { std::string config = " lwr_fresh " " lwr_spent " @@ -617,7 +617,7 @@ TEST(ReactorTests, PositionInitialize) { EXPECT_EQ(qr.GetVal("Longitude"), 0.0); } -TEST(ReactorTests, PositionInitialize2) { +TEST(ReactorTests, PositionInitialize) { std::string config = " lwr_fresh " " lwr_spent " diff --git a/src/separations.cc b/src/separations.cc index 81abb93285..396ff0e56c 100644 --- a/src/separations.cc +++ b/src/separations.cc @@ -11,11 +11,11 @@ using cyclus::CompMap; namespace cycamore { -Separations::Separations(cyclus::Context* ctx) +Separations::Separations(cyclus::Context* ctx) : cyclus::Facility(ctx), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) {} + coordinates(0,0) {} cyclus::Inventories Separations::SnapshotInv() { cyclus::Inventories invs; @@ -52,6 +52,10 @@ typedef std::map StreamSet; void Separations::EnterNotify() { cyclus::Facility::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); + std::map efficiency_; StreamSet::iterator it; @@ -68,7 +72,6 @@ void Separations::EnterNotify() { for (it2 = stream.second.begin(); it2 != stream.second.end(); it2++) { efficiency_[it2->first] += it2->second; } - RecordPosition(); } std::vector eff_pb_; @@ -368,18 +371,6 @@ bool Separations::CheckDecommissionCondition() { return true; } -void Separations::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} - void Separations::Record(std::string name, double val, std::string type) { context() ->NewDatum("SeparationEvents") diff --git a/src/separations.h b/src/separations.h index 16ba289996..bf70ce95e8 100644 --- a/src/separations.h +++ b/src/separations.h @@ -34,9 +34,7 @@ cyclus::Material::Ptr SepMaterial(std::map effs, /// reduce its stocks by trading and hits this limit for any of its output /// streams, further processing/separations of feed material will halt until /// room is again available in the output streams. -class Separations - : public cyclus::Facility, - public cyclus::toolkit::Position { +class Separations : public cyclus::Facility { #pragma cyclus note { \ "niche": "separations", \ "doc": \ @@ -206,26 +204,10 @@ class Separations // state var. std::map > streambufs; - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - /// Records an agent's latitude and longitude to the output db - void RecordPosition(); + void Record(std::string name, double val, std::string type); }; diff --git a/src/sink.cc b/src/sink.cc index 11c504e6ef..675b432f53 100644 --- a/src/sink.cc +++ b/src/sink.cc @@ -14,8 +14,9 @@ Sink::Sink(cyclus::Context* ctx) capacity(std::numeric_limits::max()), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) { - SetMaxInventorySize(std::numeric_limits::max());} + coordinates(0,0) { + SetMaxInventorySize(std::numeric_limits::max()); +} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sink::~Sink() {} @@ -41,6 +42,9 @@ Sink::~Sink() {} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Sink::EnterNotify() { cyclus::Facility::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); if (in_commod_prefs.size() == 0) { for (int i = 0; i < in_commods.size(); ++i) { @@ -52,7 +56,6 @@ void Sink::EnterNotify() { << " values, expected " << in_commods.size(); throw cyclus::ValueError(ss.str()); } - RecordPosition(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -92,14 +95,14 @@ Sink::GetMatlRequests() { mat = cyclus::NewBlankMaterial(amt); } else { Composition::Ptr rec = this->context()->GetRecipe(recipe_name); - mat = cyclus::Material::CreateUntracked(amt, rec); - } + mat = cyclus::Material::CreateUntracked(amt, rec); + } if (amt > cyclus::eps()) { std::vector*> mutuals; for (int i = 0; i < in_commods.size(); i++) { mutuals.push_back(port->AddRequest(mat, this, in_commods[i], in_commod_prefs[i])); - + } port->AddMutualReqs(mutuals); ports.insert(port); @@ -172,7 +175,7 @@ void Sink::Tick() { commod++) { LOG(cyclus::LEV_INFO4, "SnkFac") << " will request " << requestAmt << " kg of " << *commod << "."; - cyclus::toolkit::RecordTimeSeries("demand"+*commod, this, + cyclus::toolkit::RecordTimeSeries("demand"+*commod, this, requestAmt); } } @@ -193,17 +196,6 @@ void Sink::Tock() { LOG(cyclus::LEV_INFO3, "SnkFac") << "}"; } -void Sink::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - extern "C" cyclus::Agent* ConstructSink(cyclus::Context* ctx) { diff --git a/src/sink.h b/src/sink.h index 97e2c18361..1e237e1c73 100644 --- a/src/sink.h +++ b/src/sink.h @@ -18,9 +18,7 @@ class Context; /// total inventory size. The inventory size and throughput capacity both /// default to infinite. If a recipe is provided, it will request material with /// that recipe. Requests are made for any number of specified commodities. -class Sink - : public cyclus::Facility, - public cyclus::toolkit::Position { +class Sink : public cyclus::Facility { public: Sink(cyclus::Context* ctx); @@ -154,25 +152,9 @@ class Sink #pragma cyclus var {'capacity': 'max_inv_size'} cyclus::toolkit::ResBuf inventory; - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - void RecordPosition(); }; } // namespace cycamore diff --git a/src/sink_tests.cc b/src/sink_tests.cc index 80a81da616..ccabd6d693 100644 --- a/src/sink_tests.cc +++ b/src/sink_tests.cc @@ -269,7 +269,7 @@ TEST_F(SinkTest, Print) { EXPECT_NO_THROW(std::string s = src_facility->str()); } -TEST_F(SinkTest, PositionInitialize) { +TEST_F(SinkTest, PositionDefault) { using cyclus::QueryResult; using cyclus::Cond; @@ -304,7 +304,7 @@ TEST_F(SinkTest, PositionInitialize) { EXPECT_EQ(qr.GetVal("Longitude"), 0.0); } -TEST_F(SinkTest, PositionInitialize2) { +TEST_F(SinkTest, PositionInitialize) { using cyclus::QueryResult; using cyclus::Cond; diff --git a/src/source.cc b/src/source.cc index 3d7490ef81..0c43333434 100644 --- a/src/source.cc +++ b/src/source.cc @@ -1,7 +1,7 @@ #include "source.h" -#include #include +#include #include @@ -13,14 +13,13 @@ Source::Source(cyclus::Context* ctx) inventory_size(std::numeric_limits::max()), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) {} + coordinates(0,0) {} Source::~Source() {} void Source::InitFrom(Source* m) { #pragma cyclus impl initfromcopy cycamore::Source cyclus::toolkit::CommodityProducer::Copy(m); - RecordPosition(); } void Source::InitFrom(cyclus::QueryableBackend* b) { @@ -28,7 +27,6 @@ void Source::InitFrom(cyclus::QueryableBackend* b) { namespace tk = cyclus::toolkit; tk::CommodityProducer::Add(tk::Commodity(outcommod), tk::CommodInfo(throughput, throughput)); - RecordPosition(); } std::string Source::str() { @@ -51,6 +49,14 @@ std::string Source::str() { return ss.str(); } +void Source::EnterNotify() { + cyclus::Facility::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); +} + + std::set::Ptr> Source::GetMatlBids( cyclus::CommodMap::type& commod_requests) { using cyclus::Bid; @@ -60,7 +66,7 @@ std::set::Ptr> Source::GetMatlBids( using cyclus::Request; double max_qty = std::min(throughput, inventory_size); - cyclus::toolkit::RecordTimeSeries("supply"+outcommod, this, + cyclus::toolkit::RecordTimeSeries("supply"+outcommod, this, max_qty); LOG(cyclus::LEV_INFO3, "Source") << prototype() << " is bidding up to " << max_qty << " kg of " << outcommod; @@ -117,18 +123,6 @@ void Source::GetMatlTrades( } } -void Source::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} - extern "C" cyclus::Agent* ConstructSource(cyclus::Context* ctx) { return new Source(ctx); } diff --git a/src/source.h b/src/source.h index 4d49e6df93..3b96daf7b9 100644 --- a/src/source.h +++ b/src/source.h @@ -20,9 +20,9 @@ class Context; /// infinite. Supplies material results in corresponding decrease in /// inventory, and when the inventory size reaches zero, the source can provide /// no more material. -class Source : public cyclus::Facility, - public cyclus::toolkit::CommodityProducer, - public cyclus::toolkit::Position { +class Source + : public cyclus::Facility, + public cyclus::toolkit::CommodityProducer { friend class SourceTest; public: @@ -60,6 +60,8 @@ class Source : public cyclus::Facility, virtual void Tick() {}; virtual void Tock() {}; + + virtual void EnterNotify(); virtual std::string str(); @@ -116,25 +118,9 @@ class Source : public cyclus::Facility, } double throughput; - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" - void RecordPosition(); }; } // namespace cycamore diff --git a/src/source_tests.cc b/src/source_tests.cc index be3133934f..c6aafcb681 100644 --- a/src/source_tests.cc +++ b/src/source_tests.cc @@ -123,10 +123,9 @@ TEST_F(SourceTest, Response) { delete bid; } -TEST_F(SourceTest, PositionInitialize) { +TEST_F(SourceTest, PositionDefault) { std::string config = - "spent_fuel" - ; + "spent_fuel"; int simdur = 3; cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Source"), config, simdur); int id = sim.Run(); @@ -137,7 +136,7 @@ TEST_F(SourceTest, PositionInitialize) { } -TEST_F(SourceTest, Longitude) { +TEST_F(SourceTest, PositionInitialize) { std::string config = "spent_fuel" "-0.01" diff --git a/src/storage.cc b/src/storage.cc index 29f3578535..ccebdc400a 100644 --- a/src/storage.cc +++ b/src/storage.cc @@ -5,13 +5,14 @@ namespace storage { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Storage::Storage(cyclus::Context* ctx) +Storage::Storage(cyclus::Context* ctx) : cyclus::Facility(ctx), latitude(0.0), longitude(0.0), - coordinates(latitude, longitude) { + coordinates(0,0) { cyclus::Warn( - "The Storage Facility is experimental.");}; + "The Storage Facility is experimental."); +} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // pragmas @@ -49,6 +50,10 @@ void Storage::InitFrom(cyclus::QueryableBackend* b) { //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Storage::EnterNotify() { cyclus::Facility::EnterNotify(); + + coordinates = cyclus::toolkit::Position(latitude, longitude); + coordinates.RecordPosition(this); + buy_policy.Init(this, &inventory, std::string("inventory")); // dummy comp, use in_recipe if provided @@ -83,7 +88,6 @@ void Storage::EnterNotify() { ss << "out_commods has " << out_commods.size() << " values, expected 1."; throw cyclus::ValueError(ss.str()); } - RecordPosition(); } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -237,19 +241,6 @@ void Storage::ReadyMatl_(int time) { ready.Push(processing.PopN(to_ready)); } -void Storage::RecordPosition() { - std::string specification = this->spec(); - context() - ->NewDatum("AgentPosition") - ->AddVal("Spec", specification) - ->AddVal("Prototype", this->prototype()) - ->AddVal("AgentId", id()) - ->AddVal("Latitude", latitude) - ->AddVal("Longitude", longitude) - ->Record(); -} - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - extern "C" cyclus::Agent* ConstructStorage(cyclus::Context* ctx) { return new Storage(ctx); diff --git a/src/storage.h b/src/storage.h index e370672aa0..41b2b1f4a2 100644 --- a/src/storage.h +++ b/src/storage.h @@ -65,8 +65,7 @@ namespace storage { /// Matched resources are sent immediately. class Storage : public cyclus::Facility, - public cyclus::toolkit::CommodityProducer, - public cyclus::toolkit::Position { + public cyclus::toolkit::CommodityProducer { public: /// @param ctx the cyclus context for access to simulation-wide parameters Storage(cyclus::Context* ctx); @@ -214,25 +213,8 @@ class Storage //// A policy for sending material cyclus::toolkit::MatlSellPolicy sell_policy; - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical latitude in degrees as a double", \ - "doc": "Latitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double latitude; - - #pragma cyclus var { \ - "default": 0.0, \ - "uilabel": "Geographical longitude in degrees as a double", \ - "doc": "Longitude of the agent's geographical position. The value should " \ - "be expressed in degrees as a double." \ - } - double longitude; - - cyclus::toolkit::Position coordinates; - - void RecordPosition(); + // Adds required header to add geographic coordinates to the archetype + #include "toolkit/position.cycpp.h" friend class StorageTest; }; diff --git a/src/storage_tests.cc b/src/storage_tests.cc index a4f5655bbf..868919c07f 100644 --- a/src/storage_tests.cc +++ b/src/storage_tests.cc @@ -455,7 +455,7 @@ TEST_F(StorageTest, MultipleCommods){ EXPECT_EQ(1, n_trans2) << "expected 1 transactions, got " << n_trans; } -TEST_F(StorageTest, PositionInitialize){ +TEST_F(StorageTest, PositionDefault){ // Verify Storage behavior std::string config = @@ -478,7 +478,7 @@ TEST_F(StorageTest, PositionInitialize){ EXPECT_EQ(qr.GetVal("Longitude"), 0.0); } -TEST_F(StorageTest, Longitude){ +TEST_F(StorageTest, PositionInitialize){ // Verify Storage behavior std::string config = @@ -522,4 +522,4 @@ INSTANTIATE_TEST_CASE_P(StorageFac, FacilityTests, ::testing::Values(&StorageConstructor)); INSTANTIATE_TEST_CASE_P(StorageFac, AgentTests, - ::testing::Values(&StorageConstructor)); \ No newline at end of file + ::testing::Values(&StorageConstructor));