Skip to content

Commit

Permalink
revert some debugging changes that were committed
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibbelink committed Jul 21, 2024
1 parent 4c1d311 commit e601fd3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
6 changes: 4 additions & 2 deletions src/deploy_inst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,24 @@ void DeployInst::DecomNotify(Agent* a) {

void DeployInst::Register_(Agent* a) {
using cyclus::toolkit::CommodityProducer;
using cyclus::toolkit::CommodityProducerManager;

CommodityProducer* cp_cast = dynamic_cast<CommodityProducer*>(a);
if (cp_cast != NULL) {
LOG(cyclus::LEV_INFO3, "mani") << "Registering agent "
<< a->prototype() << a->id()
<< " as a commodity producer.";
cyclus::toolkit::CommodityProducerManager::Register(cp_cast);
CommodityProducerManager::Register(cp_cast);
}
}

void DeployInst::Unregister_(Agent* a) {
using cyclus::toolkit::CommodityProducer;
using cyclus::toolkit::CommodityProducerManager;

CommodityProducer* cp_cast = dynamic_cast<CommodityProducer*>(a);
if (cp_cast != NULL)
cyclus::toolkit::CommodityProducerManager::Unregister(cp_cast);
CommodityProducerManager::Unregister(cp_cast);
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
18 changes: 9 additions & 9 deletions src/enrichment_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -576,18 +576,18 @@ TEST_F(EnrichmentTest, ValidReq) {

double qty = 5; // 5 kg
double product_assay = 0.05; // of 5 w/o enriched U
cyclus::CompMap v;
CompMap v;
v[922350000] = product_assay;
v[922380000] = 1 - product_assay;
v[94239] = 0.5; // 94239 shouldn't be taken into account
Material::Ptr target = Material::CreateUntracked(
qty, cyclus::Composition::CreateFromMass(v));
qty, Composition::CreateFromMass(v));

std::set<cyclus::Nuc> nucs;
nucs.insert(922350000);
nucs.insert(922380000);

cyclus::toolkit::MatQuery mq(target);
MatQuery mq(target);
double mass_frac = mq.mass_frac(nucs);

SWUConverter swuc(feed_assay, tails_assay);
Expand Down Expand Up @@ -615,10 +615,10 @@ TEST_F(EnrichmentTest, Enrich) {
Material::Ptr target = Material::CreateUntracked(
qty + 10, Composition::CreateFromMass(v));

cyclus::toolkit::Assays assays(feed_assay, cyclus::toolkit::UraniumAssayMass(target), tails_assay);
double swu_req = cyclus::toolkit::SwuRequired(qty, assays);
double natu_req = cyclus::toolkit::FeedQty(qty, assays);
double tails_qty = cyclus::toolkit::TailsQty(qty, assays);
Assays assays(feed_assay, UraniumAssayMass(target), tails_assay);
double swu_req = SwuRequired(qty, assays);
double natu_req = FeedQty(qty, assays);
double tails_qty = TailsQty(qty, assays);

double swu_cap = swu_req * 5;
src_facility->SwuCapacity(swu_cap);
Expand All @@ -630,7 +630,7 @@ TEST_F(EnrichmentTest, Enrich) {
EXPECT_NO_THROW(response = DoEnrich(target, qty));
EXPECT_DOUBLE_EQ(src_facility->Tails().quantity(), tails_qty);

cyclus::toolkit::MatQuery q(response);
MatQuery q(response);
EXPECT_EQ(response->quantity(), qty);
EXPECT_EQ(q.mass_frac(922350000), product_assay);
EXPECT_EQ(q.mass_frac(922380000), 1 - product_assay);
Expand Down Expand Up @@ -689,7 +689,7 @@ TEST_F(EnrichmentTest, Response) {

Request<Material>* req =
Request<Material>::Create(target, trader, product_commod);
cyclus::Bid<Material>* bid = Bid<Material>::Create(req, target, src_facility);
Bid<Material>* bid = Bid<Material>::Create(req, target, src_facility);
Trade<Material> trade(req, bid, trade_qty);
trades.push_back(trade);

Expand Down
2 changes: 1 addition & 1 deletion src/sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class Sink
"uitype": "range", \
"range": [1, CY_LARGE_INT], \
"doc": "When a random distribution is used to determine the " \
"frequency of the request, this is the upper bound. Default cyclus::cy_large_int"}
"frequency of the request, this is the upper bound. Default CY_LARGE_INT (1e299)"}
int random_frequency_max;

#pragma cyclus var { \
Expand Down
3 changes: 0 additions & 3 deletions src/storage.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// storage.cc
// Implements the Storage class
#include "storage.h"
#include <iostream>

namespace cycamore {

Expand Down Expand Up @@ -75,8 +74,6 @@ void Storage::InitBuyPolicyParameters() {
if (active_buying_min == -1) {active_buying_min = 1;}
if (active_buying_max == -1) {
active_buying_max = std::numeric_limits<int>::max();}

std::cout << "active_buying_max=" << active_buying_max << std::endl;

active_dist_ = cyclus::NormalIntDist::Ptr (new cyclus::NormalIntDist(active_buying_mean, active_buying_stddev,
active_buying_min, active_buying_max));
Expand Down

0 comments on commit e601fd3

Please sign in to comment.