CYCLUS
Loading...
Searching...
No Matches
cyclus::toolkit Namespace Reference

Classes

class  AgentManaged
 
class  Assays
 
class  BasicFunctionFactory
 
class  Builder
 
class  BuildingManager
 
struct  BuildOrder
 
struct  CommodInfo
 
class  Commodity
 
struct  CommodityCompare
 
class  CommodityProducer
 
class  CommodityProducerManager
 
class  CommodityRecipeContext
 
class  ExpFunctionFactory
 
class  ExponentialFunction
 
class  LinearFunction
 
class  LinFunctionFactory
 
class  MatlBuyPolicy
 
class  MatlSellPolicy
 
class  MatQuery
 
class  PiecewiseFunction
 
class  PiecewiseFunctionFactory
 
class  Position
 
class  ResBuf
 
class  ResMap
 
class  SupplyDemandManager
 
class  SymbFunctionFactory
 
class  SymFunction
 

Typedefs

typedef std::vector< Material::PtrMatVec
 
typedef std::vector< Product::PtrProdVec
 
typedef std::vector< Resource::PtrResVec
 
typedef boost::variant< std::function< void(cyclus::Agent *, int, bool, std::string)>, std::function< void(cyclus::Agent *, int, int, std::string)>, std::function< void(cyclus::Agent *, int, float, std::string)>, std::function< void(cyclus::Agent *, int, double, std::string)>, std::function< void(cyclus::Agent *, int, std::string, std::string)> time_series_listener_t)
 

Enumerations

enum  TimeSeriesType : int { POWER , ENRICH_SWU , ENRICH_FEED }
 

Functions

void AddJsonToXml (Json::Value &node, std::stringstream &ss, std::string parent_name, std::string indent)
 
void AddXmlToJson (InfileTree *xnode, Json::Value &jnode, std::string parent_name)
 
double FeedQty (double product_qty, const Assays &assays)
 
void JsonInsertOrAppend (Json::Value &node, std::string key, Json::Value &val)
 
std::string JsonToPy (std::string)
 
std::string JsonToXml (std::string s)
 
void PyCallListeners (std::string tsname, Agent *agent, void *cpp_ctx, int time, boost::spirit::hold_any value)
 
std::string PyToJson (std::string)
 
std::string PyToXml (std::string s)
 
template<TimeSeriesType T>
void RecordTimeSeries (cyclus::Agent *agent, double value, std::string units="")
 
template<typename T >
void RecordTimeSeries (std::string tsname, cyclus::Agent *agent, T value, std::string units="")
 
template<>
void RecordTimeSeries< ENRICH_FEED > (cyclus::Agent *agent, double value, std::string units)
 
template<>
void RecordTimeSeries< ENRICH_SWU > (cyclus::Agent *agent, double value, std::string units)
 
template<>
void RecordTimeSeries< POWER > (cyclus::Agent *agent, double value, std::string units)
 
std::vector< Resource::PtrResCast (std::vector< Material::Ptr > rs)
 
std::vector< Resource::PtrResCast (std::vector< Product::Ptr > rs)
 
std::vector< Resource::PtrResCast (std::vector< Resource::Ptr > rs)
 
Material::Ptr Squash (std::vector< Material::Ptr > ms)
 
Product::Ptr Squash (std::vector< Product::Ptr > ps)
 
Resource::Ptr Squash (std::vector< Resource::Ptr > rs)
 
double SwuRequired (double product_qty, const Assays &assays)
 
double TailsQty (double product_qty, const Assays &assays)
 
double UraniumAssay (Material::Ptr rsrc)
 
double UraniumAssayAtom (Material::Ptr rsrc)
 
double UraniumAssayMass (Material::Ptr rsrc)
 
double UraniumQty (Material::Ptr mat)
 
double ValueFunc (double frac)
 
std::string XmlToJson (std::string s)
 
std::string XmlToPy (std::string s)
 

Variables

std::map< std::string, std::vector< time_series_listener_t > > TIME_SERIES_LISTENERS
 

Typedef Documentation

◆ MatVec

Definition at line 22 of file res_buf.h.

◆ ProdVec

Definition at line 23 of file res_buf.h.

◆ ResVec

Definition at line 21 of file res_buf.h.

◆ time_series_listener_t

