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_];
51 virtual std::string
units()
const {
return "NONE"; }
58 virtual const std::string&
quality()
const {
90 static std::map<std::string, int> qualids_;
91 static int next_qualid_;
97 std::string package_name_;
The abstract base class used by all types of agents that live and interact in a simulation.
A simulation context provides access to necessary simulation-global functions and state.
static std::string unpackaged_name()
A Product is a general type of resource in the Cyclus simulation, and is a catch-all for non-standard...
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().
virtual std::string units() const
Returns the units this resource is based in (e.g. "kg").
static Ptr Create(Agent *creator, double quantity, std::string quality, std::string package_name=Package::unpackaged_name())
Creates a new product that is "live" and tracked.
virtual std::string package_name()
Returns the package id.
virtual int qual_id() const
Returns 0 (for now).
boost::shared_ptr< Product > Ptr
virtual const std::string & quality() const
Returns the quality of this resource (e.g. bananas, human labor, water, etc.).
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.
virtual Resource::Ptr PackageExtract(double qty, std::string new_package_name=Package::unpackaged_name())
void Absorb(Product::Ptr other)
Absorbs the contents of the given 'other' resource into this resource.
virtual const ResourceType type() const
Returns Product::kType.
static const ResourceType kType
virtual void Record(Context *ctx) const
Records the resource's state to the output database.
virtual void ChangePackage(std::string new_package_name=Package::unpackaged_name())
Changes the product's package id.
virtual Resource::Ptr ExtractRes(double quantity)
Splits the resource and returns the extracted portion as a new resource object.
Product::Ptr Extract(double quantity)
Extracts the specified mass from this resource and returns it as a new product object with the same q...
Tracks and records the state and parent-child relationships of resources as they are changed.
Resource defines an abstract interface implemented by types that are offered, requested,...
boost::shared_ptr< Resource > Ptr
Handles initialization of a simulation from the output database.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters