CYCAMORE
|
The Enrichment facility is a simple Agent that enriches natural uranium in a Cyclus simulation. More...
#include <enrichment.h>
Public Member Functions | |
virtual void | AcceptMatlTrades (const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses) |
The Enrichment place accepted trade Materials in their Inventory. More... | |
virtual void | AcceptMatlTrades (const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses) |
The Enrichment place accepted trade Materials in their Inventory. More... | |
virtual void | AdjustMatlPrefs (cyclus::PrefMap< cyclus::Material >::type &prefs) |
The Enrichment adjusts preferences for offers of natural uranium it has received to maximize U-235 content Any offers that have zero U-235 content are not accepted. More... | |
virtual void | AdjustMatlPrefs (cyclus::PrefMap< cyclus::Material >::type &prefs) |
The Enrichment adjusts preferences for offers of natural uranium it has received to maximize U-235 content Any offers that have zero U-235 content are not accepted. More... | |
virtual Json::Value | annotations () |
virtual void | Build (cyclus::Agent *parent) |
perform module-specific tasks when entering the simulation More... | |
virtual void | Build (cyclus::Agent *parent) |
perform module-specific tasks when entering the simulation More... | |
virtual cyclus::Agent * | Clone () |
Enrichment (cyclus::Context *ctx) | |
Constructor for the Enrichment class. More... | |
Enrichment (cyclus::Context *ctx) | |
Constructor for the Enrichment class. More... | |
virtual std::set< cyclus::BidPortfolio< cyclus::Material >::Ptr > | GetMatlBids (cyclus::CommodMap< cyclus::Material >::type &commod_requests) |
Responds to each request for this facility's commodity. More... | |
virtual std::set< cyclus::BidPortfolio< cyclus::Material >::Ptr > | GetMatlBids (cyclus::CommodMap< cyclus::Material >::type &commod_requests) |
Responds to each request for this facility's commodity. More... | |
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > | GetMatlRequests () |
The Enrichment request Materials of its given commodity. More... | |
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > | GetMatlRequests () |
The Enrichment request Materials of its given commodity. More... | |
virtual void | GetMatlTrades (const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses) |
respond to each trade with a material enriched to the appropriate level given this facility's inventory More... | |
virtual void | GetMatlTrades (const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses) |
respond to each trade with a material enriched to the appropriate level given this facility's inventory More... | |
virtual void | InfileToDb (cyclus::InfileTree *tree, cyclus::DbInit di) |
virtual void | InitFrom (cycamore::Enrichment *m) |
virtual void | InitFrom (cyclus::QueryableBackend *b) |
virtual void | InitInv (cyclus::Inventories &inv) |
virtual std::string | schema () |
void | SetMaxInventorySize (double size) |
void | SetMaxInventorySize (double size) |
virtual void | Snapshot (cyclus::DbInit di) |
virtual cyclus::Inventories | SnapshotInv () |
virtual std::string | str () |
Print information about this agent. More... | |
virtual std::string | str () |
Print information about this agent. More... | |
void | SwuCapacity (double capacity) |
double | SwuCapacity () const |
void | SwuCapacity (double capacity) |
double | SwuCapacity () const |
const cyclus::toolkit::ResBuf< cyclus::Material > & | Tails () const |
const cyclus::toolkit::ResBuf< cyclus::Material > & | Tails () const |
virtual void | Tick () |
Each facility is prompted to do its beginning-of-time-step stuff at the tick of the timer. More... | |
virtual void | Tick () |
Each facility is prompted to do its beginning-of-time-step stuff at the tick of the timer. More... | |
virtual void | Tock () |
Each facility is prompted to its end-of-time-step stuff on the tock of the timer. More... | |
virtual void | Tock () |
Each facility is prompted to its end-of-time-step stuff on the tock of the timer. More... | |
bool | ValidReq (const cyclus::Material::Ptr mat) |
Determines if a particular material is a valid request to respond to. More... | |
bool | ValidReq (const cyclus::Material::Ptr mat) |
Determines if a particular material is a valid request to respond to. More... | |
virtual std::string | version () |
virtual std::string | version () |
virtual | ~Enrichment () |
Destructor for the Enrichment class. More... | |
virtual | ~Enrichment () |
Destructor for the Enrichment class. More... | |
Private Member Functions | |
void | AddMat_ (cyclus::Material::Ptr mat) |
adds a material into the natural uranium inventory More... | |
void | AddMat_ (cyclus::Material::Ptr mat) |
adds a material into the natural uranium inventory More... | |
cyclus::Material::Ptr | Enrich_ (cyclus::Material::Ptr mat, double qty) |
cyclus::Material::Ptr | Enrich_ (cyclus::Material::Ptr mat, double qty) |
double | FeedAssay () |
calculates the feed assay based on the unenriched inventory More... | |
double | FeedAssay () |
calculates the feed assay based on the unenriched inventory More... | |
cyclus::Material::Ptr | Offer_ (cyclus::Material::Ptr req) |
Generates a material offer for a given request. More... | |
cyclus::Material::Ptr | Offer_ (cyclus::Material::Ptr req) |
Generates a material offer for a given request. More... | |
void | RecordEnrichment_ (double natural_u, double swu) |
records and enrichment with the cyclus::Recorder More... | |
void | RecordEnrichment_ (double natural_u, double swu) |
records and enrichment with the cyclus::Recorder More... | |
void | RecordPosition () |
Records an agent's latitude and longitude to the output db. More... | |
void | RecordPosition () |
Records an agent's latitude and longitude to the output db. More... | |
cyclus::Material::Ptr | Request_ () |
generates a request for this facility given its current state. More... | |
cyclus::Material::Ptr | Request_ () |
generates a request for this facility given its current state. More... | |
Friends | |
class | EnrichmentTest |
The Enrichment facility is a simple Agent that enriches natural uranium in a Cyclus simulation.
It does not explicitly compute the physical enrichment process, rather it calculates the SWU required to convert an source uranium recipe (ie. natural uranium) into a requested enriched recipe (ie. 4% enriched uranium), given the natural uranium inventory constraint and its SWU capacity constraint.
The Enrichment facility requests an input commodity and associated recipe whose quantity is its remaining inventory capacity. All facilities trading the same input commodity (even with different recipes) will offer materials for trade. The Enrichment facility accepts any input materials with enrichments less than its tails assay, as long as some U235 is present, and preference increases with U235 content. If no U235 is present in the offered material, the trade preference is set to -1 and the material is not accepted. Any material components other other than U235 and U238 are sent directly to the tails buffer.
The Enrichment facility will bid on any request for its output commodity up to the maximum allowed enrichment (if not specified, default is 100%) It bids on either the request quantity, or the maximum quanity allowed by its SWU constraint or natural uranium inventory, whichever is lower. If multiple output commodities with different enrichment levels are requested and the facility does not have the SWU or quantity capacity to meet all requests, the requests are fully, then partially filled in unspecified but repeatable order.
The Enrichment facility also offers its tails as an output commodity with no associated recipe. Bids for tails are constrained only by total tails inventory.
Definition at line 120 of file _tmp_build/cycamore/enrichment.h.
cycamore::Enrichment::Enrichment | ( | cyclus::Context * | ctx | ) |
Constructor for the Enrichment class.
ctx | the cyclus context for access to simulation-wide parameters |
Definition at line 16 of file _tmp_build/cycamore/enrichment.cc.
Referenced by cycamore::ConstructEnrichment().
|
virtual |
Destructor for the Enrichment class.
Definition at line 32 of file _tmp_build/cycamore/enrichment.cc.
cycamore::Enrichment::Enrichment | ( | cyclus::Context * | ctx | ) |
Constructor for the Enrichment class.
ctx | the cyclus context for access to simulation-wide parameters |
|
virtual |
Destructor for the Enrichment class.
|
virtual |
The Enrichment place accepted trade Materials in their Inventory.
|
virtual |
The Enrichment place accepted trade Materials in their Inventory.
Definition at line 160 of file _tmp_build/cycamore/enrichment.cc.
References AddMat_().
|
private |
adds a material into the natural uranium inventory
if | the material is not the same composition as the feed_recipe |
|
private |
adds a material into the natural uranium inventory
if | the material is not the same composition as the feed_recipe |
Definition at line 303 of file _tmp_build/cycamore/enrichment.cc.
References feed_commod, and inventory.
Referenced by AcceptMatlTrades(), and cycamore::EnrichmentTest::DoAddMat().
|
virtual |
The Enrichment adjusts preferences for offers of natural uranium it has received to maximize U-235 content Any offers that have zero U-235 content are not accepted.
|
virtual |
The Enrichment adjusts preferences for offers of natural uranium it has received to maximize U-235 content Any offers that have zero U-235 content are not accepted.
Definition at line 115 of file _tmp_build/cycamore/enrichment.cc.
References order_prefs, and cycamore::SortBids().
|
inlinevirtual |
Definition at line 433 of file _tmp_build/cycamore/enrichment.h.
|
virtual |
perform module-specific tasks when entering the simulation
|
virtual |
perform module-specific tasks when entering the simulation
Definition at line 47 of file _tmp_build/cycamore/enrichment.cc.
References feed_recipe, initial_feed, inventory, RecordPosition(), and str().
|
inlinevirtual |
Definition at line 366 of file _tmp_build/cycamore/enrichment.h.
References InitFrom().
|
private |
|
private |
Definition at line 362 of file _tmp_build/cycamore/enrichment.cc.
References cycamore::NatUConverter::convert(), current_swu_capacity, FeedAssay(), intra_timestep_feed_, intra_timestep_swu_, inventory, RecordEnrichment_(), tails, and tails_assay.
Referenced by cycamore::EnrichmentTest::DoEnrich(), and GetMatlTrades().
|
private |
calculates the feed assay based on the unenriched inventory
|
private |
calculates the feed assay based on the unenriched inventory
Definition at line 459 of file _tmp_build/cycamore/enrichment.cc.
References inventory.
Referenced by Enrich_(), GetMatlBids(), and str().
|
virtual |
Responds to each request for this facility's commodity.
If a given request is more than this facility's inventory or SWU capacity, it will offer its minimum of its capacities.
|
virtual |
Responds to each request for this facility's commodity.
If a given request is more than this facility's inventory or SWU capacity, it will offer its minimum of its capacities.
Definition at line 173 of file _tmp_build/cycamore/enrichment.cc.
References FeedAssay(), inventory, max_enrich, Offer_(), product_commod, swu_capacity, tails, tails_assay, tails_commod, and ValidReq().
|
virtual |
The Enrichment request Materials of its given commodity.
|
virtual |
The Enrichment request Materials of its given commodity.
Definition at line 82 of file _tmp_build/cycamore/enrichment.cc.
References feed_commod, and Request_().
|
virtual |
respond to each trade with a material enriched to the appropriate level given this facility's inventory
trades | all trades in which this trader is the supplier |
responses | a container to populate with responses to each trade |
|
virtual |
respond to each trade with a material enriched to the appropriate level given this facility's inventory
trades | all trades in which this trader is the supplier |
responses | a container to populate with responses to each trade |
Definition at line 258 of file _tmp_build/cycamore/enrichment.cc.
References current_swu_capacity, Enrich_(), intra_timestep_feed_, intra_timestep_swu_, product_commod, cycamore::string, tails, and tails_commod.
Referenced by cycamore::TEST_F().
|
inlinevirtual |
Definition at line 229 of file _tmp_build/cycamore/enrichment.h.
References cycamore::latitude, cycamore::longitude, and cycamore::string.
|
inlinevirtual |
Definition at line 135 of file _tmp_build/cycamore/enrichment.h.
References feed_commod, feed_recipe, initial_feed, inventory, cycamore::latitude, latitude, cycamore::longitude, longitude, max_enrich, max_feed_inventory, order_prefs, product_commod, swu_capacity, tails, tails_assay, and tails_commod.
Referenced by Clone().
|
inlinevirtual |
Definition at line 182 of file _tmp_build/cycamore/enrichment.h.
References cycamore::latitude, cycamore::longitude, and cycamore::string.
|
inlinevirtual |
Definition at line 562 of file _tmp_build/cycamore/enrichment.h.
|
private |
Generates a material offer for a given request.
The response composition will be comprised only of U235 and U238 at their relative ratio in the requested material. The response quantity will be the same as the requested commodity.
req | the requested material being responded to |
|
private |
Generates a material offer for a given request.
The response composition will be comprised only of U235 and U238 at their relative ratio in the requested material. The response quantity will be the same as the requested commodity.
req | the requested material being responded to |
Definition at line 353 of file _tmp_build/cycamore/enrichment.cc.
Referenced by cycamore::EnrichmentTest::DoOffer(), and GetMatlBids().
|
private |
records and enrichment with the cyclus::Recorder
|
private |
records and enrichment with the cyclus::Recorder
Definition at line 441 of file _tmp_build/cycamore/enrichment.cc.
Referenced by Enrich_().
|
private |
Records an agent's latitude and longitude to the output db.
|
private |
Records an agent's latitude and longitude to the output db.
Definition at line 473 of file _tmp_build/cycamore/enrichment.cc.
References latitude, longitude, and cycamore::string.
Referenced by Build().
|
private |
generates a request for this facility given its current state.
Quantity of the material will be equal to remaining inventory size.
|
private |
generates a request for this facility given its current state.
Quantity of the material will be equal to remaining inventory size.
Definition at line 346 of file _tmp_build/cycamore/enrichment.cc.
References feed_recipe, and inventory.
Referenced by cycamore::EnrichmentTest::DoRequest(), and GetMatlRequests().
|
inlinevirtual |
Definition at line 372 of file _tmp_build/cycamore/enrichment.h.
|
inline |
Definition at line 229 of file src/enrichment.h.
|
inline |
Definition at line 657 of file _tmp_build/cycamore/enrichment.h.
Referenced by cycamore::EnrichmentTest::SetUpSource(), and cycamore::TEST_F().
|
inlinevirtual |
Definition at line 577 of file _tmp_build/cycamore/enrichment.h.
References cycamore::latitude, cycamore::longitude, and cycamore::string.
|
inlinevirtual |
Definition at line 568 of file _tmp_build/cycamore/enrichment.h.
|
virtual |
Print information about this agent.
|
virtual |
Print information about this agent.
Definition at line 35 of file _tmp_build/cycamore/enrichment.cc.
References feed_commod, FeedAssay(), product_commod, SwuCapacity(), tails_assay, and tails_commod.
Referenced by Build().
|
inline |
Definition at line 234 of file src/enrichment.h.
|
inline |
Definition at line 239 of file src/enrichment.h.
|
inline |
Definition at line 662 of file _tmp_build/cycamore/enrichment.h.
Referenced by cycamore::EnrichmentTest::SetUpSource(), and cycamore::TEST_F().
|
inline |
Definition at line 667 of file _tmp_build/cycamore/enrichment.h.
|
inline |
Definition at line 241 of file src/enrichment.h.
References cycamore::coordinates, cycamore::latitude, cycamore::longitude, cycamore::RecordPosition(), and cycamore::string.
|
inline |
Definition at line 669 of file _tmp_build/cycamore/enrichment.h.
References cycamore::RecordPosition().
Referenced by cycamore::TEST_F().
|
virtual |
Each facility is prompted to do its beginning-of-time-step stuff at the tick of the timer.
time | is the time to perform the tick |
|
virtual |
Each facility is prompted to do its beginning-of-time-step stuff at the tick of the timer.
time | is the time to perform the tick |
Definition at line 63 of file _tmp_build/cycamore/enrichment.cc.
References current_swu_capacity, and SwuCapacity().
|
virtual |
Each facility is prompted to its end-of-time-step stuff on the tock of the timer.
time | is the time to perform the tock |
|
virtual |
Each facility is prompted to its end-of-time-step stuff on the tock of the timer.
time | is the time to perform the tock |
Definition at line 69 of file _tmp_build/cycamore/enrichment.cc.
References feed_commod, intra_timestep_feed_, and intra_timestep_swu_.
bool cycamore::Enrichment::ValidReq | ( | const cyclus::Material::Ptr | mat | ) |
Determines if a particular material is a valid request to respond to.
Valid requests must contain U235 and U238 and must have a relative U235-to-U238 ratio less than this facility's tails_assay().
bool cycamore::Enrichment::ValidReq | ( | const cyclus::Material::Ptr | mat | ) |
Determines if a particular material is a valid request to respond to.
Valid requests must contain U235 and U238 and must have a relative U235-to-U238 ratio less than this facility's tails_assay().
Definition at line 250 of file _tmp_build/cycamore/enrichment.cc.
References tails_assay.
Referenced by GetMatlBids(), and cycamore::TEST_F().
|
inlinevirtual |
Definition at line 134 of file _tmp_build/cycamore/enrichment.h.
References CYCAMORE_VERSION.
|
inlinevirtual |
Definition at line 163 of file src/enrichment.h.
References CYCAMORE_VERSION, and cycamore::string.
|
friend |
Definition at line 789 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 806 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 771 of file _tmp_build/cycamore/enrichment.h.
Referenced by Enrich_(), GetMatlTrades(), and Tick().
|
private |
Definition at line 704 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 711 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 739 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 775 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 795 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 802 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 753 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 746 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 760 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 718 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 767 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 780 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 732 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 725 of file _tmp_build/cycamore/enrichment.h.
|
private |
Definition at line 703 of file _tmp_build/cycamore/enrichment.h.
Referenced by AddMat_(), GetMatlRequests(), InitFrom(), cycamore::EnrichmentTest::SetUpSource(), str(), and Tock().
|
private |
Definition at line 710 of file _tmp_build/cycamore/enrichment.h.
Referenced by Build(), InitFrom(), Request_(), and cycamore::EnrichmentTest::SetUpSource().
|
private |
Definition at line 738 of file _tmp_build/cycamore/enrichment.h.
Referenced by Build(), InitFrom(), and cycamore::EnrichmentTest::SetUpSource().
|
private |
Definition at line 787 of file _tmp_build/cycamore/enrichment.h.
Referenced by Enrich_(), GetMatlTrades(), and Tock().
|
private |
Definition at line 786 of file _tmp_build/cycamore/enrichment.h.
Referenced by Enrich_(), GetMatlTrades(), and Tock().
|
private |
Definition at line 774 of file _tmp_build/cycamore/enrichment.h.
Referenced by AddMat_(), Build(), Enrich_(), FeedAssay(), GetMatlBids(), InitFrom(), and Request_().
|
private |
Definition at line 794 of file _tmp_build/cycamore/enrichment.h.
Referenced by InitFrom(), and RecordPosition().
|
private |
Definition at line 801 of file _tmp_build/cycamore/enrichment.h.
Referenced by InitFrom(), and RecordPosition().
|
private |
Definition at line 752 of file _tmp_build/cycamore/enrichment.h.
Referenced by GetMatlBids(), InitFrom(), and cycamore::EnrichmentTest::SetUpSource().
|
private |
Definition at line 745 of file _tmp_build/cycamore/enrichment.h.
Referenced by InitFrom().
|
private |
Definition at line 759 of file _tmp_build/cycamore/enrichment.h.
Referenced by AdjustMatlPrefs(), and InitFrom().
|
private |
Definition at line 717 of file _tmp_build/cycamore/enrichment.h.
Referenced by GetMatlBids(), GetMatlTrades(), InitFrom(), cycamore::EnrichmentTest::SetUpSource(), and str().
|
private |
Definition at line 766 of file _tmp_build/cycamore/enrichment.h.
Referenced by GetMatlBids(), and InitFrom().
|
private |
Definition at line 779 of file _tmp_build/cycamore/enrichment.h.
Referenced by Enrich_(), GetMatlBids(), GetMatlTrades(), and InitFrom().
|
private |
Definition at line 731 of file _tmp_build/cycamore/enrichment.h.
Referenced by Enrich_(), GetMatlBids(), InitFrom(), cycamore::EnrichmentTest::SetUpSource(), str(), and ValidReq().
|
private |
Definition at line 724 of file _tmp_build/cycamore/enrichment.h.
Referenced by GetMatlBids(), GetMatlTrades(), InitFrom(), cycamore::EnrichmentTest::SetUpSource(), and str().