typedef boost::variant< std::function<void(cyclus::Agent*, int, bool, std::string)>, std::function<void(cyclus::Agent*, int, int, std::string)>, std::function<void(cyclus::Agent*, int, float, std::string)>, std::function<void(cyclus::Agent*, int, double, std::string)>, std::function<void(cyclus::Agent*, int, std::string, std::string)> cyclus::toolkit::time_series_listener_t)

Stores global information for the time series call backs.

Definition at line 37 of file timeseries.h.

Enumeration Type Documentation

◆ TimeSeriesType

Time series types to be used in the RecordTimeSeries() functions.

These types have the following units which must be adhered to strictly:

  • POWER [MWe]
  • ENRICH_SWU [kg SWU]
  • ENRICH_FEED [kg]
Enumerator
POWER 
ENRICH_SWU 
ENRICH_FEED 

Definition at line 24 of file timeseries.h.

Function Documentation

◆ AddJsonToXml()

void cyclus::toolkit::AddJsonToXml ( Json::Value & node,
std::stringstream & ss,
std::string parent_name,
std::string indent )

Definition at line 15 of file infile_converters.cc.

◆ AddXmlToJson()

void cyclus::toolkit::AddXmlToJson ( InfileTree * xnode,
Json::Value & jnode,
std::string parent_name )

Definition at line 122 of file infile_converters.cc.

◆ FeedQty()

double cyclus::toolkit::FeedQty ( double product_qty,
const Assays & assays )

inline double UraniumQty(Material::Ptr mat) { return UraniumQty(mat.get()); }

Parameters
product_qtythe amount of product Uranium, assuming feed is comprised of only U-235 and U-238
assaysthe assay of product, feed, and tails
Returns
the quantity of feedstock required to make the product whose units match those of the given product

Definition at line 85 of file enrichment.cc.

◆ JsonInsertOrAppend()

void cyclus::toolkit::JsonInsertOrAppend ( Json::Value & node,
std::string key,
Json::Value & val )

Definition at line 104 of file infile_converters.cc.

◆ JsonToPy()

std::string cyclus::toolkit::JsonToPy ( std::string infile)

Convert JSON string to Python simulation string.

Definition at line 94 of file pyhooks.cc.

◆ JsonToXml()

std::string cyclus::toolkit::JsonToXml ( std::string s)

Converts a JSON string into an equivalent XML string.

Definition at line 81 of file infile_converters.cc.

◆ PyCallListeners()

void cyclus::toolkit::PyCallListeners ( std::string tsname,
Agent * agent,
void * cpp_ctx,
int time,
boost::spirit::hold_any value )

Calls the Python listeners.

Definition at line 100 of file pyhooks.cc.

◆ PyToJson()

std::string cyclus::toolkit::PyToJson ( std::string infile)

Convert Python simulation string to JSON.

Definition at line 88 of file pyhooks.cc.

◆ PyToXml()

std::string cyclus::toolkit::PyToXml ( std::string s)

Converts a Python string into an equivalent XML string.

Definition at line 164 of file infile_converters.cc.

◆ RecordTimeSeries() [1/2]

template<TimeSeriesType T>
void cyclus::toolkit::RecordTimeSeries ( cyclus::Agent * agent,
double value,
std::string units = "" )

Records a per-time step quantity for a given type.

◆ RecordTimeSeries() [2/2]

template<typename T >
void cyclus::toolkit::RecordTimeSeries ( std::string tsname,
cyclus::Agent * agent,
T value,
std::string units = "" )

Records a per-time step quantity for a string.

Definition at line 48 of file timeseries.h.

◆ RecordTimeSeries< ENRICH_FEED >()

template<>
void cyclus::toolkit::RecordTimeSeries< ENRICH_FEED > ( cyclus::Agent * agent,
double value,
std::string units )

Definition at line 19 of file timeseries.cc.

◆ RecordTimeSeries< ENRICH_SWU >()

template<>
void cyclus::toolkit::RecordTimeSeries< ENRICH_SWU > ( cyclus::Agent * agent,
double value,
std::string units )

Definition at line 14 of file timeseries.cc.

◆ RecordTimeSeries< POWER >()

template<>
void cyclus::toolkit::RecordTimeSeries< POWER > ( cyclus::Agent * agent,
double value,
std::string units )

Definition at line 9 of file timeseries.cc.

