CYCLUS
Loading...
Searching...
No Matches
commodity_producer.cc
Go to the documentation of this file.
2
3namespace cyclus {
4namespace toolkit {
5
6CommodInfo::CommodInfo(double default_capacity, double default_cost)
7 : capacity(default_capacity), cost(default_cost) {}
8
10 double default_cost,
11 Agent* agent)
13 default_capacity_(default_capacity),
14 default_cost_(default_cost) {}
15
17
18std::set<Commodity, CommodityCompare> CommodityProducer::ProducedCommodities() {
19 std::set<Commodity, CommodityCompare> commodities;
20 std::map<Commodity, CommodInfo, CommodityCompare>::iterator it;
21 for (it = commodities_.begin(); it != commodities_.end(); it++) {
22 commodities.insert(it->first);
23 }
24 return commodities;
25}
26
28 std::set<Commodity, CommodityCompare> commodities =
29 source->ProducedCommodities();
30 std::set<Commodity, CommodityCompare>::iterator it;
31 for (it = commodities.begin(); it != commodities.end(); it++) {
32 Add(*it);
33 SetCapacity(*it, source->Capacity(*it));
34 SetCost(*it, source->Cost(*it));
35 }
36}
37
38} // namespace toolkit
39} // namespace cyclus
The abstract base class used by all types of agents that live and interact in a simulation.
Definition agent.h:50
AgentManaged(Agent *agent=NULL)
void SetCapacity(const Commodity &commodity, double capacity)
Set the production capacity for a given commodity.
double Capacity(const Commodity &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.
double Cost(const Commodity &commodity)
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
CommodInfo(double default_capacity=0, double default_cost=kModifierLimit)