1 #ifndef CYCLUS_SRC_PRODUCT_H_ 2 #define CYCLUS_SRC_PRODUCT_H_ 4 #include <boost/shared_ptr.hpp> 20 friend class ::SimInitTest;
24 boost::shared_ptr<Product>
Ptr;
39 return qualids_[quality_];
81 static std::map<std::string, int> qualids_;
82 static int next_qualid_;
92 #endif // CYCLUS_SRC_PRODUCT_H_
virtual std::string units() const
Returns the units this resource is based in (e.g. "kg").
boost::shared_ptr< Product > Ptr
Tracks and records the state and parent-child relationships of resources as they are changed...
A Product is a general type of resource in the Cyclus simulation, and is a catch-all for non-standard...
virtual Resource::Ptr ExtractRes(double quantity)
Splits the resource and returns the extracted portion as a new resource object.
virtual void Record(Context *ctx) const
Records the resource's state to the output database.
Resource defines an abstract interface implemented by types that are offered, requested, and transferred between simulation agents.
void Absorb(Product::Ptr other)
Absorbs the contents of the given 'other' resource into this resource.
static Ptr Create(Agent *creator, double quantity, std::string quality)
Creates a new product that is "live" and tracked.
virtual const std::string & quality() const
Returns the quality of this resource (e.g. bananas, human labor, water, etc.).
A simulation context provides access to necessary simulation-global functions and state...
boost::shared_ptr< Resource > Ptr
The abstract base class used by all types of agents that live and interact in a simulation.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
virtual const ResourceType type() const
Returns Product::kType.
static const ResourceType kType
virtual Resource::Ptr Clone() const
Returns an untracked (not part of the simulation) copy of the resource.
virtual double quantity() const
Returns the quantity of this resource with dimensions as specified by the return value of units()...
static Ptr CreateUntracked(double quantity, std::string quality)
Creates a new product that does not actually exist as part of the simulation and is untracked...
Handles initialization of a simulation from the output database.
virtual int qual_id() const
Returns 0 (for now).
Product::Ptr Extract(double quantity)
Extracts the specified mass from this resource and returns it as a new product object with the same q...