◆ ResCast() [1/3]

std::vector< Resource::Ptr > cyclus::toolkit::ResCast ( std::vector< Material::Ptr > rs)

Casts a vector of Materials into a vector of Resources.

Definition at line 51 of file res_manip.cc.

◆ ResCast() [2/3]

std::vector< Resource::Ptr > cyclus::toolkit::ResCast ( std::vector< Product::Ptr > rs)

Casts a vector of Products into a vector of Resources.

Definition at line 59 of file res_manip.cc.

◆ ResCast() [3/3]

std::vector< Resource::Ptr > cyclus::toolkit::ResCast ( std::vector< Resource::Ptr > rs)

Casts a vector of Resources into a vector of Resources.

This is actually basically a no-op that enables ResBuf to work for plain Resource types.

Definition at line 67 of file res_manip.cc.

◆ Squash() [1/3]

Material::Ptr cyclus::toolkit::Squash ( std::vector< Material::Ptr > ms)

Squash combines all materials in ms and returns the resulting single material.

Definition at line 21 of file res_manip.cc.

◆ Squash() [2/3]

Product::Ptr cyclus::toolkit::Squash ( std::vector< Product::Ptr > ps)

Squash combines all products in ps and returns the resulting single product.

Definition at line 7 of file res_manip.cc.

◆ Squash() [3/3]

Resource::Ptr cyclus::toolkit::Squash ( std::vector< Resource::Ptr > rs)

Squash combines all resources in rs and returns the resulting single resource.

Definition at line 34 of file res_manip.cc.

◆ SwuRequired()

double cyclus::toolkit::SwuRequired ( double product_qty,
const Assays & assays )
Parameters
product_qtythe amount of product Uranium
assaysthe assay of product, feed, and tails
Returns
the amount of swu required to enrich the product

Definition at line 122 of file enrichment.cc.

◆ TailsQty()

double cyclus::toolkit::TailsQty ( double product_qty,
const Assays & assays )
Parameters
product_qtythe amount of product Uranium
assaysthe assay of product, feed, and tails
Returns
the quantity of tails resulting from enriching the product whose units match those of the given product; product_qty and assay must share the same units: both in mass or in atom

Definition at line 94 of file enrichment.cc.

◆ UraniumAssay()

double cyclus::toolkit::UraniumAssay ( Material::Ptr mat)
Parameters
matthe material inquired about
Returns
the atom percent of U-235 w.r.t U-235+U-238 in a material

Definition at line 36 of file enrichment.cc.

◆ UraniumAssayAtom()

double cyclus::toolkit::UraniumAssayAtom ( Material::Ptr mat)
Parameters
matthe material inquired about
Returns
the atom percent of U-235 w.r.t U-235+U-238 in a material

Definition at line 41 of file enrichment.cc.

◆ UraniumAssayMass()

double cyclus::toolkit::UraniumAssayMass ( Material::Ptr mat)
Parameters
matthe material inquired about
Returns
the mass percent of U-235 w.r.t U-235+U-238 in a material

Definition at line 60 of file enrichment.cc.

◆ UraniumQty()

double cyclus::toolkit::UraniumQty ( Material::Ptr mat)

inline double UraniumAssay(Material::Ptr mat) { return UraniumAssay(mat.get()); }

Parameters
matthe material inquired about
Returns
the quantity of uranium in a material whose units match those of the given material

Definition at line 79 of file enrichment.cc.

◆ ValueFunc()

double cyclus::toolkit::ValueFunc ( double frac)
Parameters
fracthe fraction input, this will throw if the fraction value is not in [0,1)
Returns
the value function for a given fraction in [0,1)

Definition at line 103 of file enrichment.cc.

◆ XmlToJson()

std::string cyclus::toolkit::XmlToJson ( std::string s)

Converts an XML string into an equivalent JSON string.

Definition at line 146 of file infile_converters.cc.

◆ XmlToPy()

std::string cyclus::toolkit::XmlToPy ( std::string s)

Converts an XML string into an equivalent JSON string.

Definition at line 168 of file infile_converters.cc.

Variable Documentation

◆ TIME_SERIES_LISTENERS

std::map< std::string, std::vector< time_series_listener_t > > cyclus::toolkit::TIME_SERIES_LISTENERS

Definition at line 6 of file timeseries.cc.