CYCLUS
Loading...
Searching...
No Matches
commodity_producer.cc
Go to the documentation of this file.
2
3namespace cyclus {
4namespace toolkit {
5
9
11 double default_cost,
12 Agent* agent)
13 : AgentManaged(agent),
14 default_capacity_(default_capacity),
15 default_cost_(default_cost) {}
16
18
19std::set<Commodity, CommodityCompare> CommodityProducer::ProducedCommodities() {
20 std::set<Commodity, CommodityCompare> commodities;
21 std::map<Commodity, CommodInfo, CommodityCompare>::iterator it;
22 for (it = commodities_.begin(); it != commodities_.end(); it++) {
23 commodities.insert(it->first);
24 }
25 return commodities;
26}
27
29 std::set<Commodity, CommodityCompare> commodities =
30 source->ProducedCommodities();
31 std::set<Commodity, CommodityCompare>::iterator it;
32 for (it = commodities.begin(); it != commodities.end(); it++) {
33 Add(*it);
34 SetCapacity(*it, source->Capacity(*it));
35 SetCost(*it, source->Cost(*it));
36 }
37}
38
39} // namespace toolkit
40} // namespace cyclus
The abstract base class used by all types of agents that live and interact in a simulation.
Definition agent.h:49
This is a mixin class that provides an interface to access the underlying agent that manages it.
A mixin to provide information about produced commodities.
void SetCapacity(const Commodity &commodity, double capacity)
Set the production capacity for a given commodity.
void SetCost(const Commodity &commodity, double cost)
Set the production cost for a given commodity.
void Add(const Commodity &commodity)
Register a commodity as being produced by this object.
void Copy(CommodityProducer *source)
Add all commodities produced by a source.
CommodityProducer(double default_capacity=0, double default_cost=kModifierLimit, Agent *agent=NULL)
std::set< Commodity, CommodityCompare > ProducedCommodities()
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
CommodInfo(double default_capacity=0, double default_cost=kModifierLimit)