1#ifndef CYCLUS_SRC_TOOLKIT_COMMODITY_RECIPE_CONTEXT_H_
2#define CYCLUS_SRC_TOOLKIT_COMMODITY_RECIPE_CONTEXT_H_
37 void UpdateInRec(std::string in_commod, std::string recipe);
40 inline const std::set<std::string>&
in_commods()
const {
return in_commods_; }
49 return out_commod_map_[in_commod];
53 inline std::string
in_recipe(std::string in_commod) {
54 return in_recipes_[in_commod];
59 return out_recipes_[in_commod];
65 return rsrc_commod_map_[rsrc->obj_id()];
69 return (in_commods_.size() == other.in_commods_.size() &&
70 out_commods_.size() == other.out_commods_.size() &&
71 map_compare(out_commod_map_, other.out_commod_map_) &&
74 map_compare(rsrc_commod_map_, other.rsrc_commod_map_));
85 virtual std::string
schema();
88 std::set<std::string> in_commods_;
89 std::set<std::string> out_commods_;
90 std::map<std::string, std::string> out_commod_map_;
91 std::map<std::string, std::string> in_recipes_;
92 std::map<std::string, std::string> out_recipes_;
93 std::map<int, std::string> rsrc_commod_map_;
DbInit provides an interface for agents to record data to the output db that automatically injects th...
A class for extracting information from a given XML parser.
Interface implemented by backends that support rudimentary querying.
boost::shared_ptr< Resource > Ptr
An abjstract interface that must be implemented by all simulation agents and all agent member variabl...
a CommodityRecipeContext contains relationships between commodities, recipes and resources
std::string in_recipe(std::string in_commod)
virtual void Snapshot(DbInit di)
Snapshots agent-internal state to the output db via di.
virtual void InfileToDb(InfileTree *qe, DbInit di)
Translates info for the object from input file information to the database by reading parameters from...
virtual CommodityRecipeContext * Clone()
Return a newly created/allocated object that is an exact copy of this.
std::string out_commod(std::string in_commod)
void AddInCommod(std::string in_commod, std::string in_recipe, std::string out_commod, std::string out_recipe)
add an input commodity and its relations
void RemoveRsrc(Resource::Ptr rsrc)
removes a resource from the context
virtual std::string schema()
Returns an object's xml rng schema for initializing from input files.
void AddRsrc(std::string commod, Resource::Ptr rsrc)
add a resource and its commodity affiliation
std::string commod(Resource::Ptr rsrc)
void UpdateInRec(std::string in_commod, std::string recipe)
update an input recipe and its commodity affiliation
const std::set< std::string > & in_commods() const
void UpdateRsrc(std::string commod, Resource::Ptr rsrc)
update a resource and its commodity affiliation
bool operator!=(const CommodityRecipeContext &other) const
const std::set< std::string > & out_commods() const
virtual void InitFrom(QueryableBackend *b)
Intializes an agent's internal state from an output database.
bool operator==(const CommodityRecipeContext &other) const
std::string out_recipe(std::string in_commod)
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
bool map_compare(Map const &lhs, Map const &rhs)