CYCLUS
Loading...
Searching...
No Matches
cyclus::toolkit::CommodityRecipeContext Class Reference

Detailed Description

a CommodityRecipeContext contains relationships between commodities, recipes and resources

Definition at line 19 of file commodity_recipe_context.h.

#include <commodity_recipe_context.h>

Inheritance diagram for cyclus::toolkit::CommodityRecipeContext:
cyclus::StateWrangler

Public Member Functions

void AddInCommod (std::string in_commod, std::string in_recipe, std::string out_commod, std::string out_recipe)
 
void AddRsrc (std::string commod, Resource::Ptr rsrc)
 
virtual CommodityRecipeContextClone ()
 
std::string commod (Resource::Ptr rsrc)
 
const std::set< std::string > & in_commods () const
 
std::string in_recipe (std::string in_commod)
 
virtual void InfileToDb (InfileTree *qe, DbInit di)
 
virtual void InitFrom (QueryableBackend *b)
 
bool operator!= (const CommodityRecipeContext &other) const
 
bool operator== (const CommodityRecipeContext &other) const
 
std::string out_commod (std::string in_commod)
 
const std::set< std::string > & out_commods () const
 
std::string out_recipe (std::string in_commod)
 
void RemoveRsrc (Resource::Ptr rsrc)
 
virtual std::string schema ()
 
virtual void Snapshot (DbInit di)
 
void UpdateInRec (std::string in_commod, std::string recipe)
 
void UpdateRsrc (std::string commod, Resource::Ptr rsrc)
 

Member Function Documentation

◆ AddInCommod()

void cyclus::toolkit::CommodityRecipeContext::AddInCommod ( std::string in_commod,
std::string in_recipe,
std::string out_commod,
std::string out_recipe )

add an input commodity and its relations

Definition at line 9 of file commodity_recipe_context.cc.

◆ AddRsrc()

void cyclus::toolkit::CommodityRecipeContext::AddRsrc ( std::string commod,
Resource::Ptr rsrc )

add a resource and its commodity affiliation

Definition at line 21 of file commodity_recipe_context.cc.

◆ Clone()

CommodityRecipeContext * cyclus::toolkit::CommodityRecipeContext::Clone ( )
virtual

Return a newly created/allocated object that is an exact copy of this.

Subclasses are expected to override the return type with their own concrete type.

Implements cyclus::StateWrangler.

Definition at line 41 of file commodity_recipe_context.cc.

◆ commod()

std::string cyclus::toolkit::CommodityRecipeContext::commod ( Resource::Ptr rsrc)
inline
Returns
commodity of a material
Warning
returns a blank string if material isn't found

Definition at line 66 of file commodity_recipe_context.h.

◆ in_commods()

const std::set< std::string > & cyclus::toolkit::CommodityRecipeContext::in_commods ( ) const
inline
Returns
input commodities

Definition at line 40 of file commodity_recipe_context.h.

◆ in_recipe()

std::string cyclus::toolkit::CommodityRecipeContext::in_recipe ( std::string in_commod)
inline
Returns
input recipe of an input commodity

Definition at line 55 of file commodity_recipe_context.h.

◆ InfileToDb()

void cyclus::toolkit::CommodityRecipeContext::InfileToDb ( InfileTree * qe,
DbInit di )
virtual

Translates info for the object from input file information to the database by reading parameters from the passed InfileTree and recording data via the DbInit variable.

The simulation and agent id's are automatically injected in all data transfered through di.

Agent parameters in the InfileTree are scoped in the "config/*" path. The superclass InitFrom expects the InfileTree passed to it to be scoped identically to the tree passed to the agent's InitFrom. - do NOT pass a changed-scope tree to the superclass.

Warning
this method MUST NOT modify the object's state.

Implements cyclus::StateWrangler.

Definition at line 45 of file commodity_recipe_context.cc.

◆ InitFrom()

void cyclus::toolkit::CommodityRecipeContext::InitFrom ( QueryableBackend * b)
virtual

Intializes an agent's internal state from an output database.

Appropriate simulation id, agent id, and time filters are automatically included in all queries.

Implements cyclus::StateWrangler.

Definition at line 58 of file commodity_recipe_context.cc.

◆ operator!=()

bool cyclus::toolkit::CommodityRecipeContext::operator!= ( const CommodityRecipeContext & other) const
inline

Definition at line 79 of file commodity_recipe_context.h.

◆ operator==()

bool cyclus::toolkit::CommodityRecipeContext::operator== ( const CommodityRecipeContext & other) const
inline

Definition at line 70 of file commodity_recipe_context.h.

◆ out_commod()

std::string cyclus::toolkit::CommodityRecipeContext::out_commod ( std::string in_commod)
inline
Returns
output commodity of an input commodity

Definition at line 50 of file commodity_recipe_context.h.

◆ out_commods()

const std::set< std::string > & cyclus::toolkit::CommodityRecipeContext::out_commods ( ) const
inline
Returns
output commodities

Definition at line 45 of file commodity_recipe_context.h.

◆ out_recipe()

std::string cyclus::toolkit::CommodityRecipeContext::out_recipe ( std::string in_commod)
inline
Returns
output recipe of an input recipe

Definition at line 60 of file commodity_recipe_context.h.

◆ RemoveRsrc()

void cyclus::toolkit::CommodityRecipeContext::RemoveRsrc ( Resource::Ptr rsrc)

removes a resource from the context

Definition at line 26 of file commodity_recipe_context.cc.

◆ schema()

std::string cyclus::toolkit::CommodityRecipeContext::schema ( )
virtual

Returns an object's xml rng schema for initializing from input files.

Implements cyclus::StateWrangler.

Definition at line 99 of file commodity_recipe_context.cc.

◆ Snapshot()

void cyclus::toolkit::CommodityRecipeContext::Snapshot ( DbInit di)
virtual

Snapshots agent-internal state to the output db via di.

This method MUST call the superclass' Snapshot method before doing any work. The simulation and agent id's in addition to the snapshot time are automatically included in all information transfered through di.

Warning
because a 'Time' field is automatically injected, that label cannot be used for any other fields.
This method MUST NOT modify the agent's state.

Implements cyclus::StateWrangler.

Definition at line 78 of file commodity_recipe_context.cc.

◆ UpdateInRec()

void cyclus::toolkit::CommodityRecipeContext::UpdateInRec ( std::string in_commod,
std::string recipe )

update an input recipe and its commodity affiliation

Definition at line 36 of file commodity_recipe_context.cc.

◆ UpdateRsrc()

void cyclus::toolkit::CommodityRecipeContext::UpdateRsrc ( std::string commod,
Resource::Ptr rsrc )

update a resource and its commodity affiliation

Definition at line 31 of file commodity_recipe_context.cc.


The documentation for this class was generated from the following files: